@@ -63,7 +63,7 @@ export default class Timed extends RunestoneBase {
6363 if ( $ ( this . origElem ) . is ( "[data-no-pause]" ) ) {
6464 this . nopause = true ;
6565 }
66-
66+ eBookConfig . enableScratchAC = false ;
6767 this . running = 0 ;
6868 this . paused = 0 ;
6969 this . done = 0 ;
@@ -275,14 +275,14 @@ export default class Timed extends RunestoneBase {
275275 this . flagContainer = document . createElement ( "li" ) ;
276276 this . flagButton = document . createElement ( "button" ) ;
277277 $ ( this . flagButton ) . addClass ( "flagBtn" ) ;
278- this . flagButton . innerHTML = "Flag Question" ; // name on button
278+ this . flagButton . innerHTML = "Flag Question" ; // name on button
279279 $ ( this . flagButton ) . attr ( "aria-labelledby" , "Flag" ) ;
280280 $ ( this . flagButton ) . attr ( "tabindex" , "5" ) ;
281281 $ ( this . flagButton ) . attr ( "role" , "button" ) ;
282282 $ ( this . flagButton ) . attr ( "id" , "flag" ) ;
283283 $ ( this . flagButton ) . css ( "cursor" , "pointer" ) ;
284- this . flagContainer . appendChild ( this . flagButton ) ; // adding button to container
285- this . flaggingPlace . appendChild ( this . flagContainer ) ; // adding container to flaggingPlace
284+ this . flagContainer . appendChild ( this . flagButton ) ; // adding button to container
285+ this . flaggingPlace . appendChild ( this . flagContainer ) ; // adding container to flaggingPlace
286286 // making "Next" button
287287 this . rightContainer = document . createElement ( "li" ) ;
288288 this . rightNavButton = document . createElement ( "button" ) ;
@@ -296,7 +296,7 @@ export default class Timed extends RunestoneBase {
296296 this . pagNavList . appendChild ( this . rightContainer ) ;
297297 this . ensureButtonSafety ( ) ;
298298 this . navDiv . appendChild ( this . pagNavList ) ;
299- this . flagDiv . appendChild ( this . flaggingPlace ) ; // adds flaggingPlace to the flagDiv
299+ this . flagDiv . appendChild ( this . flaggingPlace ) ; // adds flaggingPlace to the flagDiv
300300 this . break = document . createElement ( "br" ) ;
301301 this . navDiv . appendChild ( this . break ) ;
302302 // render the question number jump buttons
@@ -319,7 +319,7 @@ export default class Timed extends RunestoneBase {
319319 this . qNumList . appendChild ( this . qNumWrapperList ) ;
320320 this . navDiv . appendChild ( this . qNumList ) ;
321321 this . navBtnListeners ( ) ;
322- this . flagBtnListener ( ) ; // listens for click on flag button
322+ this . flagBtnListener ( ) ; // listens for click on flag button
323323 $ ( this . flagButton ) . hide ( ) ;
324324 }
325325
@@ -365,12 +365,14 @@ export default class Timed extends RunestoneBase {
365365 await this . navigateAway ( ) ;
366366 }
367367 var target = $ ( event . target ) . text ( ) ;
368- if ( target . match ( / N e x t / ) ) { // checks given text to match "Next"
368+ if ( target . match ( / N e x t / ) ) {
369+ // checks given text to match "Next"
369370 if ( $ ( this . rightContainer ) . hasClass ( "disabled" ) ) {
370371 return ;
371372 }
372373 this . currentQuestionIndex ++ ;
373- } else if ( target . match ( / P r e v / ) ) { // checks given text to match "Prev"
374+ } else if ( target . match ( / P r e v / ) ) {
375+ // checks given text to match "Prev"
374376 if ( $ ( this . leftContainer ) . hasClass ( "disabled" ) ) {
375377 return ;
376378 }
@@ -392,26 +394,31 @@ export default class Timed extends RunestoneBase {
392394 $ (
393395 "ul#pageNums > ul > li:eq(" + this . currentQuestionIndex + ")"
394396 ) . addClass ( "active" ) ;
395- if ( $ ( "ul#pageNums > ul > li:eq(" + this . currentQuestionIndex + ")"
396- ) . hasClass ( "flagcolor" ) ) { // checking for class
397- this . flagButton . innerHTML = "Unflag Question" ; // changes text on button
398- }
399- else {
400- this . flagButton . innerHTML = "Flag Question" ; // changes text on button
397+ if (
398+ $ (
399+ "ul#pageNums > ul > li:eq(" + this . currentQuestionIndex + ")"
400+ ) . hasClass ( "flagcolor" )
401+ ) {
402+ // checking for class
403+ this . flagButton . innerHTML = "Unflag Question" ; // changes text on button
404+ } else {
405+ this . flagButton . innerHTML = "Flag Question" ; // changes text on button
401406 }
402407 }
403408
404409 async handleFlag ( event ) {
405410 // called when flag button is clicked
406- var target = $ ( event . target ) . text ( )
411+ var target = $ ( event . target ) . text ( ) ;
407412 if ( target . match ( / F l a g Q u e s t i o n / ) ) {
408- $ ( "ul#pageNums > ul > li:eq(" + this . currentQuestionIndex + ")"
409- ) . addClass ( "flagcolor" ) ; // class will change color of question block
413+ $ (
414+ "ul#pageNums > ul > li:eq(" + this . currentQuestionIndex + ")"
415+ ) . addClass ( "flagcolor" ) ; // class will change color of question block
410416 this . flagButton . innerHTML = "Unflag Question" ;
411417 } else {
412- $ ( "ul#pageNums > ul > li:eq(" + this . currentQuestionIndex + ")"
413- ) . removeClass ( "flagcolor" ) ; // will restore current color of question block
414- this . flagButton . innerHTML = "Flag Question" ; // also sets name back
418+ $ (
419+ "ul#pageNums > ul > li:eq(" + this . currentQuestionIndex + ")"
420+ ) . removeClass ( "flagcolor" ) ; // will restore current color of question block
421+ this . flagButton . innerHTML = "Flag Question" ; // also sets name back
415422 }
416423 }
417424
@@ -441,11 +448,13 @@ export default class Timed extends RunestoneBase {
441448 $ (
442449 "ul#pageNums > ul > li:eq(" + this . currentQuestionIndex + ")"
443450 ) . addClass ( "active" ) ;
444- if ( $ ( "ul#pageNums > ul > li:eq(" + this . currentQuestionIndex + ")" // checking for flagcolor class
445- ) . hasClass ( "flagcolor" ) ) {
451+ if (
452+ $ (
453+ "ul#pageNums > ul > li:eq(" + this . currentQuestionIndex + ")" // checking for flagcolor class
454+ ) . hasClass ( "flagcolor" )
455+ ) {
446456 this . flagButton . innerHTML = "Unflag Question" ;
447- }
448- else {
457+ } else {
449458 this . flagButton . innerHTML = "Flag Question" ;
450459 }
451460 await this . renderTimedQuestion ( ) ;
@@ -473,7 +482,7 @@ export default class Timed extends RunestoneBase {
473482 flagBtnListener ( ) {
474483 this . flaggingPlace . addEventListener (
475484 "click" ,
476- this . handleFlag . bind ( this ) , // calls this to take action
485+ this . handleFlag . bind ( this ) , // calls this to take action
477486 false
478487 ) ;
479488 }
@@ -583,9 +592,8 @@ export default class Timed extends RunestoneBase {
583592 currentIndex -= 1 ;
584593 // And swap it with the current element.
585594 temporaryValue = this . renderedQuestionArray [ currentIndex ] ;
586- this . renderedQuestionArray [
587- currentIndex
588- ] = this . renderedQuestionArray [ randomIndex ] ;
595+ this . renderedQuestionArray [ currentIndex ] =
596+ this . renderedQuestionArray [ randomIndex ] ;
589597 this . renderedQuestionArray [ randomIndex ] = temporaryValue ;
590598 }
591599 }
@@ -629,9 +637,8 @@ export default class Timed extends RunestoneBase {
629637 }
630638 } catch ( e ) {
631639 opts . state = "broken_exam" ;
632- this . renderedQuestionArray [
633- this . currentQuestionIndex
634- ] = opts ;
640+ this . renderedQuestionArray [ this . currentQuestionIndex ] =
641+ opts ;
635642 console . log (
636643 `Error initializing question: Details ${ e } `
637644 ) ;
@@ -647,8 +654,8 @@ export default class Timed extends RunestoneBase {
647654 return ;
648655 }
649656
650- currentQuestion = this . renderedQuestionArray [ this . currentQuestionIndex ]
651- . question ;
657+ currentQuestion =
658+ this . renderedQuestionArray [ this . currentQuestionIndex ] . question ;
652659 if ( opts . state === "forreview" ) {
653660 await currentQuestion . checkCurrentAnswer ( ) ;
654661 currentQuestion . renderFeedback ( ) ;
@@ -948,9 +955,8 @@ export default class Timed extends RunestoneBase {
948955 // send the final version of the question the student is on when they press the
949956 // finish exam button.
950957
951- var currentQuestion = this . renderedQuestionArray [
952- this . currentQuestionIndex
953- ] . question ;
958+ var currentQuestion =
959+ this . renderedQuestionArray [ this . currentQuestionIndex ] . question ;
954960 await currentQuestion . checkCurrentAnswer ( ) ;
955961 await currentQuestion . logCurrentAnswer ( ) ;
956962 currentQuestion . renderFeedback ( ) ;
@@ -1000,9 +1006,8 @@ export default class Timed extends RunestoneBase {
10001006 this . incorrectStr = "" ;
10011007 // Gets the score of each problem
10021008 for ( var i = 0 ; i < this . renderedQuestionArray . length ; i ++ ) {
1003- var correct = this . renderedQuestionArray [
1004- i
1005- ] . question . checkCorrectTimed ( ) ;
1009+ var correct =
1010+ this . renderedQuestionArray [ i ] . question . checkCorrectTimed ( ) ;
10061011 if ( correct == "T" ) {
10071012 this . score ++ ;
10081013 this . correctStr = this . correctStr + ( i + 1 ) + ", " ;
0 commit comments