From 9917c73fcd2329963e292b0c6fb29d909216225f Mon Sep 17 00:00:00 2001 From: Christian Lawson-Perfect Date: Thu, 9 Nov 2023 09:53:57 +0000 Subject: [PATCH] display: use observable version of exam.mode PartDisplay.visible and QuestionDisplay.visible now use exam.display.mode(), so they're automatically recomputed when the mode changes --- themes/default/files/scripts/part-display.js | 2 +- themes/default/files/scripts/question-display.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/themes/default/files/scripts/part-display.js b/themes/default/files/scripts/part-display.js index 0c6c33fb2..29b2c422f 100644 --- a/themes/default/files/scripts/part-display.js +++ b/themes/default/files/scripts/part-display.js @@ -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); diff --git a/themes/default/files/scripts/question-display.js b/themes/default/files/scripts/question-display.js index 2fa1abef4..4224e9b3d 100644 --- a/themes/default/files/scripts/question-display.js +++ b/themes/default/files/scripts/question-display.js @@ -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