Commit d9b3a274 by yuananting

fix:bug

parent 93fd7ffe
......@@ -243,7 +243,7 @@ function AddExam(props: any) {
help={check && !examName && '请选择课程'}
required>
<Input placeholder='请输入试卷名称(40字以内)' maxLength={40} value={examName} onChange={(e) => {
<Input placeholder='请输入考试名称(40字以内)' maxLength={40} value={examName} onChange={(e) => {
setExamName(e.target.value)
}} style={{ width: 320 }} />
</Form.Item>
......
......@@ -336,7 +336,7 @@ class OperateQuestion extends Component {
key="SINGLE_CHOICE"
>
<OperateQuestionTab
questionTypeKey={activeKey}
questionTypeKey={"SINGLE_CHOICE"}
onRef={(ref) => {
this.singleChoiceRef = ref;
}}
......@@ -365,7 +365,7 @@ class OperateQuestion extends Component {
key="MULTI_CHOICE"
>
<OperateQuestionTab
questionTypeKey={activeKey}
questionTypeKey={"MULTI_CHOICE"}
onRef={(ref) => {
this.multiChoiceRef = ref;
}}
......@@ -393,7 +393,7 @@ class OperateQuestion extends Component {
key="JUDGE"
>
<OperateQuestionTab
questionTypeKey={activeKey}
questionTypeKey={"JUDGE"}
onRef={(ref) => {
this.judgeRef = ref;
}}
......@@ -421,7 +421,7 @@ class OperateQuestion extends Component {
key="GAP_FILLING"
>
<OperateQuestionTab
questionTypeKey={activeKey}
questionTypeKey={"GAP_FILLING"}
onRef={(ref) => {
this.gapRef = ref;
}}
......@@ -459,7 +459,7 @@ class OperateQuestion extends Component {
key="INDEFINITE_CHOICE"
>
<OperateQuestionTab
questionTypeKey={activeKey}
questionTypeKey={"INDEFINITE_CHOICE"}
onRef={(ref) => {
this.indefiniteRef = ref;
}}
......
......@@ -634,6 +634,9 @@ class OperateQuestionTab extends Component {
this.state.stemContent,
(contentItem) => contentItem.type === "RICH_TEXT"
);
if(stemContent.textLength > 1000) {
validateError++;
}
let stem = stemContent.content.replace(/<[^>]+>/g, "");
stem = stem.replace(/\&nbsp\;/gi, "");
stem = stem.replace(/\s+/g, "");
......@@ -691,7 +694,9 @@ class OperateQuestionTab extends Component {
optionUnChecked = item.isCorrectAnswer
? optionUnChecked
: optionUnChecked + 1;
if(optionContent[0].textLength > 1000) {
validateError++;
}
let optionInput = optionContent[0].content.replace(/<[^>]+>/g, "");
optionInput = optionInput.replace(/\&nbsp\;/gi, "");
optionInput = optionInput.replace(/\s+/g, "");
......
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