Commit 2d2f1725 authored by zhengke's avatar zhengke

修改

parent 67893533
...@@ -139,8 +139,8 @@ ...@@ -139,8 +139,8 @@
</div> </div>
<br /> <br />
<!--单选题--> <!--单选题-->
<single v-if="questionObj.Key=='single'||questionObj.Key=='single-number'" :questionData="AnswerList" @getChild="getChildData" <single v-if="questionObj.Key=='single'||questionObj.Key=='single-number'" :questionData="AnswerList"
:setOption="objOption"></single> @getChild="getChildData" :setOption="objOption"></single>
<!--多选题--> <!--多选题-->
<multiple v-if="questionObj.Key=='multiple'" :questionData="AnswerList" @getChild="getChildData" <multiple v-if="questionObj.Key=='multiple'" :questionData="AnswerList" @getChild="getChildData"
:setOption="objOption"></multiple> :setOption="objOption"></multiple>
...@@ -405,7 +405,7 @@ ...@@ -405,7 +405,7 @@
this.questionObj.QId = res.Data.QuestionTypeId; this.questionObj.QId = res.Data.QuestionTypeId;
if (res.Data.QuestionContentObj) { if (res.Data.QuestionContentObj) {
this.AnswerList = res.Data.QuestionContentObj; this.AnswerList = res.Data.QuestionContentObj;
this.objOption.QuestionContent = JSON.stringify(res.Data.QuestionContent); this.objOption.QuestionContent = JSON.stringify(res.Data.QuestionContentObj);
} else { } else {
this.onItemClick(this.questionObj); this.onItemClick(this.questionObj);
} }
...@@ -649,10 +649,101 @@ ...@@ -649,10 +649,101 @@
result = false; result = false;
return; return;
} }
if(this.objOption.QuestionContent){ if (this.objOption.QuestionContent) {
var myArr = JSON.parse(this.objOption.QuestionContent); var myArr = JSON.parse(this.objOption.QuestionContent);
// console.log(myArr,'myArr'); console.log(myArr, 'myArr');
// return; for (var i = 0; i < myArr[0].length; i++) {
if (myArr[0].Content == '') {
this.$q.notify({
type: 'negative',
position: "top",
message: `请输入试题选项`
})
result = false;
return;
}
if (this.isRepeat(myArr[0], 3)) {
result = this.isRepeat(myArr[0], 3);
} else {
return;
}
}
}
}
//资料提 分录题 多选题
if (this.objOption.QuestionTypeKey == 'data-question' || this.objOption.QuestionTypeKey == 'entry-problem'||this.objOption.QuestionTypeKey == 'multiple'
||this.objOption.QuestionTypeKey == 'single') {
if (this.objOption.Title == '') {
this.$q.notify({
type: 'negative',
position: "top",
message: `请输入题干!`
})
result = false;
return;
}
if (this.objOption.QuestionContent) {
var myArr = JSON.parse(this.objOption.QuestionContent);
console.log(myArr, 'myArrrrrr');
for (var i = 0; i < myArr.length; i++) {
console.log(myArr[i].Content);
if (myArr[i].Content == '') {
this.$q.notify({
type: 'negative',
position: "top",
message: `请输入第${i+1}的选项!`
})
result = false;
return;
}
if (this.isRepeat(myArr, 3)) {
result = this.isRepeat(myArr, 3);
} else {
return;
}
}
}
}
//计算题
if (this.objOption.QuestionTypeKey == 'calculation'||this.objOption.QuestionTypeKey == 'essay-question'||this.objOption.QuestionTypeKey=='noun-explanation') {
if (this.objOption.Title == '') {
this.$q.notify({
type: 'negative',
position: "top",
message: `请输入题干!`
})
result = false;
return;
}
if (this.objOption.Answer == '') {
this.$q.notify({
type: 'negative',
position: "top",
message: `请输入回答!`
})
result = false;
return;
}
}
//判断题
if(this.objOption.QuestionTypeKey == 'judge'){
if (this.objOption.Title == '') {
this.$q.notify({
type: 'negative',
position: "top",
message: `请输入题干!`
})
result = false;
return;
}
if (this.objOption.AnswerParse == '') {
this.$q.notify({
type: 'negative',
position: "top",
message: `请输入答案解析!`
})
result = false;
return;
} }
} }
return result; return result;
......
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