Commit e5d9a183 authored by 黄奎's avatar 黄奎

页面修改

parent d6781064
......@@ -581,30 +581,58 @@
},
//删除题目
delExam(gitem, item, index) {
if (item.Id == 0) {
gitem.splice(index, 1);
} else {
this.$q.dialog({
title: '提示信息',
message: '是否确定删除',
cancel: true,
persistent: true,
ok: "确定",
cancel: "取消",
}).onOk(() => {
var that = this;
this.$q.dialog({
title: '提示信息',
message: '是否确定删除',
cancel: true,
persistent: true,
ok: "确定",
cancel: "取消",
}).onOk(() => {
if (item.Id == 0) {
gitem.splice(index, 1);
that.calcPaper();
} else {
let msg = {
Id: item.Id,
}
DeletePaperDetails(msg).then(res => {
if (res.Code == 1) {
this.GetPaperInfo();
gitem.splice(index, 1);
that.calcPaper();
}
})
}).onCancel(() => {
});
}
this.calcPaper();
}
})
},
//删除分组及问题
removeFather(item, index) {
var that = this;
this.$q.dialog({
title: '提示信息',
message: '是否删除此分组?',
cancel: true,
persistent: true,
ok: "确定",
cancel: "取消",
}).onOk(() => {
if (item.GId == 0) {
that.DataObj.GroupList.splice(index, 1);
that.calcPaper();
} else {
let msg = {
GId: item.GId,
QuestionTypeId: item.QuestionTypeId
}
DeletePaperGroup(msg).then(res => {
if (res.Code == 1) {
that.DataObj.GroupList.splice(index, 1);
that.calcPaper();
}
})
}
})
},
//点击修改标题名字和分数
getNameEdit(item, index) {
......@@ -775,17 +803,17 @@
this.examNum = 0;
if (this.DataObj && this.DataObj.GroupList) {
this.DataObj.GroupList.forEach(x => {
var tempGScore=0;
var tempGScore = 0;
if (x.DetailsList && x.DetailsList.length > 0) {
this.examNum += x.DetailsList.length;
x.DetailsList.forEach(y => {
if (y.Score) {
tempGScore+=Number(y.Score)
tempGScore += Number(y.Score)
this.examScore += Number(y.Score);
}
})
}
x.GScore=tempGScore;
x.GScore = tempGScore;
})
}
},
......@@ -822,10 +850,11 @@
message: '操作成功!',
position: 'top'
})
this.$router.push({
path: '/exam/examPaper',
query: {}
});
// this.$router.push({
// path: '/exam/examPaper',
// query: {}
// });
this.GetPaperInfo();
} else {
this.$q.notify({
type: 'negative',
......@@ -868,8 +897,9 @@
}
}
//单选题 多选题
if (this.DataObj.GroupList[k].QuestionTypeKey == 'single' || this.DataObj.GroupList[k].QuestionTypeKey ==
'multiple') {
if (this.DataObj.GroupList[k].QuestionTypeKey == 'single' ||
this.DataObj.GroupList[k].QuestionTypeKey == 'multiple'
) {
for (let i = 0; i < this.DataObj.GroupList[k].DetailsList.length; i++) {
var Num = 0;
if (this.DataObj.GroupList[k].DetailsList[i].Title == '') {
......@@ -932,10 +962,11 @@
}
}
//判断题
if (this.DataObj.GroupList[k].QuestionTypeKey == 'judge' || this.DataObj.GroupList[k].QuestionTypeKey ==
'reading-comprehensio' ||
this.DataObj.GroupList[k].QuestionTypeKey == 'spoken' || this.DataObj.GroupList[k].QuestionTypeKey ==
'other' || this.DataObj.GroupList[k].QuestionTypeKey == 'noun-explanation') {
if (this.DataObj.GroupList[k].QuestionTypeKey == 'judge' ||
this.DataObj.GroupList[k].QuestionTypeKey == 'reading-comprehensio' ||
this.DataObj.GroupList[k].QuestionTypeKey == 'spoken' ||
this.DataObj.GroupList[k].QuestionTypeKey == 'other' ||
this.DataObj.GroupList[k].QuestionTypeKey == 'noun-explanation') {
for (let i = 0; i < this.DataObj.GroupList[k].DetailsList.length; i++) {
if (this.DataObj.GroupList[k].DetailsList[i].Title == '') {
this.$q.notify({
......@@ -949,10 +980,12 @@
}
}
//简答题 论述题
if (this.DataObj.GroupList[k].QuestionTypeKey == 'short-answer' || this.DataObj.GroupList[k]
.QuestionTypeKey == 'essay-question' ||
this.DataObj.GroupList[k].QuestionTypeKey == 'calculation' || this.DataObj.GroupList[k].QuestionTypeKey ==
'entry-problem') {
if (this.DataObj.GroupList[k].QuestionTypeKey == 'short-answer' ||
this.DataObj.GroupList[k].QuestionTypeKey == 'essay-question' ||
this.DataObj.GroupList[k].QuestionTypeKey == 'calculation' ||
this.DataObj.GroupList[k].QuestionTypeKey == 'entry-problem' ||
this.DataObj.GroupList[k].QuestionTypeKey == 'data-question'
) {
for (let i = 0; i < this.DataObj.GroupList[k].DetailsList.length; i++) {
if (this.DataObj.GroupList[k].DetailsList[i].Title == '') {
this.$q.notify({
......@@ -974,7 +1007,6 @@
}
}
}
}
return result;
},
......@@ -1016,34 +1048,7 @@
this.AddQuestion(tempArray);
this.isShowQuestion = false;
},
//删除分组及问题
removeFather(item, index) {
if (item.GId == 0) {
this.DataObj.GroupList.splice(index, 1);
} else {
this.$q.dialog({
title: '提示信息',
message: '是否确定删除',
cancel: true,
persistent: true,
ok: "确定",
cancel: "取消",
}).onOk(() => {
let msg = {
GId: item.GId,
QuestionTypeId: item.QuestionTypeId
}
DeletePaperGroup(msg).then(res => {
if (res.Code == 1) {
this.GetPaperInfo();
}
})
}).onCancel(() => {
});
}
this.calcPaper();
}
}
}
......
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