@@ -1078,6 +1078,7 @@ function parseQueryString() {
10781078
10791079 if ( queryStrOptions . codeopticonSession ) {
10801080 codeopticonSession = queryStrOptions . codeopticonSession ; // GLOBAL defined in codeopticon-learner.js
1081+ codeopticonUsername = queryStrOptions . codeopticonUsername ; // GLOBAL defined in codeopticon-learner.js
10811082 }
10821083
10831084 if ( queryStrOptions . testCasesLst ) {
@@ -1113,7 +1114,8 @@ function getQueryStringOptions() {
11131114 heapPrimitives : $ . bbq . getState ( 'heapPrimitives' ) ,
11141115 textReferences : $ . bbq . getState ( 'textReferences' ) ,
11151116 rawInputLst : ril ? $ . parseJSON ( ril ) : undefined ,
1116- codeopticonSession : $ . bbq . getState ( 'codeopticon' ) ,
1117+ codeopticonSession : $ . bbq . getState ( 'cosession' ) ,
1118+ codeopticonUsername : $ . bbq . getState ( 'couser' ) ,
11171119 testCasesLst : testCasesLstJSON ? $ . parseJSON ( testCasesLstJSON ) : undefined
11181120 } ;
11191121}
@@ -1230,7 +1232,11 @@ function updateAppDisplay(newAppMode) {
12301232
12311233 $ ( document ) . scrollTop ( 0 ) ; // scroll to top to make UX better on small monitors
12321234
1233- $ . bbq . pushState ( { mode : 'edit' } , 2 /* completely override other hash strings to keep URL clean */ ) ;
1235+ var s = { mode : 'edit' } ;
1236+ // keep these persistent so that they survive page reloads
1237+ if ( codeopticonSession ) { s . cosession = codeopticonSession ; }
1238+ if ( codeopticonUsername ) { s . couser = codeopticonUsername ; }
1239+ $ . bbq . pushState ( s , 2 /* completely override other hash strings to keep URL clean */ ) ;
12341240 }
12351241 else if ( appMode == 'display' || appMode == 'visualize' /* 'visualize' is deprecated */ ) {
12361242 assert ( myVisualizer ) ;
@@ -1283,7 +1289,11 @@ function updateAppDisplay(newAppMode) {
12831289 } ) ;
12841290 } ) ;
12851291
1286- $ . bbq . pushState ( { mode : 'display' } , 2 /* completely override other hash strings to keep URL clean */ ) ;
1292+ var s = { mode : 'display' } ;
1293+ // keep these persistent so that they survive page reloads
1294+ if ( codeopticonSession ) { s . cosession = codeopticonSession ; }
1295+ if ( codeopticonUsername ) { s . couser = codeopticonUsername ; }
1296+ $ . bbq . pushState ( s , 2 /* completely override other hash strings to keep URL clean */ ) ;
12871297 }
12881298 else {
12891299 assert ( false ) ;
0 commit comments