@@ -476,8 +476,8 @@ export class ActiveCode extends RunestoneBase {
476476 if ( ! didAgree ) {
477477 didAgree = confirm (
478478 "Pair Programming should only be used with the consent of your instructor." +
479- "Your partner must be a registered member of the class and have agreed to pair with you." +
480- "By clicking OK you certify that both of these conditions have been met."
479+ "Your partner must be a registered member of the class and have agreed to pair with you." +
480+ "By clicking OK you certify that both of these conditions have been met."
481481 ) ;
482482 if ( didAgree ) {
483483 localStorage . setItem ( "partnerAgree" , "true" ) ;
@@ -520,13 +520,13 @@ export class ActiveCode extends RunestoneBase {
520520 $ ( butt ) . attr (
521521 "href" ,
522522 "http://" +
523- chatcodesServer +
524- "/new?" +
525- $ . param ( {
526- topic : window . location . host + "-" + this . divid ,
527- code : this . editor . getValue ( ) ,
528- lang : "Python" ,
529- } )
523+ chatcodesServer +
524+ "/new?" +
525+ $ . param ( {
526+ topic : window . location . host + "-" + this . divid ,
527+ code : this . editor . getValue ( ) ,
528+ lang : "Python" ,
529+ } )
530530 ) ;
531531 this . chatButton = butt ;
532532 chatBar . appendChild ( butt ) ;
@@ -913,7 +913,7 @@ export class ActiveCode extends RunestoneBase {
913913 } ) ;
914914 }
915915
916- toggleEditorVisibility ( ) { }
916+ toggleEditorVisibility ( ) { }
917917
918918 addErrorMessage ( err ) {
919919 // Add the error message
@@ -1051,7 +1051,7 @@ Yet another is that there is an internal error. The internal error message is:
10511051 var xl = eval ( x ) ;
10521052 xl = xl . map ( pyStr ) ;
10531053 x = xl . join ( " " ) ;
1054- } catch ( err ) { }
1054+ } catch ( err ) { }
10551055 }
10561056 }
10571057 $ ( this . output ) . css ( "visibility" , "visible" ) ;
@@ -1155,7 +1155,7 @@ Yet another is that there is an internal error. The internal error message is:
11551155 if (
11561156 this . historyScrubber &&
11571157 this . history [ $ ( this . historyScrubber ) . slider ( "value" ) ] !=
1158- this . editor . getValue ( )
1158+ this . editor . getValue ( )
11591159 ) {
11601160 saveCode = "True" ;
11611161 this . history . push ( this . editor . getValue ( ) ) ;
@@ -1188,8 +1188,9 @@ Yet another is that there is an internal error. The internal error message is:
11881188 }
11891189 }
11901190
1191- logCurrentAnswer ( ) {
1192- this . logRunEvent ( {
1191+ // the sid parameter is optional and is used for group submissions
1192+ async logCurrentAnswer ( sid ) {
1193+ let data = {
11931194 div_id : this . divid ,
11941195 code : this . editor . getValue ( ) ,
11951196 lang : this . language ,
@@ -1198,14 +1199,22 @@ Yet another is that there is an internal error. The internal error message is:
11981199 prefix : this . pretext ,
11991200 suffix : this . suffix ,
12001201 partner : this . partner ,
1201- } ) ; // Log the run event
1202+ } ; // Log the run event
1203+ if ( typeof sid !== "undefined" ) {
1204+ data . sid = sid ;
1205+ }
1206+ await this . logRunEvent ( data ) ;
12021207 // If unit tests were run there will be a unit_results
12031208 if ( this . unit_results ) {
1204- this . logBookEvent ( {
1209+ let unitData = {
12051210 act : this . unit_results ,
12061211 div_id : this . divid ,
12071212 event : "unittest" ,
1208- } ) ;
1213+ } ;
1214+ if ( typeof sid !== "undefined" ) {
1215+ unitData . sid = sid ;
1216+ }
1217+ await this . logBookEvent ( unitData )
12091218 }
12101219 }
12111220
0 commit comments