Commit 0e1a2057 by yuananting

feat:云盘上传文件

parent 83229b62
/* /*
* @Author: 陈剑宇 * @Author: 陈剑宇
* @Date: 2020-10-28 14:27:07 * @Date: 2020-10-28 14:27:07
* @LastEditTime: 2021-02-28 14:22:13 * @LastEditTime: 2021-03-17 20:27:44
* @LastEditors: yuananting * @LastEditors: yuananting
* @Description: * @Description:
* @FilePath: /xiaomai-web-b/app/common/constants/punchClock/punchClock.js * @FilePath: /xiaomai-web-b/app/common/constants/punchClock/punchClock.js
...@@ -113,6 +113,12 @@ export const FILE_ACCEPT = { ...@@ -113,6 +113,12 @@ export const FILE_ACCEPT = {
VOICE: 'audio/x-mpeg,audio/mp3,audio/mpeg,audio/wav,audio/x-m4a' VOICE: 'audio/x-mpeg,audio/mp3,audio/mpeg,audio/wav,audio/x-m4a'
} }
export const MEDIA_FILE_ACCEPT = {
PICTURE: 'JPG,JPEG,PNG,BMP,GIF',
VIDEO: 'MP4',
VOICE: 'MP3'
}
export const QUESTION_FILE_ACCEPT = { export const QUESTION_FILE_ACCEPT = {
PICTURE: 'image/jpg,image/jpeg,image/png,image/gif', PICTURE: 'image/jpg,image/jpeg,image/png,image/gif',
VIDEO: 'audio/mp4,video/mp4', VIDEO: 'audio/mp4,video/mp4',
......
...@@ -2,12 +2,12 @@ ...@@ -2,12 +2,12 @@
* @Author: yuananting * @Author: yuananting
* @Date: 2021-02-25 13:46:35 * @Date: 2021-02-25 13:46:35
* @LastEditors: yuananting * @LastEditors: yuananting
* @LastEditTime: 2021-03-17 10:45:10 * @LastEditTime: 2021-03-18 09:32:02
* @Description: 助学工具-题库-题目管理-新增题目 * @Description: 助学工具-题库-题目管理-新增题目
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
import React, { Component } from "react"; import React, { Component } from "react";
import { Tabs, Button, Tooltip, message } from "antd"; import { Tabs, Button, Tooltip, message, Modal } from "antd";
import Breadcrumbs from "@/components/Breadcrumbs"; import Breadcrumbs from "@/components/Breadcrumbs";
import ShowTips from "@/components/ShowTips"; import ShowTips from "@/components/ShowTips";
import "./AddNewQuestion.less"; import "./AddNewQuestion.less";
...@@ -21,8 +21,16 @@ const { TabPane } = Tabs; ...@@ -21,8 +21,16 @@ const { TabPane } = Tabs;
class AddNewQuestion extends Component { class AddNewQuestion extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
let activeKey = ""
if (getParameterByName("type")) {
activeKey = getParameterByName("type")
} else if (getParameterByName("key")) {
activeKey = getParameterByName("key")
} else {
activeKey = "SINGLE_CHOICE"
}
this.state = { this.state = {
activeKey: getParameterByName("type") || "SINGLE_CHOICE", activeKey: activeKey,
// 构建题目基本结构 // 构建题目基本结构
singleChoiceContent: defineQuestionInfo("SINGLE_CHOICE"), // 单选题 singleChoiceContent: defineQuestionInfo("SINGLE_CHOICE"), // 单选题
multiChoiceContent: defineQuestionInfo("MULTI_CHOICE"), // 多选题 multiChoiceContent: defineQuestionInfo("MULTI_CHOICE"), // 多选题
...@@ -69,7 +77,7 @@ class AddNewQuestion extends Component { ...@@ -69,7 +77,7 @@ class AddNewQuestion extends Component {
}); });
}; };
saveCurrentQuestion = (content) => { saveCurrentQuestion = (content, type, next) => {
content.questionStemList.map((item, index) => { content.questionStemList.map((item, index) => {
item.sort = index; item.sort = index;
return item; return item;
...@@ -101,10 +109,17 @@ class AddNewQuestion extends Component { ...@@ -101,10 +109,17 @@ class AddNewQuestion extends Component {
QuestionBankService.editQuestion(params).then((res) => { QuestionBankService.editQuestion(params).then((res) => {
if (res.success) { if (res.success) {
message.success("保存成功"); message.success("保存成功");
if (next === 'add') {
window.RCHistory.push({
pathname: `/create-new-question?categoryId=${params.categoryId}&key=${type}`,
});
}
if (next === 'close') {
window.RCHistory.push({ window.RCHistory.push({
pathname: `/question-bank-index?categoryId=${params.categoryId}`, pathname: `/question-bank-index?categoryId=${params.categoryId}`,
}); });
} }
}
}); });
} else { } else {
params = { params = {
...@@ -117,15 +132,36 @@ class AddNewQuestion extends Component { ...@@ -117,15 +132,36 @@ class AddNewQuestion extends Component {
QuestionBankService.addQuestion(params).then((res) => { QuestionBankService.addQuestion(params).then((res) => {
if (res.success) { if (res.success) {
message.success("保存成功"); message.success("保存成功");
if (next === 'add') {
window.RCHistory.push({
pathname: `/create-new-question?categoryId=${params.categoryId}&key=${type}`,
});
}
if (next === 'close') {
window.RCHistory.push({ window.RCHistory.push({
pathname: `/question-bank-index?categoryId=${params.categoryId}`, pathname: `/question-bank-index?categoryId=${params.categoryId}`,
}); });
} }
}
}); });
} }
}; };
confirmSaveQuestion = () => { // 取消编辑并返回上一级路由
handleGoBack = () => {
Modal.confirm({
title: '确定要返回吗?',
content: '返回后,本次编辑的内容将不被保存',
okText: '确认返回',
cancelText: '留在本页',
icon: <span className="icon iconfont default-confirm-icon">&#xe6f4;</span>,
onOk: () => {
window.RCHistory.goBack();
}
})
}
confirmSaveQuestion = (next) => {
const { const {
singleChoiceContent, singleChoiceContent,
multiChoiceContent, multiChoiceContent,
...@@ -136,27 +172,27 @@ class AddNewQuestion extends Component { ...@@ -136,27 +172,27 @@ class AddNewQuestion extends Component {
switch (this.state.activeKey) { switch (this.state.activeKey) {
case "SINGLE_CHOICE": case "SINGLE_CHOICE":
if (this.singleChoiceRef.checkInput() === 0) { if (this.singleChoiceRef.checkInput() === 0) {
this.saveCurrentQuestion(singleChoiceContent); this.saveCurrentQuestion(singleChoiceContent, "SINGLE_CHOICE", next);
} }
break; break;
case "MULTI_CHOICE": case "MULTI_CHOICE":
if (this.multiChoiceRef.checkInput() === 0) { if (this.multiChoiceRef.checkInput() === 0) {
this.saveCurrentQuestion(multiChoiceContent); this.saveCurrentQuestion(multiChoiceContent, "MULTI_CHOICE", next);
} }
break; break;
case "JUDGE": case "JUDGE":
if (this.judgeRef.checkInput() === 0) { if (this.judgeRef.checkInput() === 0) {
this.saveCurrentQuestion(judgeContent); this.saveCurrentQuestion(judgeContent, "JUDGE", next);
} }
break; break;
case "GAP_FILLING": case "GAP_FILLING":
if (this.gapRef.checkInput() === 0) { // if (this.gapRef.checkInput() === 0) {
this.saveCurrentQuestion(gapFillingContent); this.saveCurrentQuestion(gapFillingContent, "GAP_FILLING", next);
} // }
break; break;
case "INDEFINITE_CHOICE": case "INDEFINITE_CHOICE":
if (this.indefiniteRef.checkInput() === 0) { if (this.indefiniteRef.checkInput() === 0) {
this.saveCurrentQuestion(indefiniteChoiceContent); this.saveCurrentQuestion(indefiniteChoiceContent, "INDEFINITE_CHOICE", next);
} }
break; break;
} }
...@@ -180,7 +216,7 @@ class AddNewQuestion extends Component { ...@@ -180,7 +216,7 @@ class AddNewQuestion extends Component {
<div className="page add-new-question"> <div className="page add-new-question">
<Breadcrumbs <Breadcrumbs
navList={getParameterByName("id") ? "编辑题目" : "新增题目"} navList={getParameterByName("id") ? "编辑题目" : "新增题目"}
goBack={() => RCHistory.goBack()} goBack={() => this.handleGoBack()}
/> />
<div className="box"> <div className="box">
<div className="show-tips"> <div className="show-tips">
...@@ -198,12 +234,13 @@ class AddNewQuestion extends Component { ...@@ -198,12 +234,13 @@ class AddNewQuestion extends Component {
key="SINGLE_CHOICE" key="SINGLE_CHOICE"
> >
<NewQuestionTab <NewQuestionTab
questionTypeKey="SINGLE_CHOICE" questionTypeKey={activeKey}
onRef={(ref) => { onRef={(ref) => {
this.singleChoiceRef = ref; this.singleChoiceRef = ref;
}} }}
questionInfo={singleChoiceContent} questionInfo={singleChoiceContent}
onSetState={(newContent) => { onSetState={(newContent) => {
console.log("newContent:", newContent)
Object.assign(singleChoiceContent, newContent); Object.assign(singleChoiceContent, newContent);
}} }}
onLogger={this.handleLogger} onLogger={this.handleLogger}
...@@ -214,7 +251,7 @@ class AddNewQuestion extends Component { ...@@ -214,7 +251,7 @@ class AddNewQuestion extends Component {
key="MULTI_CHOICE" key="MULTI_CHOICE"
> >
<NewQuestionTab <NewQuestionTab
questionTypeKey="MULTI_CHOICE" questionTypeKey={activeKey}
onRef={(ref) => { onRef={(ref) => {
this.multiChoiceRef = ref; this.multiChoiceRef = ref;
}} }}
...@@ -230,7 +267,7 @@ class AddNewQuestion extends Component { ...@@ -230,7 +267,7 @@ class AddNewQuestion extends Component {
key="JUDGE" key="JUDGE"
> >
<NewQuestionTab <NewQuestionTab
questionTypeKey="JUDGE" questionTypeKey={activeKey}
onRef={(ref) => { onRef={(ref) => {
this.judgeRef = ref; this.judgeRef = ref;
}} }}
...@@ -245,14 +282,14 @@ class AddNewQuestion extends Component { ...@@ -245,14 +282,14 @@ class AddNewQuestion extends Component {
key="GAP_FILLING" key="GAP_FILLING"
> >
<NewQuestionTab <NewQuestionTab
questionTypeKey="GAP_FILLING" questionTypeKey={activeKey}
onRef={(ref) => { onRef={(ref) => {
this.gapRef = ref; this.gapRef = ref;
}} }}
questionInfo={gapFillingContent} questionInfo={gapFillingContent}
onSetState={(newContent) => { onSetState={(newContent) => {
Object.assign(gapFillingContent, newContent); Object.assign(gapFillingContent, newContent);
console.log("gapFillingContent:", gapFillingContent); console.log("gapFillingContent:", newContent);
}} }}
/> />
</TabPane> </TabPane>
...@@ -268,7 +305,7 @@ class AddNewQuestion extends Component { ...@@ -268,7 +305,7 @@ class AddNewQuestion extends Component {
key="INDEFINITE_CHOICE" key="INDEFINITE_CHOICE"
> >
<NewQuestionTab <NewQuestionTab
questionTypeKey="INDEFINITE_CHOICE" questionTypeKey={activeKey}
onRef={(ref) => { onRef={(ref) => {
this.indefiniteRef = ref; this.indefiniteRef = ref;
}} }}
...@@ -282,12 +319,14 @@ class AddNewQuestion extends Component { ...@@ -282,12 +319,14 @@ class AddNewQuestion extends Component {
</Tabs> </Tabs>
</div> </div>
<div className="footer"> <div className="footer">
<Button>取消</Button> <Button onClick={() => { this.handleGoBack() }}>取消</Button>
<Button>保存并继续添加</Button> <Button onClick={() => {
this.confirmSaveQuestion("add");
}}>保存并继续添加</Button>
<Button <Button
type="primary" type="primary"
onClick={() => { onClick={() => {
this.confirmSaveQuestion(); this.confirmSaveQuestion("close");
}} }}
> >
保存 保存
......
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
* @Author: yuananting * @Author: yuananting
* @Date: 2021-02-25 13:52:01 * @Date: 2021-02-25 13:52:01
* @LastEditors: yuananting * @LastEditors: yuananting
* @LastEditTime: 2021-03-08 19:07:56 * @LastEditTime: 2021-03-18 09:32:11
* @Description: 助学工具-题库-题目管理-新增题目样式 * @Description: 助学工具-题库-题目管理-新增题目样式
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
.add-new-question { .add-new-question {
position: relative !important; position: relative !important;
.box { .box {
margin-bottom: 66px !important; margin-bottom: 66px !important;
......
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
* @Author: yuananting * @Author: yuananting
* @Date: 2021-02-21 18:27:43 * @Date: 2021-02-21 18:27:43
* @LastEditors: yuananting * @LastEditors: yuananting
* @LastEditTime: 2021-03-11 19:10:44 * @LastEditTime: 2021-03-18 09:32:24
* @Description: 助学工具-题库-题库主页面样式 * @Description: 助学工具-题库-题库主页面样式
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
.question-bank-index { .question-bank-index {
.content-body { .content-body {
display: flex; display: flex;
.site-layout-background { .site-layout-background {
......
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
* @Author: yuananting * @Author: yuananting
* @Date: 2021-02-23 19:41:42 * @Date: 2021-02-23 19:41:42
* @LastEditors: yuananting * @LastEditors: yuananting
* @LastEditTime: 2021-03-05 09:34:00 * @LastEditTime: 2021-03-18 09:32:37
* @Description: 助学工具-题库-题目分类管理样式 * @Description: 助学工具-题库-题目分类管理样式
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
.question-category-manage { .question-category-manage {
position: relative; position: relative;
.search-condition { .search-condition {
width: 30%; width: 30%;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: yuananting * @Author: yuananting
* @Date: 2021-02-22 10:59:43 * @Date: 2021-02-22 10:59:43
* @LastEditors: yuananting * @LastEditors: yuananting
* @LastEditTime: 2021-03-15 15:22:13 * @LastEditTime: 2021-03-18 09:33:50
* @Description: 助学工具-题库-题库主页面侧边栏 * @Description: 助学工具-题库-题库主页面侧边栏
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
......
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
* @Author: yuananting * @Author: yuananting
* @Date: 2021-02-22 12:02:34 * @Date: 2021-02-22 12:02:34
* @LastEditors: yuananting * @LastEditors: yuananting
* @LastEditTime: 2021-03-11 20:29:44 * @LastEditTime: 2021-03-18 09:34:06
* @Description: 助学工具-题库-题库主页面侧边栏样式 * @Description: 助学工具-题库-题库主页面侧边栏样式
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
.question-bank-sider { .question-bank-sider {
position: relative; position: relative;
.sider-title { .sider-title {
height: 22px; height: 22px;
......
...@@ -49,9 +49,15 @@ class QuestionEditor extends Component { ...@@ -49,9 +49,15 @@ class QuestionEditor extends Component {
this.renderEditor(); this.renderEditor();
} }
static getDerivedStateFromProps(nextProps, prevState) {
return {
detailInfo: nextProps.detailInfo
}
}
shouldComponentUpdate(nextProps, nextState) { shouldComponentUpdate(nextProps, nextState) {
const { detailInfo } = nextProps; const { detailInfo } = nextProps;
if (this.props.detailInfo !== detailInfo) { if (this.state.detailInfo !== detailInfo) {
this.setState({ detailInfo: nextProps.detailInfo }, () => { this.setState({ detailInfo: nextProps.detailInfo }, () => {
this.renderEditor(); this.renderEditor();
}); });
...@@ -127,7 +133,6 @@ class QuestionEditor extends Component { ...@@ -127,7 +133,6 @@ class QuestionEditor extends Component {
}; };
editorRoot.customConfig.onchange = (html) => { editorRoot.customConfig.onchange = (html) => {
console.log("触发:+——+++++++", this.state.blanksList);
const { focusFlag } = this.state; const { focusFlag } = this.state;
const textLength = editorRoot.txt.text().replace(/\&nbsp\;/gi, " ") const textLength = editorRoot.txt.text().replace(/\&nbsp\;/gi, " ")
.length; .length;
...@@ -174,7 +179,7 @@ class QuestionEditor extends Component { ...@@ -174,7 +179,7 @@ class QuestionEditor extends Component {
editorRoot.create(); editorRoot.create();
this.editorRoot = editorRoot; this.editorRoot = editorRoot;
if (detailInfo.content) { // if (detailInfo && detailInfo.content) {
const contentHtml = /^\<p/.test(detailInfo.content) const contentHtml = /^\<p/.test(detailInfo.content)
? detailInfo.content ? detailInfo.content
: `<p>${detailInfo.content}</p>`; : `<p>${detailInfo.content}</p>`;
...@@ -194,7 +199,7 @@ class QuestionEditor extends Component { ...@@ -194,7 +199,7 @@ class QuestionEditor extends Component {
onChange && onChange(contentHtml, this.state.contentLength); onChange && onChange(contentHtml, this.state.contentLength);
} }
); );
} // }
bindChangeContent && bindChangeContent(this.handleChangeContent); bindChangeContent && bindChangeContent(this.handleChangeContent);
} }
...@@ -207,6 +212,9 @@ class QuestionEditor extends Component { ...@@ -207,6 +212,9 @@ class QuestionEditor extends Component {
var _blanksList = []; var _blanksList = [];
_blanksList = document.getElementsByClassName("add-fill-line"); _blanksList = document.getElementsByClassName("add-fill-line");
this.setState({ blanksList: _blanksList }); this.setState({ blanksList: _blanksList });
this.setState({
visiblePlacehold: false,
});
// this.props.changeBlankCount(_blanksList); // this.props.changeBlankCount(_blanksList);
}; };
...@@ -288,8 +296,7 @@ class QuestionEditor extends Component { ...@@ -288,8 +296,7 @@ class QuestionEditor extends Component {
</div> </div>
)} )}
<div <div
className={`editor-limit-tip${ className={`editor-limit-tip${contentLength > limitLength ? " mt6" : ""
contentLength > limitLength ? " mt6" : ""
}`} }`}
style={{ height: contentLength > limitLength ? 20 : 0 }} style={{ height: contentLength > limitLength ? 20 : 0 }}
> >
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: yuananting * @Author: yuananting
* @Date: 2021-02-25 11:23:47 * @Date: 2021-02-25 11:23:47
* @LastEditors: yuananting * @LastEditors: yuananting
* @LastEditTime: 2021-03-17 12:43:53 * @LastEditTime: 2021-03-18 09:35:03
* @Description: 助学工具-题库-题目管理主页面列表数据 * @Description: 助学工具-题库-题目管理主页面列表数据
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -84,7 +84,7 @@ class QuestionManageContent extends Component { ...@@ -84,7 +84,7 @@ class QuestionManageContent extends Component {
}; };
} }
componentDidMount() {} componentDidMount() { }
shouldComponentUpdate(nextProps, nextState) { shouldComponentUpdate(nextProps, nextState) {
const { selectedCategoryId } = nextProps; const { selectedCategoryId } = nextProps;
...@@ -211,6 +211,8 @@ class QuestionManageContent extends Component { ...@@ -211,6 +211,8 @@ class QuestionManageContent extends Component {
// 表头设置 // 表头设置
parseColumns = () => { parseColumns = () => {
const isPermiss = ["CloudManager", "StoreManager"].includes(User.getUserRole());
console.log(isPermiss, User.getUserRole())
const columns = [ const columns = [
{ {
title: "题目", title: "题目",
...@@ -273,22 +275,22 @@ class QuestionManageContent extends Component { ...@@ -273,22 +275,22 @@ class QuestionManageContent extends Component {
> >
预览 预览
</div> </div>
<span className="record-operate__item split"> | </span> {isPermiss && <span className="record-operate__item split"> | </span>}
<div {isPermiss && <div
className="record-operate__item" className="record-operate__item"
onClick={() => onClick={() =>
this.toEditQuetion(record.id, record.questionTypeEnum) this.toEditQuetion(record.id, record.questionTypeEnum)
} }
> >
编辑 编辑
</div> </div>}
<span className="record-operate__item split"> | </span> {isPermiss && <span className="record-operate__item split"> | </span>}
<div {isPermiss && <div
className="record-operate__item" className="record-operate__item"
onClick={() => this.delCategoryConfirm(record)} onClick={() => this.delCategoryConfirm(record)}
> >
删除 删除
</div> </div>}
</div> </div>
); );
}, },
...@@ -311,9 +313,7 @@ class QuestionManageContent extends Component { ...@@ -311,9 +313,7 @@ class QuestionManageContent extends Component {
<span <span
className="empty-list-tip" className="empty-list-tip"
onClick={() => { onClick={() => {
window.RCHistory.push({ this.handleCreateQuestionBank()
pathname: "/create-question-bank",
});
}} }}
> >
新建一个 新建一个
...@@ -356,7 +356,7 @@ class QuestionManageContent extends Component { ...@@ -356,7 +356,7 @@ class QuestionManageContent extends Component {
const ImportQuestionModal = ( const ImportQuestionModal = (
<BatchImportQuestionModal <BatchImportQuestionModal
close={() => { close={() => {
this.setState({ ImportQuestionModal: null }); this.setState({ ImportQuestionModal: null }, () => { this.queryQuestionPageList(); this.props.updatedSiderTree(this.props.selectedCategoryId) });
}} }}
categoryId={categoryId} categoryId={categoryId}
/> />
...@@ -430,7 +430,7 @@ class QuestionManageContent extends Component { ...@@ -430,7 +430,7 @@ class QuestionManageContent extends Component {
</div> </div>
</Row> </Row>
</div> </div>
{!["0", null].includes(categoryId) && ( {(["CloudManager", "StoreManager"].includes(User.getUserRole()) && !["0", null].includes(categoryId)) && (
<Space size="large"> <Space size="large">
<Button type="primary" onClick={this.handleCreateQuestionBank}> <Button type="primary" onClick={this.handleCreateQuestionBank}>
新建题目 新建题目
......
/* /*
* @Author: chenjianyu * @Author: chenjianyu
* @Date: 2020-09-12 17:00:44 * @Date: 2020-09-12 17:00:44
* @LastEditTime: 2021-03-15 13:00:10 * @LastEditTime: 2021-03-18 09:33:26
* @LastEditors: yuananting * @LastEditors: yuananting
* @Description: 答题模式模板 * @Description: 答题模式模板
* @Copyright © 2020 杭州杰竞科技有限公司 版权所有 * @Copyright © 2020 杭州杰竞科技有限公司 版权所有
...@@ -54,7 +54,7 @@ export function defineQuestionInfo(questionType) { ...@@ -54,7 +54,7 @@ export function defineQuestionInfo(questionType) {
type: "RICH_TEXT", // 内容项形式(0:富文本 1:文字 2:图片 3:语音 4:视频 5文件 6.课件) type: "RICH_TEXT", // 内容项形式(0:富文本 1:文字 2:图片 3:语音 4:视频 5文件 6.课件)
} }
], // 题干 ], // 题干
optionList: [], // 非填空题选项 optionList: questionType === "JUDGE" ? [] : [], // 非填空题选项
gapFillingAnswerList: [ gapFillingAnswerList: [
{ {
correctAnswerList: [] correctAnswerList: []
...@@ -84,6 +84,19 @@ export function defineOptionInfo() { ...@@ -84,6 +84,19 @@ export function defineOptionInfo() {
} }
} }
export function defineJudgeOptionInfo(content) {
return {
isCorrectAnswer: 0, // 是否为正确答案选项
questionOptionContentList: [ // 选项内容
{
contentType: "QUESTION_OPTION", // 内容类型(默认选项)
content, // 内容
type: "RICH_TEXT",
}
]
}
}
export function defineOptionData(content = '') { export function defineOptionData(content = '') {
return { return {
itemContentVOList: [{ itemContentVOList: [{
......
...@@ -101,6 +101,7 @@ class BatchImportQuestionModal extends Component { ...@@ -101,6 +101,7 @@ class BatchImportQuestionModal extends Component {
return ( return (
<div> <div>
<Modal <Modal
closable={status !== "uploading"}
className="import-score-modal" className="import-score-modal"
title="导入题目信息" title="导入题目信息"
visible={true} visible={true}
...@@ -218,7 +219,11 @@ class BatchImportQuestionModal extends Component { ...@@ -218,7 +219,11 @@ class BatchImportQuestionModal extends Component {
<Button <Button
type="primary" type="primary"
className="down-btn" className="down-btn"
// onClick={} onClick={() => {
this.setState({ status: "init" })
this.setState({ uploadFile: null })
this.setState({ showSelectFileModal: true })
}}
> >
重新上传文件 重新上传文件
</Button> </Button>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: yuananting * @Author: yuananting
* @Date: 2021-02-22 17:51:28 * @Date: 2021-02-22 17:51:28
* @LastEditors: yuananting * @LastEditors: yuananting
* @LastEditTime: 2021-03-15 09:56:59 * @LastEditTime: 2021-03-18 09:32:59
* @Description: 助学工具-题库-题库新建或编辑题库分类模态框 * @Description: 助学工具-题库-题库新建或编辑题库分类模态框
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment