Skip to content

Commit 3b9bce9

Browse files
committed
修正:当考试时,采用的试卷没有试题导致的异常
1 parent b2ed725 commit 3b9bce9

File tree

2 files changed

+38
-8
lines changed
  • Sourcecode/Song.WebSite/Templates

2 files changed

+38
-8
lines changed

Sourcecode/Song.WebSite/Templates/Teacher/Default/Styles/Public.css

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,27 @@ table.el-table__body .disabled img {
104104
display: flex;
105105
justify-content:flex-end;
106106
}
107+
.el-button--close::before {
108+
content: '\e72c';
109+
font-size: 15px;
110+
font-family: "webdesk_icon" !important;
111+
margin-right: 5px;
112+
}
113+
.el-button--cancel::before {
114+
content: '\e748';
115+
font-size: 15px;
116+
font-family: "webdesk_icon" !important;
117+
margin-right: 5px;
118+
}
119+
.el-button[define="enter"]:not(.is-loading)::before {
120+
content: '\a048';
121+
font-size: 15px;
122+
font-family: "webdesk_icon" !important;
123+
margin-right: 5px;
124+
}
125+
.el-button icon {
126+
font-size: 14px;
127+
}
107128
/*专业下拉选择菜单中,点击标签响应选择*/
108129
.el-cascader-panel .el-radio {
109130
width: 100%;

Sourcecode/Song.WebSite/Templates/Web/Default/Exam/Scripts/Doing.js

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,9 @@ $ready(function () {
9090
if (!th.islogin || !th.examstate.exist) return;
9191
//获取考试主题和专业、试卷
9292
$api.bat(
93-
$api.cache('Exam/ForID', { 'id': th.examid }),
94-
$api.cache('Exam/ThemeForUID', { 'uid': th.examstate.uid }),
95-
$api.cache('Subject/ForID', { 'id': th.examstate.subject }),
93+
$api.get('Exam/ForID', { 'id': th.examid }),
94+
$api.get('Exam/ThemeForUID', { 'uid': th.examstate.uid }),
95+
$api.get('Subject/ForID', { 'id': th.examstate.subject }),
9696
$api.get('TestPaper/ForID', { 'id': th.examstate.paper })
9797
).then(axios.spread(function (exam, theme, sbj, paper) {
9898
th.loading.exam = false;
@@ -192,7 +192,7 @@ $ready(function () {
192192
this.time.wait = this.starttime.getTime() - this.nowtime.getTime();
193193
this.time.wait = this.time.wait <= 0 ? 0 : Math.floor(this.time.wait / 1000);
194194
if (!this.examstate.isover) {
195-
if (this.time.wait < this.time.requestlimit * 60 && JSON.stringify(this.exam) != '{}') {
195+
if (this.time.wait < this.time.requestlimit * 60 && JSON.stringify(this.exam) != '{}') {
196196
this.generatePaper();
197197
}
198198
if (this.time.wait == 0 && !this.examstate.issubmit) {
@@ -240,6 +240,18 @@ $ready(function () {
240240
if (this.loading.paper) return;
241241
var th = this;
242242
th.loading.paper = true;
243+
//th.paper.Tp_Count = 0;
244+
if (th.paper.Tp_Count < 1) {
245+
this.$alert("试卷题量为零,无法出卷", '错误', {
246+
confirmButtonText: '确定',
247+
showClose:false,
248+
callback: action => {
249+
window.location.href = '/web/exam';
250+
}
251+
});
252+
th.loading.paper = false;
253+
return;
254+
}
243255
$api.put('Exam/MakeoutPaper', { 'examid': th.exam.Exam_ID, 'tpid': th.paper.Tp_Id, 'stid': th.account.Ac_ID })
244256
.then(function (req) {
245257
if (req.data.success) {
@@ -306,9 +318,6 @@ $ready(function () {
306318
"examid": this.exam.Exam_ID,
307319
"exrid": this.examstate.exrid
308320
});
309-
return
310-
//var url = "Review?examid=" + this.exam.Exam_ID + "&exrid=" + this.result.Exr_ID;
311-
window.location.href = url;
312321
},
313322
calcTime: function () {
314323
//固定时间开始
@@ -330,7 +339,7 @@ $ready(function () {
330339
//patter:提交方式,1为自动提交,2为交卷
331340
submit: function (patter) {
332341
var th = this;
333-
342+
if (th.paper.Tp_Count < 1) return;
334343
if (!th.islogin || !th.isexam) return;
335344
if (JSON.stringify(th.paperAnswer) == '{}') return;
336345
if (th.examstate.issubmit || th.submitState.loading) return;

0 commit comments

Comments
 (0)