Skip to content

Commit a3b7074

Browse files
committed
修正细节
1 parent 3b9bce9 commit a3b7074

File tree

1 file changed

+10
-8
lines changed
  • Sourcecode/Song.WebSite/Templates/Web/Default/Exam/Scripts

1 file changed

+10
-8
lines changed

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

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,9 @@ $ready(function () {
6363
$api.bat(
6464
$api.cache('Question/Types:9999'),
6565
$api.get('Exam/State', { 'examid': th.examid }),
66+
$api.get('Exam/ForID', { 'id': th.examid }),
6667
$api.post('Platform/ServerTime')
67-
).then(axios.spread(function (type, state, time) {
68+
).then(axios.spread(function (type, state, exam, time) {
6869
th.loading.init = false;
6970
//判断结果是否正常
7071
for (var i = 0; i < arguments.length; i++) {
@@ -78,23 +79,24 @@ $ready(function () {
7879
}
7980
//考试相关
8081
th.types = type.data.result;
81-
th.examstate = state.data.result; //考试的状态
82+
th.examstate = state.data.result; //考试的状态
8283
th.paperAnswer = th.examstate.result; //答题详情,也许不存在
84+
th.exam = exam.data.result;
8385
//时间信息
8486
th.time.server = eval('new ' + eval('/Date(' + time.data.result + ')/').source);
8587
th.time.client = new Date();
8688
window.setInterval(function () {
8789
th.time.now = new Date().getTime();
88-
th.paperAnswer.now = th.nowtime.getTime();
90+
if (th.paperAnswer)
91+
th.paperAnswer.now = th.nowtime.getTime();
8992
}, 1000);
9093
if (!th.islogin || !th.examstate.exist) return;
9194
//获取考试主题和专业、试卷
9295
$api.bat(
93-
$api.get('Exam/ForID', { 'id': th.examid }),
9496
$api.get('Exam/ThemeForUID', { 'uid': th.examstate.uid }),
9597
$api.get('Subject/ForID', { 'id': th.examstate.subject }),
9698
$api.get('TestPaper/ForID', { 'id': th.examstate.paper })
97-
).then(axios.spread(function (exam, theme, sbj, paper) {
99+
).then(axios.spread(function (theme, sbj, paper) {
98100
th.loading.exam = false;
99101
//判断结果是否正常
100102
for (var i = 0; i < arguments.length; i++) {
@@ -106,7 +108,7 @@ $ready(function () {
106108
throw data.message;
107109
}
108110
}
109-
th.exam = exam.data.result;
111+
110112
th.time.span = th.exam.Exam_Span;
111113
th.theme = theme.data.result;
112114
th.subject = sbj.data.result;
@@ -244,14 +246,14 @@ $ready(function () {
244246
if (th.paper.Tp_Count < 1) {
245247
this.$alert("试卷题量为零,无法出卷", '错误', {
246248
confirmButtonText: '确定',
247-
showClose:false,
249+
showClose: false,
248250
callback: action => {
249251
window.location.href = '/web/exam';
250252
}
251253
});
252254
th.loading.paper = false;
253255
return;
254-
}
256+
}
255257
$api.put('Exam/MakeoutPaper', { 'examid': th.exam.Exam_ID, 'tpid': th.paper.Tp_Id, 'stid': th.account.Ac_ID })
256258
.then(function (req) {
257259
if (req.data.success) {

0 commit comments

Comments
 (0)