@@ -275,8 +275,13 @@ function finishQuestionsInit(questionsDat) {
275275
276276 var submittedCode = concatSolnTestCode ( $ ( "#actualCodeInput" ) . val ( ) , $ ( "#testCodeInput" ) . val ( ) ) ;
277277
278+ var postParams = { user_script : submittedCode } ;
279+ if ( questionsDat . max_instructions ) {
280+ postParams . max_instructions = questionsDat . max_instructions ;
281+ }
282+
278283 $ . post ( "cgi-bin/web_exec.py" ,
279- { user_script : submittedCode } ,
284+ postParams ,
280285 function ( traceData ) {
281286 renderPyCodeOutput ( submittedCode ) ;
282287 enterVisualizeMode ( traceData ) ;
@@ -300,8 +305,14 @@ function finishQuestionsInit(questionsDat) {
300305 // out-of-order, so code very carefully here!!!
301306 for ( var i = 0 ; i < tests . length ; i ++ ) {
302307 var submittedCode = concatSolnTestCode ( $ ( "#actualCodeInput" ) . val ( ) , tests [ i ] ) ;
308+
309+ var postParams = { user_script : submittedCode , expect_script : expects [ i ] } ;
310+ if ( questionsDat . max_instructions ) {
311+ postParams . max_instructions = questionsDat . max_instructions ;
312+ }
313+
303314 $ . post ( "cgi-bin/web_run_test.py" ,
304- { user_script : submittedCode , expect_script : expects [ i ] } ,
315+ postParams ,
305316 genTestResultHandler ( i ) ,
306317 "json" ) ;
307318 }
@@ -342,7 +353,7 @@ function gradeSubmission() {
342353 }
343354
344355 if ( res . status == 'error' ) {
345- $ ( "#gradeMatrix tr.gradeMatrixRow:last" ) . append ( '<td class="testOutputCell"><span style="padding: 5px; background-color: ' + errorColor + '; ">' + res . error_msg + '</span></td>' ) ;
356+ $ ( "#gradeMatrix tr.gradeMatrixRow:last" ) . append ( '<td class="testOutputCell"><span style="padding-left: 3px; padding-right: 3px; background-color: ' + errorColor + '">' + res . error_msg + '</span></td>' ) ;
346357 }
347358 else {
348359 assert ( res . status == 'ok' ) ;
0 commit comments