Skip to content

Commit

Permalink
display: use observable version of exam.mode
Browse files Browse the repository at this point in the history
PartDisplay.visible and QuestionDisplay.visible now use exam.display.mode(), so they're automatically recomputed when the mode changes
  • Loading branch information
christianp committed Nov 9, 2023
1 parent 8e4851e commit 9917c73
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion themes/default/files/scripts/part-display.js
Expand Up @@ -64,7 +64,7 @@ Numbas.queueScript('part-display',['display-base','util','jme'],function() {
while(part.parentPart) {
part = part.parentPart;
}
return this.question.display.currentPart()==part.display || this.question.exam.mode=='review';
return this.question.display.currentPart()==part.display || this.question.exam.display.mode() == 'review';
}
},this);

Expand Down
2 changes: 1 addition & 1 deletion themes/default/files/scripts/question-display.js
Expand Up @@ -76,7 +76,7 @@ Numbas.queueScript('question-display',['display-base','jme-variables','xml','sch
var q = this.question;
var currentQuestionNumber = exam.display.currentQuestionNumber();
return (
exam.mode == 'review'
exam.display.mode() == 'review'
|| q.number==currentQuestionNumber
|| exam.settings.navigateBrowse // is browse navigation enabled?
|| this.visited() // if not, we can still move backwards to questions already seen if reverse navigation is enabled
Expand Down

0 comments on commit 9917c73

Please sign in to comment.