Skip to content
This repository was archived by the owner on Jun 7, 2023. It is now read-only.

Commit 39c963b

Browse files
author
constantinol
committed
fully functioning flag with option to come back and done and changes accordingly to each question status
1 parent cc88f7f commit 39c963b

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

runestone/timed/js/timed.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,15 @@ export default class Timed extends RunestoneBase {
383383
$(
384384
"ul#pageNums > ul > li:eq(" + this.currentQuestionIndex + ")"
385385
).addClass("active");
386+
if ($("ul#pageNums > ul > li:eq(" + this.currentQuestionIndex + ")"
387+
).hasClass("flagcolor")){
388+
this.flagButton.innerHTML = "Done";
389+
390+
}
391+
else{
392+
this.flagButton.innerHTML = "Come Back";
393+
}
394+
386395
}
387396

388397
async handleFlag(event) {
@@ -403,6 +412,7 @@ export default class Timed extends RunestoneBase {
403412
await this.navigateAway();
404413
}
405414
for (var i = 0; i < this.qNumList.childNodes.length; i++) {
415+
//this.flagButton.innerHTML = "Come Back";
406416
for (
407417
var j = 0;
408418
j < this.qNumList.childNodes[i].childNodes.length;
@@ -424,6 +434,14 @@ export default class Timed extends RunestoneBase {
424434
$(
425435
"ul#pageNums > ul > li:eq(" + this.currentQuestionIndex + ")"
426436
).addClass("active");
437+
if ($("ul#pageNums > ul > li:eq(" + this.currentQuestionIndex + ")"
438+
).hasClass("flagcolor")){
439+
this.flagButton.innerHTML = "Done";
440+
441+
}
442+
else{
443+
this.flagButton.innerHTML = "Come Back";
444+
}
427445
await this.renderTimedQuestion();
428446
this.ensureButtonSafety();
429447
}

0 commit comments

Comments
 (0)