dev_forum
hjm 6 years ago
parent 7b84e5a91c
commit 14a638c34e

@ -56,23 +56,23 @@ class SingleEditor extends Component{
const answerArray = standard_answers.map((item, index) => { return item == true ? index+1 : -1 }).filter(item => item != -1);
if(!question_title) {
this.refs['titleEditor'].showError()
this.props.showNotification('题目不能为空'); return;
this.props.showNotification('题目不能为空'); return;
}
const intScore = parseFloat(question_score)
if(!question_score || intScore == NaN) {
this.props.showNotification('分值不能为空'); return;
this.props.showNotification('分值不能为空'); return;
} else {
if (intScore == 0) {
this.props.showNotification('分值必须大于0'); return;
this.props.showNotification('分值必须大于0'); return;
}
}
if(!answerArray || answerArray.length == 0) {
this.props.showNotification('请先点击本题的正确选项'); return;
this.props.showNotification('必须设置标准答案'); return;
}
if(!question_title) {
this.refs['titleEditor'].showError()
this.props.showNotification('题目不能为空'); return;
this.props.showNotification('题目不能为空'); return;
}

@ -46,16 +46,16 @@ class MainEditor extends Component{
const answerArray = standard_answers
if(!question_title) {
this.refs['titleEditor'].showError()
this.props.showNotification('题目不能为空'); return;
this.props.showNotification('题目不能为空'); return;
}
const intScore = parseFloat(question_score)
if(!question_score || intScore == NaN) {
this.props.showNotification('分值不能为空'); return;
this.props.showNotification('分值不能为空'); return;
} else {
if (intScore == 0) {
this.props.showNotification('分值必须大于0'); return;
this.props.showNotification('分值必须大于0'); return;
}
}
// if(!answerArray || answerArray.length == 0 || !answerArray[0]) {

@ -70,15 +70,15 @@ class NullEditor extends Component{
let answerArray = []
if(!question_title) {
this.refs['titleEditor'].showError()
this.props.showNotification('题目不能为空'); return;
this.props.showNotification('题目不能为空'); return;
}
const intScore = parseFloat(question_score)
if(!question_score || intScore == NaN) {
this.props.showNotification('分值不能为空'); return;
this.props.showNotification('分值不能为空'); return;
} else {
if (intScore == 0) {
this.props.showNotification('分值必须大于0'); return;
this.props.showNotification('分值必须大于0'); return;
}
}
let isEmpty = false;
@ -91,7 +91,8 @@ class NullEditor extends Component{
answerArray[index].answer_text.push(item)
if(!item) {
this.refs[`nullChildEditor${index}`].showError(itemIndex)
this.props.showNotification(`请先输入第${index+1}个填空的第${itemIndex+1}参考答案。`);
// this.props.showNotification(`请先输入第${index+1}个填空的第${itemIndex+1}参考答案。`);
this.props.showNotification(`答案:不能为空`);
isEmpty = true;
}
})
@ -101,7 +102,7 @@ class NullEditor extends Component{
}
if(!question_title) {
this.refs['titleEditor'].showError()
this.props.showNotification('题目不能为空'); return;
this.props.showNotification('题目不能为空'); return;
}

@ -98,7 +98,7 @@ class ShixunEditor extends Component{
// }
for(let _i = 0; _i < question_scores.length; _i++) {
if (!question_scores[_i] || question_scores[_i] == '0') {
this.props.showNotification(`${_i+1}题的分值必须大于0`); return;
this.props.showNotification(`${_i+1}题的分值必须大于0`); return;
}
}

@ -88,7 +88,7 @@ class SingleEditor extends Component{
const answerArray = standard_answers.map((item, index) => { return item == true ? index+1 : -1 }).filter(item => item != -1);
if(!question_title) {
this.refs['titleEditor'].showError()
this.props.showNotification('题目不能为空'); return;
this.props.showNotification('题目不能为空'); return;
}
@ -105,7 +105,7 @@ class SingleEditor extends Component{
}
if(!question_title) {
this.refs['titleEditor'].showError()
this.props.showNotification('题目不能为空'); return;
this.props.showNotification('题目不能为空'); return;
}

Loading…
Cancel
Save