Commit 31e8dd5f authored by zhengke's avatar zhengke

修改

parent a4519573
......@@ -73,7 +73,7 @@
color: #6BA9FF;
}
.InpDIV{
width: 765px;
/* width: 765px; */
min-height: 38px;
border-radius: 4px;
border: 1px solid #E1EAF4;
......
......@@ -184,12 +184,10 @@
//关闭弹窗
closeSaveForm() {
this.$emit('close')
this.persistent = false;
},
//确认问题
sureQuestion() {
this.$emit('success', this.selectedQuestion)
this.persistent = false;
},
},
}
......
......@@ -639,7 +639,6 @@
},
//添加问题
AddQuestion(qArray) {
console.log("qArray", qArray)
if (this.DataObj) {
if (!this.DataObj.GroupList) {
this.DataObj.GroupList = [];
......@@ -760,7 +759,9 @@
if (x.DetailsList && x.DetailsList.length > 0) {
this.examNum += x.DetailsList.length;
x.DetailsList.forEach(y => {
this.examScore += parseInt(y.Score);
if(y.Score){
this.examScore += parseInt(y.Score);
}
})
}
})
......@@ -772,32 +773,106 @@
this.ComCheckIndex = index2;
this.ChooseItem = questionItem;
        this.$refs.UE_Title.reloadNewValue();
console.log(this.ChooseItem,'choose')
this.$forceUpdate();
},
//保存题目
SavePaper() {
savePaperInfo(this.DataObj).then(res => {
if (res.Code == 1) {
this.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: '操作成功!',
position: 'top'
})
this.$router.push({
path: '/exam/examManagement',
query: {}
});
} else {
this.$q.notify({
type: 'negative',
position: "top",
message: `操作失败!`
})
console.log(this.DataObj,'dataobj');
console.log(this.validateType());
return
if(this.validateType()){
savePaperInfo(this.DataObj).then(res => {
if (res.Code == 1) {
this.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: '操作成功!',
position: 'top'
})
this.$router.push({
path: '/exam/examManagement',
query: {}
});
} else {
this.$q.notify({
type: 'negative',
position: "top",
message: `操作失败!`
})
}
})
}
},
//验证
validateType() {
var result = true;
for(let k=0;k<this.DataObj.GroupList.length;k++){
//连线题
if (this.DataObj.GroupList[k].QuestionTypeKey == 'matching') {
for(let j=0;j<this.DataObj.GroupList[k].DetailsList.length;j++){
if(this.DataObj.GroupList[k].DetailsList[j].QuestionContentObj.length>0){
for(let p=0;p<this.DataObj.GroupList[k].DetailsList[j].QuestionContentObj[0].length;p++){
if (this.DataObj.GroupList[k].DetailsList[j].QuestionContentObj[0][p].Content == '') {
this.$q.notify({
type: 'negative',
position: "top",
message: `第一组第${p+1}行数据内容为空!`
})
result = false;
return;
}
}
}
}
}
})
}
return result;
},
//js 判断重复
isRepeat(Arr, type) {
var result = true;
var msg = '';
switch (type) {
case 1:
msg = '第1组数据选项不能相同'
break;
case 2:
msg = '第2组数据选项不能相同'
break;
case 3:
msg = '选项内容不能相同'
break;
case 4:
msg = '题干内容不能相同!';
break;
default:
}
let num = 0;
for (var i = 0; i < Arr.length - 1; i++) {
for (var j = i + 1; j < Arr.length; j++) {
if (Arr[i].Content === Arr[j].Content) {
this.$q.notify({
type: 'negative',
position: "top",
message: msg
})
num++;
}
}
}
if (num > 0) {
result = false;
} else {
result = true;
}
return result;
},
closeQuestForm() {
this.isShowQuestion = false;
},
......@@ -809,6 +884,7 @@
var qObj = this.getDetailsObj();
qObj.QuestionId = eItem.QuestionId;
qObj.Title = eItem.SourceTitle;
qObj.ShowTitle = eItem.SourceTitle;
qObj.QuestionContent = eItem.QuestionContent;
qObj.DifficultyType = eItem.DifficultyType;
qObj.AnswerParse = eItem.AnswerParse;
......@@ -834,6 +910,7 @@
});
}
this.AddQuestion(tempArray);
this.isShowQuestion = false;
},
//删除分组及问题
removeFather(item, index) {
......
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