@@ -63,8 +63,9 @@ $ready(function () {
63
63
$api . bat (
64
64
$api . cache ( 'Question/Types:9999' ) ,
65
65
$api . get ( 'Exam/State' , { 'examid' : th . examid } ) ,
66
+ $api . get ( 'Exam/ForID' , { 'id' : th . examid } ) ,
66
67
$api . post ( 'Platform/ServerTime' )
67
- ) . then ( axios . spread ( function ( type , state , time ) {
68
+ ) . then ( axios . spread ( function ( type , state , exam , time ) {
68
69
th . loading . init = false ;
69
70
//判断结果是否正常
70
71
for ( var i = 0 ; i < arguments . length ; i ++ ) {
@@ -78,23 +79,24 @@ $ready(function () {
78
79
}
79
80
//考试相关
80
81
th . types = type . data . result ;
81
- th . examstate = state . data . result ; //考试的状态
82
+ th . examstate = state . data . result ; //考试的状态
82
83
th . paperAnswer = th . examstate . result ; //答题详情,也许不存在
84
+ th . exam = exam . data . result ;
83
85
//时间信息
84
86
th . time . server = eval ( 'new ' + eval ( '/Date(' + time . data . result + ')/' ) . source ) ;
85
87
th . time . client = new Date ( ) ;
86
88
window . setInterval ( function ( ) {
87
89
th . time . now = new Date ( ) . getTime ( ) ;
88
- th . paperAnswer . now = th . nowtime . getTime ( ) ;
90
+ if ( th . paperAnswer )
91
+ th . paperAnswer . now = th . nowtime . getTime ( ) ;
89
92
} , 1000 ) ;
90
93
if ( ! th . islogin || ! th . examstate . exist ) return ;
91
94
//获取考试主题和专业、试卷
92
95
$api . bat (
93
- $api . get ( 'Exam/ForID' , { 'id' : th . examid } ) ,
94
96
$api . get ( 'Exam/ThemeForUID' , { 'uid' : th . examstate . uid } ) ,
95
97
$api . get ( 'Subject/ForID' , { 'id' : th . examstate . subject } ) ,
96
98
$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 ) {
98
100
th . loading . exam = false ;
99
101
//判断结果是否正常
100
102
for ( var i = 0 ; i < arguments . length ; i ++ ) {
@@ -106,7 +108,7 @@ $ready(function () {
106
108
throw data . message ;
107
109
}
108
110
}
109
- th . exam = exam . data . result ;
111
+
110
112
th . time . span = th . exam . Exam_Span ;
111
113
th . theme = theme . data . result ;
112
114
th . subject = sbj . data . result ;
@@ -244,14 +246,14 @@ $ready(function () {
244
246
if ( th . paper . Tp_Count < 1 ) {
245
247
this . $alert ( "试卷题量为零,无法出卷" , '错误' , {
246
248
confirmButtonText : '确定' ,
247
- showClose :false ,
249
+ showClose : false ,
248
250
callback : action => {
249
251
window . location . href = '/web/exam' ;
250
252
}
251
253
} ) ;
252
254
th . loading . paper = false ;
253
255
return ;
254
- }
256
+ }
255
257
$api . put ( 'Exam/MakeoutPaper' , { 'examid' : th . exam . Exam_ID , 'tpid' : th . paper . Tp_Id , 'stid' : th . account . Ac_ID } )
256
258
. then ( function ( req ) {
257
259
if ( req . data . success ) {
0 commit comments