@@ -90,9 +90,9 @@ $ready(function () {
90
90
if ( ! th . islogin || ! th . examstate . exist ) return ;
91
91
//获取考试主题和专业、试卷
92
92
$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 } ) ,
96
96
$api . get ( 'TestPaper/ForID' , { 'id' : th . examstate . paper } )
97
97
) . then ( axios . spread ( function ( exam , theme , sbj , paper ) {
98
98
th . loading . exam = false ;
@@ -192,7 +192,7 @@ $ready(function () {
192
192
this . time . wait = this . starttime . getTime ( ) - this . nowtime . getTime ( ) ;
193
193
this . time . wait = this . time . wait <= 0 ? 0 : Math . floor ( this . time . wait / 1000 ) ;
194
194
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 ) != '{}' ) {
196
196
this . generatePaper ( ) ;
197
197
}
198
198
if ( this . time . wait == 0 && ! this . examstate . issubmit ) {
@@ -240,6 +240,18 @@ $ready(function () {
240
240
if ( this . loading . paper ) return ;
241
241
var th = this ;
242
242
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
+ }
243
255
$api . put ( 'Exam/MakeoutPaper' , { 'examid' : th . exam . Exam_ID , 'tpid' : th . paper . Tp_Id , 'stid' : th . account . Ac_ID } )
244
256
. then ( function ( req ) {
245
257
if ( req . data . success ) {
@@ -306,9 +318,6 @@ $ready(function () {
306
318
"examid" : this . exam . Exam_ID ,
307
319
"exrid" : this . examstate . exrid
308
320
} ) ;
309
- return
310
- //var url = "Review?examid=" + this.exam.Exam_ID + "&exrid=" + this.result.Exr_ID;
311
- window . location . href = url ;
312
321
} ,
313
322
calcTime : function ( ) {
314
323
//固定时间开始
@@ -330,7 +339,7 @@ $ready(function () {
330
339
//patter:提交方式,1为自动提交,2为交卷
331
340
submit : function ( patter ) {
332
341
var th = this ;
333
-
342
+ if ( th . paper . Tp_Count < 1 ) return ;
334
343
if ( ! th . islogin || ! th . isexam ) return ;
335
344
if ( JSON . stringify ( th . paperAnswer ) == '{}' ) return ;
336
345
if ( th . examstate . issubmit || th . submitState . loading ) return ;
0 commit comments