Commit e5d9a183 authored by 黄奎's avatar 黄奎

页面修改

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