@@ -649,6 +649,7 @@ export default class Timed extends RunestoneBase {
649649 let componentKind = $ ( tmpChild ) . data ( "component" ) ;
650650 this . renderedQuestionArray [ this . currentQuestionIndex ] = {
651651 question : window . component_factory [ componentKind ] ( opts ) ,
652+ state : opts . state ,
652653 } ;
653654 }
654655 } else if ( opts . state === "broken_exam" ) {
@@ -658,6 +659,7 @@ export default class Timed extends RunestoneBase {
658659 currentQuestion =
659660 this . renderedQuestionArray [ this . currentQuestionIndex ] . question ;
660661 if ( opts . state === "forreview" ) {
662+ await currentQuestion . component_ready_promise ;
661663 await currentQuestion . checkCurrentAnswer ( ) ;
662664 currentQuestion . renderFeedback ( ) ;
663665 currentQuestion . disableInteraction ( ) ;
@@ -1156,7 +1158,7 @@ export default class Timed extends RunestoneBase {
11561158 parseInt ( data . correct ) ,
11571159 parseInt ( data . incorrect ) ,
11581160 parseInt ( data . skipped ) ,
1159- parseInt ( data . timeTaken ) ,
1161+ parseInt ( data . time_taken ) ,
11601162 data . reset ,
11611163 ] ;
11621164 this . setLocalStorage ( tmpArr ) ;
@@ -1173,6 +1175,11 @@ export default class Timed extends RunestoneBase {
11731175 this . incorrect = tmpArr [ 1 ] ;
11741176 this . skipped = tmpArr [ 2 ] ;
11751177 this . timeTaken = tmpArr [ 3 ] ;
1178+ } else if ( tmpArr . length == 5 ) {
1179+ this . score = tmpArr [ 0 ] ;
1180+ this . incorrect = tmpArr [ 1 ] ;
1181+ this . skipped = tmpArr [ 2 ] ;
1182+ this . timeTaken = tmpArr [ 3 ] ;
11761183 } else if ( tmpArr . length == 7 ) {
11771184 // Loaded Completed Exam
11781185 this . score = tmpArr [ 0 ] ;
@@ -1224,14 +1231,14 @@ export default class Timed extends RunestoneBase {
12241231 scoreString = `Num Correct: ${ this . score } . Questions: ${ this . correctStr } <br>Num Wrong: ${ this . incorrect } . Questions: ${ this . incorrectStr } <br>Num Skipped: ${ this . skipped } . Questions: ${ this . skippedStr } <br>` ;
12251232 numQuestions = this . score + this . incorrect + this . skipped ;
12261233 percentCorrect = ( this . score / numQuestions ) * 100 ;
1227- scoreString += "Percent Correct: " + percentCorrect + "%" ;
1234+ scoreString += "Percent Correct: " + percentCorrect . toFixed ( 2 ) + "%" ;
12281235 $ ( this . scoreDiv ) . html ( scoreString ) ;
12291236 this . scoreDiv . style . display = "block" ;
12301237 } else {
12311238 scoreString = `Num Correct: ${ this . score } <br>Num Wrong: ${ this . incorrect } <br>Num Skipped: ${ this . skipped } <br>` ;
12321239 numQuestions = this . score + this . incorrect + this . skipped ;
12331240 percentCorrect = ( this . score / numQuestions ) * 100 ;
1234- scoreString += "Percent Correct: " + percentCorrect + "%" ;
1241+ scoreString += "Percent Correct: " + percentCorrect . toFixed ( 2 ) + "%" ;
12351242 $ ( this . scoreDiv ) . html ( scoreString ) ;
12361243 this . scoreDiv . style . display = "block" ;
12371244 }
0 commit comments