@@ -116,6 +116,10 @@ $(document).ready(function() {
116116 $ ( '#pyOutputPane #editBtn' ) . click ( function ( ) {
117117 enterEditMode ( ) ;
118118 } ) ;
119+
120+ $ ( '#gradeStdout,#gradeStderr' ) . val ( '' ) ; // clear 'em
121+ $ ( '#submitGradeBtn' ) . html ( 'Submit for Grading' ) ;
122+ $ ( '#submitGradeBtn' ) . attr ( 'disabled' , false ) ;
119123 }
120124 else if ( appMode == 'display_no_frills' ) {
121125 $ ( "#pyInputPane" ) . hide ( ) ;
@@ -142,7 +146,7 @@ $(document).ready(function() {
142146 $ ( "#pyOutputPane,#gradingPane" ) . hide ( ) ;
143147 $ ( "#embedLinkDiv" ) . hide ( ) ;
144148
145- var backendOptionsObj = { cumulative_mode : ( $ ( '#cumulativeModeSelector' ) . val ( ) == 'true' ) ,
149+ var backendOptionsObj = { cumulative_mode : false ,
146150 heap_primitives : false ,
147151 show_only_outputs : false ,
148152 py_crazy_mode : false ,
@@ -222,11 +226,6 @@ $(document).ready(function() {
222226
223227 var queryStrOptions = getQueryStringOptions ( ) ;
224228
225- // ugh, ugly tristate due to the possibility of each being undefined
226- if ( queryStrOptions . cumulativeState !== undefined ) {
227- $ ( '#cumulativeModeSelector' ) . val ( queryStrOptions . cumulativeState ) ;
228- }
229-
230229 appMode = $ . bbq . getState ( 'mode' ) ; // assign this to the GLOBAL appMode
231230 if ( ( appMode == "display" ) && queryStrOptions . preseededCode /* jump to display only with pre-seeded code */ ) {
232231 preseededCurInstr = queryStrOptions . preseededCurInstr ; // ugly global
@@ -273,12 +272,18 @@ $(document).ready(function() {
273272
274273
275274 $ ( '#submitGradeBtn' ) . bind ( 'click' , function ( ) {
275+ $ ( '#submitGradeBtn' ) . html ( 'Now Grading ...' ) ;
276+ $ ( '#submitGradeBtn' ) . attr ( 'disabled' , true ) ;
277+
276278 $ . get ( 'submit_matrix_problem' ,
277279 { submitted_code : pyInputCodeMirror . getValue ( ) ,
278280 problem_name : 'python_comprehension-1' } ,
279281 function ( dataFromBackend ) {
280282 $ ( '#gradeStdout' ) . val ( dataFromBackend . user_stdout ) ;
281283 $ ( '#gradeStderr' ) . val ( dataFromBackend . user_stderr ) ;
284+
285+ $ ( '#submitGradeBtn' ) . html ( 'Submit for Grading' ) ;
286+ $ ( '#submitGradeBtn' ) . attr ( 'disabled' , false ) ;
282287 } ,
283288 "json" ) ;
284289
0 commit comments