Commit 7b526754 by yuananting

fix:解决冲突

parents 36c04299 3fe84f59
...@@ -54,7 +54,7 @@ function AddExam(props: any) { ...@@ -54,7 +54,7 @@ function AddExam(props: any) {
}, [paperInfo.paperId]) }, [paperInfo.paperId])
useEffect(() => { useEffect(() => {
setPassScore(parseInt((paperInfo.totalScore || 0) * (passRate || 0) as any / 100 + '')) setPassScore(Math.round((paperInfo.totalScore || 0) * (passRate || 0) as any / 100))
setExamTotal(paperInfo.singleChoiceCnt + paperInfo.multiChoiceCnt + paperInfo.judgeCnt + paperInfo.gapFillingCnt + paperInfo.indefiniteChoiceCnt || 0) setExamTotal(paperInfo.singleChoiceCnt + paperInfo.multiChoiceCnt + paperInfo.judgeCnt + paperInfo.gapFillingCnt + paperInfo.indefiniteChoiceCnt || 0)
}, [paperInfo.paperId, passRate]) }, [paperInfo.paperId, passRate])
...@@ -243,7 +243,7 @@ function AddExam(props: any) { ...@@ -243,7 +243,7 @@ function AddExam(props: any) {
help={check && !examName && '请选择课程'} help={check && !examName && '请选择课程'}
required> required>
<Input placeholder='请输入试卷名称(40字以内)' maxLength={40} value={examName} onChange={(e) => { <Input placeholder='请输入考试名称(40字以内)' maxLength={40} value={examName} onChange={(e) => {
setExamName(e.target.value) setExamName(e.target.value)
}} style={{ width: 320 }} /> }} style={{ width: 320 }} />
</Form.Item> </Form.Item>
......
...@@ -16,6 +16,7 @@ function SelectPaperModal(props: any) { ...@@ -16,6 +16,7 @@ function SelectPaperModal(props: any) {
}, [item]) }, [item])
return <Modal return <Modal
maskClosable={false}
width={900} width={900}
title="选择试卷" title="选择试卷"
visible={true} visible={true}
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: yuananting * @Author: yuananting
* @Date: 2021-03-29 10:52:26 * @Date: 2021-03-29 10:52:26
* @LastEditors: yuananting * @LastEditors: yuananting
* @LastEditTime: 2021-04-07 15:23:06 * @LastEditTime: 2021-05-08 16:11:27
* @Description: 助学工具-试卷-新建选择题目弹窗 * @Description: 助学工具-试卷-新建选择题目弹窗
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -35,6 +35,7 @@ class SelectQuestionModal extends Component { ...@@ -35,6 +35,7 @@ class SelectQuestionModal extends Component {
return ( return (
<Modal <Modal
className="select-question-modal" className="select-question-modal"
maskClosable={false}
destroyOnClose={true} destroyOnClose={true}
title="选择题目" title="选择题目"
visible={true} visible={true}
......
/* /*
* @Author: yuananting * @Author: yuananting
* @Date: 2021-02-25 13:46:35 * @Date: 2021-02-25 13:46:35
* @LastEditors: zhangleyuan * @LastEditors: yuananting
* @LastEditTime: 2021-05-10 10:16:53 * @LastEditTime: 2021-05-10 20:33:16
* @Description: 助学工具-题库-新建/编辑题目 * @Description: 助学工具-题库-新建/编辑题目
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -164,6 +164,8 @@ class OperateQuestion extends Component { ...@@ -164,6 +164,8 @@ class OperateQuestion extends Component {
window.RCHistory.push({ window.RCHistory.push({
pathname: `/question-manage-index?categoryId=${getParameterByName("categoryId")}`, pathname: `/question-manage-index?categoryId=${getParameterByName("categoryId")}`,
}); });
Bus.trigger("queryCategoryTree", "remain");
Bus.trigger("queryQuestionPageList", getParameterByName("categoryId"));
}, },
}); });
}; };
...@@ -334,7 +336,7 @@ class OperateQuestion extends Component { ...@@ -334,7 +336,7 @@ class OperateQuestion extends Component {
key="SINGLE_CHOICE" key="SINGLE_CHOICE"
> >
<OperateQuestionTab <OperateQuestionTab
questionTypeKey={activeKey} questionTypeKey={"SINGLE_CHOICE"}
onRef={(ref) => { onRef={(ref) => {
this.singleChoiceRef = ref; this.singleChoiceRef = ref;
}} }}
...@@ -363,7 +365,7 @@ class OperateQuestion extends Component { ...@@ -363,7 +365,7 @@ class OperateQuestion extends Component {
key="MULTI_CHOICE" key="MULTI_CHOICE"
> >
<OperateQuestionTab <OperateQuestionTab
questionTypeKey={activeKey} questionTypeKey={"MULTI_CHOICE"}
onRef={(ref) => { onRef={(ref) => {
this.multiChoiceRef = ref; this.multiChoiceRef = ref;
}} }}
...@@ -391,7 +393,7 @@ class OperateQuestion extends Component { ...@@ -391,7 +393,7 @@ class OperateQuestion extends Component {
key="JUDGE" key="JUDGE"
> >
<OperateQuestionTab <OperateQuestionTab
questionTypeKey={activeKey} questionTypeKey={"JUDGE"}
onRef={(ref) => { onRef={(ref) => {
this.judgeRef = ref; this.judgeRef = ref;
}} }}
...@@ -419,7 +421,7 @@ class OperateQuestion extends Component { ...@@ -419,7 +421,7 @@ class OperateQuestion extends Component {
key="GAP_FILLING" key="GAP_FILLING"
> >
<OperateQuestionTab <OperateQuestionTab
questionTypeKey={activeKey} questionTypeKey={"GAP_FILLING"}
onRef={(ref) => { onRef={(ref) => {
this.gapRef = ref; this.gapRef = ref;
}} }}
...@@ -457,7 +459,7 @@ class OperateQuestion extends Component { ...@@ -457,7 +459,7 @@ class OperateQuestion extends Component {
key="INDEFINITE_CHOICE" key="INDEFINITE_CHOICE"
> >
<OperateQuestionTab <OperateQuestionTab
questionTypeKey={activeKey} questionTypeKey={"INDEFINITE_CHOICE"}
onRef={(ref) => { onRef={(ref) => {
this.indefiniteRef = ref; this.indefiniteRef = ref;
}} }}
......
...@@ -634,6 +634,9 @@ class OperateQuestionTab extends Component { ...@@ -634,6 +634,9 @@ class OperateQuestionTab extends Component {
this.state.stemContent, this.state.stemContent,
(contentItem) => contentItem.type === "RICH_TEXT" (contentItem) => contentItem.type === "RICH_TEXT"
); );
if(stemContent.textLength > 1000) {
validateError++;
}
let stem = stemContent.content.replace(/<[^>]+>/g, ""); let stem = stemContent.content.replace(/<[^>]+>/g, "");
stem = stem.replace(/\&nbsp\;/gi, ""); stem = stem.replace(/\&nbsp\;/gi, "");
stem = stem.replace(/\s+/g, ""); stem = stem.replace(/\s+/g, "");
...@@ -691,7 +694,9 @@ class OperateQuestionTab extends Component { ...@@ -691,7 +694,9 @@ class OperateQuestionTab extends Component {
optionUnChecked = item.isCorrectAnswer optionUnChecked = item.isCorrectAnswer
? optionUnChecked ? optionUnChecked
: optionUnChecked + 1; : optionUnChecked + 1;
if(optionContent[0].textLength > 1000) {
validateError++;
}
let optionInput = optionContent[0].content.replace(/<[^>]+>/g, ""); let optionInput = optionContent[0].content.replace(/<[^>]+>/g, "");
optionInput = optionInput.replace(/\&nbsp\;/gi, ""); optionInput = optionInput.replace(/\&nbsp\;/gi, "");
optionInput = optionInput.replace(/\s+/g, ""); optionInput = optionInput.replace(/\s+/g, "");
......
...@@ -126,18 +126,24 @@ class QuestionEditor extends Component { ...@@ -126,18 +126,24 @@ class QuestionEditor extends Component {
// 自定义处理粘贴的文本内容 // 自定义处理粘贴的文本内容
editorRoot.config.pasteTextHandle = function (content) { editorRoot.config.pasteTextHandle = function (content) {
if (content == "" && !content) return ""; if (content == "" && !content) return "";
var str = content; var str1 = content; // 所有特殊字符
str = str.replace(/<xml>[\s\S]*?<\/xml>/gi, ""); str1 = str1.replace(/<xml>[\s\S]*?<\/xml>/gi, "");
str = str.replace(/<style>[\s\S]*?<\/style>/gi, ""); str1 = str1.replace(/<style>[\s\S]*?<\/style>/gi, "");
str = str.replace(/<\/?[^>]*>/g, ""); str1 = str1.replace(/<\/?[^>]*>/g, "");
str = str.replace(/[ | ]*\n/g, "\n"); str1 = str1.replace(/[ | ]*\n/g, "\n");
str = str.replace(/\&nbsp\;/gi, " "); str1 = str1.replace(/\&nbsp\;/gi, " ");
str = str.replace(/[\r\n]/g, ""); str1 = str1.replace(/[\r\n]/g, "");
if (str.length > 1000) { var str2 = content; // 保留空格和换行的其他字符
str = str.substring(0, 1000); str2 = str2.replace(/<xml>[\s\S]*?<\/xml>/gi, "");
str2 = str2.replace(/<style>[\s\S]*?<\/style>/gi, "");
str2 = str2.replace(/<(?!br).*?>/g, "");
if (editorRoot.txt.text().length + str1.length > 1000) {
content = str2.substring(0, 1000);
message.error("内容过长,不能超过1000字"); message.error("内容过长,不能超过1000字");
} else {
content = str2;
} }
return str; return content;
}; };
let prevList = []; let prevList = [];
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
.editor-box_content { .editor-box_content {
width: calc(100% - 80px); width: calc(100% - 80px);
p { p {
display: inline-block; display: inline;
} }
} }
.editor-limit { .editor-limit {
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
max-height: 110px; max-height: 110px;
overflow: auto; overflow: auto;
p { p {
display: inline-block; display: inline;
overflow-y: scroll; overflow-y: scroll;
} }
} }
......
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