Commit d9b3a274 by yuananting

fix:bug

parent 93fd7ffe
...@@ -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>
......
...@@ -336,7 +336,7 @@ class OperateQuestion extends Component { ...@@ -336,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;
}} }}
...@@ -365,7 +365,7 @@ class OperateQuestion extends Component { ...@@ -365,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;
}} }}
...@@ -393,7 +393,7 @@ class OperateQuestion extends Component { ...@@ -393,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;
}} }}
...@@ -421,7 +421,7 @@ class OperateQuestion extends Component { ...@@ -421,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;
}} }}
...@@ -459,7 +459,7 @@ class OperateQuestion extends Component { ...@@ -459,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, "");
......
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