Skip to content

Commit bcca1d1

Browse files
committed
use numbas.review_allowed from SCORM to decide whether to enter review mode on resuming a finished attempt
1 parent 1ec6d12 commit bcca1d1

File tree

8 files changed

+247
-125
lines changed

8 files changed

+247
-125
lines changed

runtime/scripts/exam.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ Exam.prototype = /** @lends Numbas.Exam.prototype */ {
291291
'allowrevealanswer',
292292
'advicethreshold',
293293
],
294-
exam,
294+
settings,
295295
[
296296
'showActualMark',
297297
'showTotalMark',
@@ -1346,7 +1346,7 @@ Exam.prototype = /** @lends Numbas.Exam.prototype */ {
13461346

13471347
//display the results
13481348

1349-
var revealAnswers = this.settings.enterReviewModeImmediately || this.entry == 'review' || Numbas.is_instructor;
1349+
var revealAnswers = this.settings.enterReviewModeImmediately || (this.entry == 'review' && this.store.reviewModeAllowed()) || Numbas.is_instructor;
13501350

13511351
for(var i=0;i<this.questionList.length;i++) {
13521352
this.questionList[i].lock();

runtime/scripts/scorm-storage.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -560,6 +560,15 @@ SCORMStorage.prototype = /** @lends Numbas.storage.SCORMStorage.prototype */ {
560560
return this.get('mode');
561561
},
562562

563+
/** Is review mode allowed?
564+
*
565+
* @returns {boolean}
566+
*/
567+
reviewModeAllowed: function() {
568+
var allowed = pipwerks.SCORM.get('numbas.review_allowed');
569+
return allowed !== 'false';
570+
},
571+
563572
/** Call this when the student moves to a different question.
564573
*
565574
* @param {Numbas.Question} question

runtime/scripts/storage.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,11 @@ Numbas.storage.BlankStorage.prototype = /** @lends Numbas.storage.BlankStorage.p
232232
* @returns {string}
233233
*/
234234
getMode: function() {},
235+
/** Is review mode allowed?
236+
*
237+
* @returns {boolean}
238+
*/
239+
reviewModeAllowed: function() {},
235240
/** Call this when the student moves to a different question.
236241
*
237242
* @abstract

tests/locales.js

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1545,10 +1545,8 @@ Numbas.locale = {
15451545
"control.submit part.confirm remove next parts": "<p>One or more subsequent parts depend on your answer to this part. Submitting this part again will invalidate those parts, and remove them from the question. This cannot be undone.</p>\n<p>Would you like to submit this part again?</p>",
15461546
"control.proceed anyway": "Proceed anyway?",
15471547
"control.regen": "Try another question like this one",
1548-
"control.submit answer": "Submit answer",
1549-
"control.submit all parts": "Submit all parts",
1550-
"control.submit again": "Submit again",
1551-
"control.submit": "Submit",
1548+
"control.submit answer": "Save answer",
1549+
"control.submit all parts": "Save all answers",
15521550
"control.previous": "Previous",
15531551
"control.next": "Next",
15541552
"control.advice": "Advice",
@@ -1718,7 +1716,7 @@ Numbas.locale = {
17181716
"part.marking.maximum scaled down": "The maximum you can score for this part is <strong>{{count,niceNumber}}</strong> $t(mark). Your scores will be scaled down accordingly.",
17191717
"part.marking.used variable replacements": "This part was marked using your answers to previous parts.",
17201718
"part.marking.variable replacement part not answered": "You must answer {{part}} first.",
1721-
"part.marking.resubmit because of variable replacement": "This part's marking depends on your answers to other parts, which you have changed. Submit this part again to update your score.",
1719+
"part.marking.resubmit because of variable replacement": "This part's marking depends on your answers to other parts, which you have changed. Save your answer to this part again to update your score.",
17221720
"part.marking.not submitted": "No answer submitted.",
17231721
"part.marking.did not answer": "You did not answer this question.",
17241722
"part.marking.total score": "You scored <strong>{{count,niceNumber}}</strong> $t(mark) for this part.",
@@ -1750,8 +1748,11 @@ Numbas.locale = {
17501748
"part.missing type attribute": "{{part}}: Missing part type attribute",
17511749
"part.unknown type": "{{part}}: Unrecognised part type {{type}}",
17521750
"part.setting not present": "Property '{{property}}' not set",
1753-
"part.feedback out of date": "This feedback is based on your last submitted answer. Submit your changed answer to get updated feedback.",
1751+
"part.feedback out of date": "This feedback is based on your last submitted answer. Save your changed answer to get updated feedback.",
17541752
"part.input title": "Answer for part {{name}}",
1753+
"part.show feedback": "Show feedback",
1754+
"part.hide feedback": "Hide feedback",
1755+
"part.feedback title": "Feedback for {{name}}.",
17551756
"part.correct answer title": "Expected answer for part {{name}}",
17561757
"part.waiting for pre submit": "Your answer is being marked. Please wait.",
17571758
"part.jme.answer missing": "Correct answer is missing",
@@ -1778,6 +1779,7 @@ Numbas.locale = {
17781779
"part.numberentry.answer invalid": "You did not enter a valid number.",
17791780
"part.numberentry.answer not reduced": "Your answer is not reduced to lowest terms.",
17801781
"part.numberentry.give your answer as a reduced fraction": "Reduce your answer to lowest terms.",
1782+
"part.numberentry.write your answer as a fraction": "Write your answer as a fraction.",
17811783
"part.numberentry.answer not integer": "Your answer is invalid. You must enter a whole number, not a decimal.",
17821784
"part.numberentry.answer not integer or decimal": "Your answer is invalid. You must enter an integer or a decimal.",
17831785
"part.numberentry.answer not integer or decimal or fraction": "Your answer is invalid. You must enter an integer, a decimal or a fraction.",
@@ -1837,6 +1839,7 @@ Numbas.locale = {
18371839
"question.header": "Question {{number}}",
18381840
"question.submit part": "Save answer",
18391841
"question.answer saved": "Answer saved",
1842+
"question.all answers saved": "All answers saved",
18401843
"question.show steps": "Show steps",
18411844
"question.show steps penalty": "You will lose <strong>{{count,niceNumber}}</strong> $t(mark).",
18421845
"question.show steps no penalty": "Your score will not be affected.",
@@ -1849,8 +1852,8 @@ Numbas.locale = {
18491852
"question.no such part": "Can't find part {{path}}.",
18501853
"question.can not submit": "Can not submit answer - check for errors.",
18511854
"question.answer submitted": "Answer submitted",
1852-
"question.unsubmitted changes": "You have made a change to your answer but not submitted it. Please check your answer and then press the <strong>Submit answer</strong> button.",
1853-
"question.unsubmitted changes_plural": "You have made changes to your answers but not submitted them. Please check your answers to each part and then press the <strong>Submit all parts</strong> button.",
1855+
"question.unsubmitted changes": "You have made a change to your answer but not submitted it. Please check your answer and then press the <strong>Save answer</strong> button.",
1856+
"question.unsubmitted changes_plural": "You have made changes to your answers but not submitted them. Please check your answers to each part and then press the <strong>Save all answers</strong> button.",
18541857
"question.score feedback.show": "Show feedback",
18551858
"question.score feedback.hide": "Hide feedback",
18561859
"question.score feedback.not marked": "Not marked",

0 commit comments

Comments
 (0)