diff --git a/tests/parts/part-tests.mjs b/tests/parts/part-tests.mjs
index cce7add37..6b9e4eea6 100644
--- a/tests/parts/part-tests.mjs
+++ b/tests/parts/part-tests.mjs
@@ -158,7 +158,7 @@ Numbas.queueScript('part_tests',['qunit','json','jme','localisation','parts/numb
var res = await mark_part(p,'1');
assert.ok(p.answered,'Part is answerd');
assert.equal(p.credit,1,'1 credit');
- assert.equal(p.markingFeedback[0].message,"Top marks!\n\nYou were awarded
1 mark.", 'Feedback message is "Top marks!" as set in script');
+ assert.equal(p.markingFeedback[0].message,"Top marks!", 'Feedback message is "Top marks!" as set in script');
});
QUnit.module('Stateful scope');
@@ -500,7 +500,7 @@ Numbas.queueScript('part_tests',['qunit','json','jme','localisation','parts/numb
"marks":1,
"unitTests": [
{"variables":[],"name":"t/t is incorrect","answer":{"valid":true,"value":"t/t"},"notes":[{"name":"mark","expected":{"value":"nothing","messages":["Your answer is incorrect."],"warnings":[],"error":"","valid":true,"credit":0}}]},
- {"variables":[],"name":"t/T is correct","answer":{"valid":true,"value":"t/T"},"notes":[{"name":"mark","expected":{"value":"nothing","messages":["Your answer is numerically correct.\n\nYou were awarded
1 mark."],"warnings":[],"error":"","valid":true,"credit":1}}]}
+ {"variables":[],"name":"t/T is correct","answer":{"valid":true,"value":"t/T"},"notes":[{"name":"mark","expected":{"value":"nothing","messages":["Your answer is numerically correct."],"warnings":[],"error":"","valid":true,"credit":1}}]}
],
"answer":"t/T",
"caseSensitive":true,
@@ -766,7 +766,7 @@ Numbas.queueScript('part_tests',['qunit','json','jme','localisation','parts/numb
var g = q.getPart('p1g0');
g.storeAnswer('1');
await submit_part(p);
- assert.equal(p.markingFeedback.map(f => f.message).join('\n'), "You must answer a) first.\nYou scored
0 marks for this part.");
+ assert.equal(p.markingFeedback.map(f => f.message).join('\n'), "You must answer a) first.");
done();
}
);
@@ -1171,7 +1171,8 @@ Numbas.queueScript('part_tests',['qunit','json','jme','localisation','parts/numb
{
"op": "add_credit",
"credit": 0.5,
- "message": "Your answer is correct.\n\nYou were awarded
0.5 marks.",
+ "message": "Your answer is correct.",
+ "credit_message": "You were awarded
0.5 marks.",
"reason": "correct",
"credit_change": "positive"
},
@@ -1188,12 +1189,6 @@ Numbas.queueScript('part_tests',['qunit','json','jme','localisation','parts/numb
"message": "Your answer is incorrect.",
"reason": "incorrect",
"credit_change": "negative"
- },
- {
- "op": "feedback",
- "format": "string",
- "message": "You scored
0.5 marks for this part.",
- "reason": undefined
}
]
assert.deepEqual(p0.markingFeedback,expected_feedback);
@@ -1436,7 +1431,7 @@ return new Promise(resolve => {
p.storeAnswer('2');
p.submit();
assert.equal(p.credit,0.5,'0.5 credit for alternative answer');
- assert.equal(p.markingFeedback[0].message,'
You wrote 2.
\n\nYou were awarded
0.5 marks.');
+ assert.equal(p.markingFeedback[0].message,'
You wrote 2.
');
}
);
@@ -1462,7 +1457,6 @@ return new Promise(resolve => {
p.storeAnswer('1');
p.submit();
assert.equal(p.credit,1,'1 credit for correct answer');
- assert.equal(p.markingFeedback[0].message,'You were awarded
1 mark.','Feedback says 1 mark awarded');
}
);
@@ -1496,13 +1490,13 @@ return new Promise(resolve => {
var p = q.parts[0];
p.storeAnswer('x');
p.submit();
- assert.equal(collect_feedback(p.markingFeedback),'Your answer is numerically correct.\n\nYou were awarded
1 mark.\nYou scored
1 mark for this part.');
+ assert.equal(collect_feedback(p.markingFeedback),'Your answer is numerically correct.');
p.storeAnswer('y');
p.submit();
- assert.equal(collect_feedback(p.markingFeedback),'
You wrote y
\n\nYou were awarded
0.5 marks.\nYou scored
0.5 marks for this part.');
+ assert.equal(collect_feedback(p.markingFeedback),'
You wrote y
');
p.storeAnswer('z');
p.submit();
- assert.equal(collect_feedback(p.markingFeedback),'Your answer is numerically correct.\n\nYou were awarded
0.5 marks.\n
You wrote z
\nYou scored
0.5 marks for this part.');
+ assert.equal(collect_feedback(p.markingFeedback),'Your answer is numerically correct.\n
You wrote z
');
}
);
@@ -2116,7 +2110,6 @@ next_actions:
"event: post-mark",
"event: post-markAdaptive",
"event: calculateScore",
- "event: markingComment",
"event: post-submit"
], 'submitting a correct answer');
assert.equal(part.credit,1);
@@ -2250,7 +2243,6 @@ pre_submit:
"event: post-mark",
"event: post-markAdaptive",
"event: calculateScore",
- "event: markingComment",
"event: post-submit",
"event: completed_pre_submit"
], 'once pre-submit tasks are done');
@@ -2296,7 +2288,6 @@ mark:
"event: post-mark",
"event: post-markAdaptive",
"event: calculateScore",
- "event: markingComment",
"event: post-submit"
]);
@@ -3051,4 +3042,72 @@ next_actions:
done();
});
+
+ QUnit.test('Resume a completed exam without review allowed',async function(assert) {
+ var done = assert.async();
+ var exam_def = {
+ name: "Exam",
+ question_groups: [
+ {
+ questions: [
+ {
+ name: "Q",
+ parts: [{type:'numberentry',minvalue:'1',maxvalue:'1',marks:1}]
+ }
+ ]
+ }
+ ],
+ feedback: {
+ enterreviewmodeimmediately: false,
+ }
+ };
+
+ const [run1,run2, run3] = await with_scorm(
+ async function() {
+ var e = Numbas.createExamFromJSON(exam_def,Numbas.store,false);
+ e.init();
+ await e.signals.on('ready');
+ e.begin();
+ const q = e.questionList[0];
+ const p = q.getPart('p0');
+ await mark_part(p,"1");
+ e.tryEnd();
+ assert.notOk(e.revealed, "The exam is not in review mode.");
+ },
+
+ async function(data, results, scorm) {
+ scorm.SetValue('numbas.review_allowed', 'false');
+ var e = Numbas.createExamFromJSON(exam_def,Numbas.store,false);
+ e.entry = 'review';
+ e.load();
+ e.end();
+ await e.signals.on('ready');
+ assert.notOk(e.revealed, "The exam is not in review mode.");
+ },
+
+ async function(data, results, scorm) {
+ scorm.SetValue('numbas.review_allowed', 'true');
+ var e = Numbas.createExamFromJSON(exam_def,Numbas.store,false);
+ e.entry = 'review';
+ e.load();
+ e.end();
+ await e.signals.on('ready');
+ assert.ok(e.revealed, "The exam is in review mode.");
+ },
+
+ async function(data, results, scorm) {
+ scorm.DeleteValue('numbas.review_allowed');
+ var e = Numbas.createExamFromJSON(exam_def,Numbas.store,false);
+ e.entry = 'review';
+ e.load();
+ e.end();
+ await e.signals.on('ready');
+ assert.ok(e.revealed, "The exam is in review mode.");
+ }
+ );
+
+
+ done();
+ });
+
});
diff --git a/tests/parts/part_unit_tests.mjs b/tests/parts/part_unit_tests.mjs
index a14421c78..faf3924cb 100644
--- a/tests/parts/part_unit_tests.mjs
+++ b/tests/parts/part_unit_tests.mjs
@@ -1,5 +1,5 @@
export const unit_test_exam =
// Numbas version: exam_results_page_options
-{"name": "Part unit tests", "extensions": [], "question_groups": [{"questions": [{"name": "Choose one from a list part", "tags": [], "metadata": {"description": "", "licence": "None specified"}, "statement": "", "advice": "", "rulesets": {}, "extensions": [], "variables": {}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": [], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "1_n_2", "useCustomName": false, "customName": "", "marks": 0, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [{"variables": [], "name": "Correct", "answer": {"valid": true, "value": [[true], [false], [false]], "empty": false}, "notes": [{"name": "mark", "expected": {"value": "nothing", "messages": ["You chose a correct answer.\n\nYou were awarded
1 mark."], "warnings": [], "error": "", "valid": true, "credit": 1}}]}, {"variables": [], "name": "Incorrect", "answer": {"valid": true, "value": [[false], [true], [false]], "empty": false}, "notes": [{"name": "mark", "expected": {"value": "nothing", "messages": ["You chose an incorrect answer."], "warnings": [], "error": "", "valid": true, "credit": 0}}]}], "minMarks": 0, "maxMarks": 0, "shuffleChoices": false, "displayType": "radiogroup", "displayColumns": 0, "showCellAnswerState": true, "choices": ["Choice 1", "Choice 2", "Choice 3"], "matrix": ["1", 0, 0], "distractors": ["", "", ""]}, {"type": "1_n_2", "useCustomName": false, "customName": "", "marks": 0, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [{"variables": [], "name": "Minimum score zero", "answer": {"valid": true, "value": [[false], [true], [false]], "empty": false}, "notes": [{"name": "mark", "expected": {"value": "nothing", "messages": ["You chose an incorrect answer.", "","
1 mark was taken away.","The minimum score for this part is
0."], "warnings": [], "error": "", "valid": true, "credit": 0}}]}], "minMarks": 0, "maxMarks": 0, "shuffleChoices": false, "displayType": "radiogroup", "displayColumns": 0, "showCellAnswerState": true, "choices": ["Choice 1", "Choice 2", "Choice 3"], "matrix": ["1", "-1", 0], "distractors": ["", "", ""]}, {"type": "1_n_2", "useCustomName": false, "customName": "", "marks": 0, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [{"variables": [], "name": "Correct", "answer": {"valid": true, "value": [[true], [false], [false]], "empty": false}, "notes": [{"name": "mark", "expected": {"value": "nothing", "messages": ["You chose a correct answer.\n\nYou were awarded
1 mark."], "warnings": [], "error": "", "valid": true, "credit": 1}}]}], "minMarks": 0, "maxMarks": 0, "shuffleChoices": false, "displayType": "radiogroup", "displayColumns": 0, "showCellAnswerState": true, "choices": "map(\"Choice \"+n,n,1..3)", "matrix": "[1,0,0]"}]}, {"name": "Choose several from a list part", "tags": [], "metadata": {"description": "", "licence": "None specified"}, "statement": "", "advice": "", "rulesets": {}, "extensions": [], "variables": {}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": [], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "m_n_2", "useCustomName": false, "customName": "", "marks": 0, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [{"variables": [], "name": "One correct choice", "answer": {"valid": true, "value": [[true], [false], [false], [false], [false]]}, "notes": [{"name": "mark", "expected": {"value": "nothing", "messages": ["You chose a correct answer.\n\nYou were awarded
1 mark."], "warnings": [], "error": "", "valid": true, "credit": 0.5}}]}, {"variables": [], "name": "Both correct choices", "answer": {"valid": true, "value": [[true], [true], [false], [false], [false]]}, "notes": [{"name": "mark", "expected": {"value": "nothing", "messages": ["You chose a correct answer.\n\nYou were awarded
1 mark.", "You chose a correct answer.\n\nYou were awarded
1 mark."], "warnings": [], "error": "", "valid": true, "credit": 1}}]}, {"variables": [], "name": "One correct, one incorrect", "answer": {"valid": true, "value": [[true], [false], [true], [false], [false]]}, "notes": [{"name": "mark", "expected": {"value": "nothing", "messages": ["You chose a correct answer.\n\nYou were awarded
1 mark.", "You chose an incorrect answer.\n\n
1 mark was taken away."], "warnings": [], "error": "", "valid": true, "credit": 0}}]}, {"variables": [], "name": "All but choice 2", "answer": {"valid": true, "value": [[true], [false], [true], [true], [true]]}, "notes": [{"name": "mark", "expected": {"value": "nothing", "messages": ["You chose a correct answer.\n\nYou were awarded
1 mark.\nYou chose an incorrect answer.\n\n
1 mark was taken away.\nYou chose an incorrect answer.\n\n
1 mark was taken away.\nYou chose an incorrect answer.\n\n
1 mark was taken away.\nThe minimum score for this part is
0."], "warnings": [], "error": "", "valid": true, "credit": 0}}]}], "minMarks": 0, "maxMarks": 0, "shuffleChoices": false, "displayType": "checkbox", "displayColumns": 0, "minAnswers": 0, "maxAnswers": 0, "warningType": "none", "showCellAnswerState": true, "choices": ["Choice 1", "Choice 2", "Choice 3", "Choice 4", "Choice 5"], "matrix": ["1", "1", "-1", "-1", "-1"], "distractors": ["", "", "", "", ""]}, {"type": "m_n_2", "useCustomName": false, "customName": "", "marks": 0, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [{"variables": [], "name": "First two choices", "answer": {"valid": true, "value": [[true], [true], [false], [false], [false]]}, "notes": [{"name": "mark", "expected": {"value": "nothing", "messages": ["You chose a correct answer.\n\nYou were awarded
1 mark.", "You chose a correct answer.\n\nYou were awarded
2 marks."], "warnings": [], "error": "", "valid": true, "credit": 0.6}}]}, {"variables": [], "name": "Choices 2 and 3", "answer": {"valid": true, "value": [[false], [true], [true], [false], [false]]}, "notes": [{"name": "mark", "expected": {"value": "nothing", "messages": ["You chose a correct answer.\n\nYou were awarded
2 marks.", "You chose a correct answer.\n\nYou were awarded
3 marks."], "warnings": [], "error": "", "valid": true, "credit": 1}}]}], "minMarks": 0, "maxMarks": 0, "shuffleChoices": false, "displayType": "checkbox", "displayColumns": 0, "minAnswers": 0, "maxAnswers": "2", "warningType": "prevent", "showCellAnswerState": true, "choices": ["Choice 1", "Choice 2", "Choice 3", "Choice 4", "Choice 5"], "matrix": ["1", "2", "3", "-1", "-1"], "distractors": ["", "", "", "", ""]}]}, {"name": "Match choices with answers part", "tags": [], "metadata": {"description": "", "licence": "None specified"}, "statement": "", "advice": "", "rulesets": {}, "extensions": [], "variables": {}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": [], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "m_n_x", "useCustomName": false, "customName": "", "marks": 0, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [{"variables": [], "name": "Both correct choices", "answer": {"valid": true, "value": [[true, false], [false, true]]}, "notes": [{"name": "mark", "expected": {"value": "nothing", "messages": ["You chose a correct answer.\n\nYou were awarded
1 mark.", "You chose a correct answer.\n\nYou were awarded
1 mark."], "warnings": [], "error": "", "valid": true, "credit": 1}}]}, {"variables": [], "name": "One right, one wrong", "answer": {"valid": true, "value": [[true, true], [false, false]]}, "notes": [{"name": "mark", "expected": {"value": "nothing", "messages": ["You chose a correct answer.\n\nYou were awarded
1 mark.", "You chose an incorrect answer.\n\n
1 mark was taken away."], "warnings": [], "error": "", "valid": true, "credit": 0}}]}, {"variables": [], "name": "Both wrong", "answer": {"valid": true, "value": [[false, true], [true, false]]}, "notes": [{"name": "mark", "expected": {"value": "nothing", "messages": ["You chose an incorrect answer.\n\n
1 mark was taken away.\nYou chose an incorrect answer.\n\n
1 mark was taken away.\nThe minimum score for this part is
0."], "warnings": [], "error": "", "valid": true, "credit": 0}}]}], "minMarks": 0, "maxMarks": 0, "minAnswers": 0, "maxAnswers": 0, "shuffleChoices": false, "shuffleAnswers": false, "displayType": "radiogroup", "warningType": "none", "showCellAnswerState": true, "choices": ["Choice 1", "Choice 2"], "matrix": [["1 ", "-1"], ["-1", "1"]], "layout": {"type": "all", "expression": ""}, "answers": ["Answer 1", "Answer 2"]}, {"type": "m_n_x", "useCustomName": false, "customName": "", "marks": 0, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [{"variables": [], "name": "All correct answers", "answer": {"valid": true, "value": [[true, true], [true, false]]}, "notes": [{"name": "mark", "expected": {"value": "nothing", "messages": ["You chose a correct answer.\n\nYou were awarded
1 mark.", "You chose a correct answer.\n\nYou were awarded
1 mark.", "You chose a correct answer.\n\nYou were awarded
1 mark."], "warnings": [], "error": "", "valid": true, "credit": 1}}]}, {"variables": [], "name": "Incorrect answer", "answer": {"valid": true, "value": [[false, true], [true, true]]}, "notes": [{"name": "mark", "expected": {"value": "nothing", "messages": ["You chose a correct answer.\n\nYou were awarded
1 mark.\nYou chose a correct answer.\n\nYou were awarded
1 mark.\nYou chose an incorrect answer.\n\n
3 marks were taken away.\nThe minimum score for this part is
0."], "warnings": [], "error": "", "valid": true, "credit": 0}}]}], "minMarks": 0, "maxMarks": 0, "minAnswers": 0, "maxAnswers": 0, "shuffleChoices": false, "shuffleAnswers": false, "displayType": "checkbox", "warningType": "none", "showCellAnswerState": true, "choices": ["Choice 1", "Choice 2"], "matrix": [["1", "1"], ["1", "-3"]], "layout": {"type": "all", "expression": ""}, "answers": ["Answer 1", "Answer 2"]}, {"type": "m_n_x", "useCustomName": false, "customName": "", "marks": 0, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [{"variables": [], "name": "All correct answers", "answer": {"valid": true, "value": [[true, false, false], [true, true, false], [true, true, true]]}, "notes": [{"name": "mark", "expected": {"value": "nothing", "messages": ["You chose a correct answer.\n\nYou were awarded
1 mark.", "You chose a correct answer.\n\nYou were awarded
1 mark.", "You chose a correct answer.\n\nYou were awarded
1 mark.", "You chose a correct answer.\n\nYou were awarded
1 mark.", "You chose a correct answer.\n\nYou were awarded
1 mark.", "You chose a correct answer.\n\nYou were awarded
1 mark.", "The maximum score for this part is
3."], "warnings": [], "error": "", "valid": true, "credit": 1}}]}], "minMarks": 0, "maxMarks": "3", "minAnswers": 0, "maxAnswers": 0, "shuffleChoices": false, "shuffleAnswers": false, "displayType": "checkbox", "warningType": "none", "showCellAnswerState": true, "choices": ["Choice 1", "Choice 2", "Choice 3"], "matrix": [["1", "1", "1"], ["1", "1", "1"], ["1", "1", "1"]], "layout": {"type": "uppertriangle", "expression": ""}, "answers": ["Answer 1", "Answer 2", "Answer 3"]}]}, {"name": "Match text pattern part", "tags": [], "metadata": {"description": "", "licence": "None specified"}, "statement": "", "advice": "", "rulesets": {}, "extensions": [], "variables": {}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": [], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "patternmatch", "useCustomName": false, "customName": "", "marks": 1, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [{"variables": [], "name": "\"thing!\" is correct", "answer": {"valid": true, "value": "thing!", "empty": false}, "notes": [{"name": "mark", "expected": {"value": "true", "messages": ["Your answer is correct.\n\nYou were awarded
1 mark."], "warnings": [], "error": "", "valid": true, "credit": 1}}]}, {"variables": [], "name": "\"THING!\" is correct", "answer": {"valid": true, "value": "THING!", "empty": false}, "notes": [{"name": "mark", "expected": {"value": "true", "messages": ["Your answer is correct.\n\nYou were awarded
1 mark."], "warnings": [], "error": "", "valid": true, "credit": 1}}]}], "answer": "thing!", "displayAnswer": "thing!", "matchMode": "exact"}, {"type": "patternmatch", "useCustomName": false, "customName": "", "marks": 1, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [{"variables": [], "name": "\"thing!\" is correct", "answer": {"valid": true, "value": "thing!", "empty": false}, "notes": [{"name": "mark", "expected": {"value": "true", "messages": ["Your answer is correct.\n\nYou were awarded
1 mark."], "warnings": [], "error": "", "valid": true, "credit": 1}}]}, {"variables": [], "name": "\"THING!\" is correct except for case", "answer": {"valid": true, "value": "THING!", "empty": false}, "notes": [{"name": "mark", "expected": {"value": "0.5", "messages": ["Your answer is correct, except for the case.\n\nYou were awarded
0.5 marks."], "warnings": [], "error": "", "valid": true, "credit": 0.5}}]}], "answer": "thing!", "displayAnswer": "thing!", "caseSensitive": true, "partialCredit": "50", "matchMode": "exact"}, {"type": "patternmatch", "useCustomName": false, "customName": "", "marks": 1, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [{"variables": [], "name": "\"two words\" is correct", "answer": {"valid": true, "value": "two words", "empty": false}, "notes": [{"name": "mark", "expected": {"value": "true", "messages": ["Your answer is correct.\n\nYou were awarded
1 mark."], "warnings": [], "error": "", "valid": true, "credit": 1}}]}, {"variables": [], "name": "\"this thing!\" is incorrect", "answer": {"valid": true, "value": "this thing!", "empty": false}, "notes": [{"name": "mark", "expected": {"value": "false", "messages": ["Your answer is incorrect."], "warnings": [], "error": "", "valid": true, "credit": 0}}]}], "answer": "\\w+ \\w+", "displayAnswer": "hello there", "matchMode": "regex"}]}, {"name": "Mathematical expression part", "tags": [], "metadata": {"description": "", "licence": "None specified"}, "statement": "", "advice": "", "rulesets": {}, "extensions": [], "variables": {}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": [], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "jme", "useCustomName": false, "customName": "", "marks": 1, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [{"variables": [], "name": "x is correct", "answer": {"valid": true, "value": "x"}, "notes": [{"name": "mark", "expected": {"value": "nothing", "messages": ["Your answer is numerically correct.\n\nYou were awarded
1 mark."], "warnings": [], "error": "", "valid": true, "credit": 1}}]}, {"variables": [], "name": "y is incorrect", "answer": {"valid": true, "value": "y"}, "notes": [{"name": "mark", "expected": {"value": "nothing", "messages": ["Your answer is incorrect."], "warnings": [], "error": "", "valid": true, "credit": 0}}]}, {"variables": [], "name": "x+0 is correct", "answer": {"valid": true, "value": "x+0"}, "notes": [{"name": "mark", "expected": {"value": "nothing", "messages": ["Your answer is numerically correct.\n\nYou were awarded
1 mark."], "warnings": [], "error": "", "valid": true, "credit": 1}}]}, {"variables": [], "name": "x+0*y is correct", "answer": {"valid": true, "value": "x+0y"}, "notes": [{"name": "mark", "expected": {"value": "nothing", "messages": ["Your answer is numerically correct.\n\nYou were awarded
1 mark."], "warnings": [], "error": "", "valid": true, "credit": 1}}]}], "answer": "x", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "valuegenerators": [{"name": "x", "value": ""}]}, {"type": "jme", "useCustomName": false, "customName": "", "marks": 1, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [{"variables": [], "name": "2x is correct", "answer": {"valid": true, "value": "2x"}, "notes": [{"name": "mark", "expected": {"value": "nothing", "messages": ["Your answer is numerically correct.\n\nYou were awarded
1 mark."], "warnings": [], "error": "", "valid": true, "credit": 1}}]}, {"variables": [], "name": "x+x gets a penalty", "answer": {"valid": true, "value": "x+x"}, "notes": [{"name": "mark", "expected": {"value": "nothing", "messages": ["Your answer is numerically correct.\n\nYou were awarded
1 mark.", "Your answer is not in the expected form: Should be number times x\n\n
0.5 marks were taken away."], "warnings": [], "error": "", "valid": true, "credit": 0.5}}]}, {"variables": [], "name": "3x is wrong", "answer": {"valid": true, "value": "3x"}, "notes": [{"name": "mark", "expected": {"value": "nothing", "messages": ["Your answer is incorrect."], "warnings": [], "error": "", "valid": true, "credit": 0}}]}, {"variables": [], "name": "x+x+x is wrong and gets warning", "answer": {"valid": true, "value": "x+x+x"}, "notes": [{"name": "mark", "expected": {"value": "nothing", "messages": ["Your answer is incorrect.", "Your answer is not in the expected form: Should be number times x"], "warnings": [], "error": "", "valid": true, "credit": 0}}]}], "answer": "2x", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "mustmatchpattern": {"pattern": "$n*x", "partialCredit": "50", "message": "Should be number times x", "nameToCompare": ""}, "valuegenerators": [{"name": "x", "value": ""}]}, {"type": "jme", "useCustomName": false, "customName": "", "marks": 1, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [{"variables": [], "name": "x
1 mark."], "warnings": [], "error": "", "valid": true, "credit": 1}}]}, {"variables": [], "name": "x-y<0 is correct", "answer": {"valid": true, "value": "x-y<0"}, "notes": [{"name": "mark", "expected": {"value": "nothing", "messages": ["Your answer is numerically correct.\n\nYou were awarded 1 mark."], "warnings": [], "error": "", "valid": true, "credit": 1}}]}, {"variables": [], "name": "x=y is incorrect", "answer": {"valid": true, "value": "x=y"}, "notes": [{"name": "mark", "expected": {"value": "nothing", "messages": ["Your answer is incorrect."], "warnings": [], "error": "", "valid": true, "credit": 0}}]}, {"variables": [], "name": "y>x is correct", "answer": {"valid": true, "value": "y>x"}, "notes": [{"name": "mark", "expected": {"value": "nothing", "messages": ["Your answer is numerically correct.\n\nYou were awarded 1 mark."], "warnings": [], "error": "", "valid": true, "credit": 1}}]}], "answer": "x1 mark."], "warnings": [], "error": "", "valid": true, "credit": 1}}]}], "answer": "y=x^2+2", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "valuegenerators": [{"name": "x", "value": ""}, {"name": "y", "value": ""}]}]}, {"name": "Matrix entry part", "tags": [], "metadata": {"description": "", "licence": "None specified"}, "statement": "", "advice": "", "rulesets": {}, "extensions": [], "variables": {}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": [], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "matrix", "useCustomName": false, "customName": "", "marks": 1, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [{"variables": [], "name": "Correct", "answer": {"valid": true, "value": [["1", "2", "3"], ["4", "5", "6"]]}, "notes": [{"name": "mark", "expected": {"value": "nothing", "messages": ["Your answer is correct.\n\nYou were awarded 1 mark."], "warnings": [], "error": "", "valid": true, "credit": 1}}]}, {"variables": [], "name": "Wrong size", "answer": {"valid": true, "value": [["1", "2"], ["3", "4"]]}, "notes": [{"name": "wrong_size", "expected": {"value": "true", "messages": ["Your answer is incorrect."], "warnings": [], "error": "", "valid": true, "credit": 0}}, {"name": "mark", "expected": {"value": "nothing", "messages": ["Your answer is incorrect."], "warnings": [], "error": "", "valid": true, "credit": 0}}]}], "correctAnswer": "matrix([1,2,3],[4,5,6])", "correctAnswerFractions": false, "numRows": "2", "numColumns": "3", "allowResize": true, "tolerance": 0, "markPerCell": false, "allowFractions": false}, {"type": "matrix", "useCustomName": false, "customName": "", "marks": 1, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [{"variables": [], "name": "correct", "answer": {"valid": true, "value": [["1/3", "0"], ["0", "1/3"]]}, "notes": [{"name": "mark", "expected": {"value": "nothing", "messages": ["Your answer is correct.\n\nYou were awarded 1 mark."], "warnings": [], "error": "", "valid": true, "credit": 1}}]}, {"variables": [], "name": "2/6", "answer": {"valid": true, "value": [["2/6", "0"], ["0", "2/6"]]}, "notes": [{"name": "mark", "expected": {"value": "nothing", "messages": ["Your answer is correct.\n\nYou were awarded 1 mark."], "warnings": [], "error": "", "valid": true, "credit": 1}}]}], "correctAnswer": "id(2)/3", "correctAnswerFractions": false, "numRows": "2", "numColumns": "2", "allowResize": true, "tolerance": 0, "markPerCell": false, "allowFractions": true}, {"type": "matrix", "useCustomName": false, "customName": "", "marks": 1, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [{"variables": [], "name": "Correct", "answer": {"valid": true, "value": [["0.71", "0.29"], ["0.57", "0.14"]]}, "notes": [{"name": "mark", "expected": {"value": "nothing", "messages": ["Your answer is correct.\n\nYou were awarded 1 mark."], "warnings": [], "error": "", "valid": true, "credit": 1}}]}], "correctAnswer": "matrix([5,2],[4,1])/7", "correctAnswerFractions": false, "numRows": "2", "numColumns": "2", "allowResize": false, "tolerance": 0, "markPerCell": false, "allowFractions": false, "precisionType": "dp", "precision": "2", "precisionPartialCredit": "50", "precisionMessage": "You have not given your answer to the correct precision.", "strictPrecision": true}, {"type": "matrix", "useCustomName": false, "customName": "", "marks": 1, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [{"variables": [], "name": "0.5 off still correct", "answer": {"valid": true, "value": [["0.5", "0.5"], ["1.5", "1.5"]]}, "notes": [{"name": "mark", "expected": {"value": "nothing", "messages": ["Your answer is correct.\n\nYou were awarded 1 mark."], "warnings": [], "error": "", "valid": true, "credit": 1}}]}, {"variables": [], "name": "0 incorrect", "answer": {"valid": true, "value": [["1", "1"], ["1", "0"]]}, "notes": [{"name": "mark", "expected": {"value": "nothing", "messages": ["Your answer is incorrect."], "warnings": [], "error": "", "valid": true, "credit": 0}}]}, {"variables": [], "name": "A variety of errors within tolerance", "answer": {"valid": true, "value": [["1.1", "1.2"], ["0.7", "0.9"]]}, "notes": [{"name": "mark", "expected": {"value": "nothing", "messages": ["Your answer is correct.\n\nYou were awarded 1 mark."], "warnings": [], "error": "", "valid": true, "credit": 1}}]}], "correctAnswer": "matrix([1,1],[1,1])", "correctAnswerFractions": false, "numRows": "2", "numColumns": "2", "allowResize": true, "tolerance": "0.5", "markPerCell": false, "allowFractions": false}, {"type": "matrix", "useCustomName": false, "customName": "", "marks": 1, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [{"variables": [], "name": "Correct", "answer": {"valid": true, "value": [["1", "2"], ["3", "4"]]}, "notes": [{"name": "mark", "expected": {"value": "nothing", "messages": ["Your answer is correct.\n\nYou were awarded 1 mark."], "warnings": [], "error": "", "valid": true, "credit": 1}}]}, {"variables": [], "name": "One incorrect cell", "answer": {"valid": true, "value": [["1", "2"], ["3", "3"]]}, "notes": [{"name": "mark", "expected": {"value": "nothing", "messages": ["One or more of the cells in your answer is incorrect, but you have been awarded marks for the rest.\n\nYou were awarded 0.75 marks."], "warnings": [], "error": "", "valid": true, "credit": 0.75}}]}], "correctAnswer": "matrix([1,2],[3,4])", "correctAnswerFractions": false, "numRows": "2", "numColumns": "2", "allowResize": true, "tolerance": 0, "markPerCell": true, "allowFractions": false}]}, {"name": "Number entry part", "tags": [], "metadata": {"description": "", "licence": "None specified"}, "statement": "", "advice": "", "rulesets": {}, "extensions": [], "variables": {"sqrt2": {"name": "sqrt2", "group": "Ungrouped variables", "definition": "sqrt(dec(2))", "description": "", "templateType": "anything"}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["sqrt2"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [{"variables": [], "name": "1 is correct", "answer": {"valid": true, "value": "1", "empty": false}, "notes": [{"name": "mark", "expected": {"value": "nothing", "messages": ["Your answer is correct.\n\nYou were awarded 1 mark."], "warnings": [], "error": "", "valid": true, "credit": 1}}]}, {"variables": [], "name": "0 is incorrect", "answer": {"valid": true, "value": "0", "empty": false}, "notes": [{"name": "mark", "expected": {"value": "nothing", "messages": ["Your answer is incorrect."], "warnings": [], "error": "", "valid": true, "credit": 0}}]}], "minValue": "1", "maxValue": "1", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [{"variables": [], "name": "3.14 is correct", "answer": {"valid": true, "value": "3.14", "empty": false}, "notes": [{"name": "mark", "expected": {"value": "nothing", "messages": ["Your answer is correct.\n\nYou were awarded 1 mark."], "warnings": [], "error": "", "valid": true, "credit": 1}}]}, {"variables": [], "name": "3.140 is incorrect", "answer": {"valid": true, "value": "3.140", "empty": false}, "notes": [{"name": "mark", "expected": {"value": "nothing", "messages": ["Your answer is incorrect."], "warnings": [], "error": "", "valid": true, "credit": 0}}]}], "minValue": "pi", "maxValue": "pi", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "precisionType": "dp", "precision": "2", "precisionPartialCredit": 0, "precisionMessage": "You have not given your answer to the correct precision.", "strictPrecision": true, "showPrecisionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [{"variables": [], "name": "1.2 is incorrect", "answer": {"valid": true, "value": "1.2", "empty": false}, "notes": [{"name": "mark", "expected": {"value": "nothing", "messages": ["Your answer is correct.\n\nYou were awarded 1 mark.", "You have not given your answer to the correct precision.\n\n1 mark was taken away."], "warnings": [], "error": "", "valid": true, "credit": 0}}]}, {"variables": [], "name": "1.20 is correct", "answer": {"valid": true, "value": "1.20", "empty": false}, "notes": [{"name": "mark", "expected": {"value": "nothing", "messages": ["Your answer is correct.\n\nYou were awarded 1 mark."], "warnings": [], "error": "", "valid": true, "credit": 1}}]}], "minValue": "1.2", "maxValue": "1.2", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "precisionType": "dp", "precision": "2", "precisionPartialCredit": 0, "precisionMessage": "You have not given your answer to the correct precision.", "strictPrecision": true, "showPrecisionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [{"variables": [], "name": "1 234,5 is correct", "answer": {"valid": true, "value": "1 234,5", "empty": false}, "notes": [{"name": "mark", "expected": {"value": "nothing", "messages": ["Your answer is correct.\n\nYou were awarded 1 mark."], "warnings": [], "error": "", "valid": true, "credit": 1}}]}], "minValue": "1234.5", "maxValue": "1234.5", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["si-fr"], "correctAnswerStyle": "si-fr"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [{"variables": [], "name": "6/7 is correct", "answer": {"valid": true, "value": "6/7", "empty": false}, "notes": [{"name": "mark", "expected": {"value": "nothing", "messages": ["Your answer is correct.\n\nYou were awarded 1 mark."], "warnings": [], "error": "", "valid": true, "credit": 1}}]}, {"variables": [], "name": "12/14 gets partial credit", "answer": {"valid": true, "value": "12/14", "empty": false}, "notes": [{"name": "mark", "expected": {"value": "nothing", "messages": ["Your answer is correct.\n\nYou were awarded 1 mark.", "Your answer is not reduced to lowest terms.\n\n0.5 marks were taken away."], "warnings": [], "error": "", "valid": true, "credit": 0.5}}]}], "minValue": "6/7", "maxValue": "6/7", "correctAnswerFraction": false, "allowFractions": true, "mustBeReduced": true, "mustBeReducedPC": "50", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [{"variables": [{"name": "sqrt2", "value": "dec(\"1.41421356237309504880168872420969807857e+0\")"}], "name": "1.414213562373095", "answer": {"valid": true, "value": "1.414213562373095", "empty": false}, "notes": [{"name": "mark", "expected": {"value": "nothing", "messages": ["Your answer is correct.\n\nYou were awarded 1 mark."], "warnings": [], "error": "", "valid": true, "credit": 1}}]}], "minValue": "sqrt2", "maxValue": "sqrt2", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "precisionType": "dp", "precision": "15", "precisionPartialCredit": 0, "precisionMessage": "You have not given your answer to the correct precision.", "strictPrecision": true, "showPrecisionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}]}]}]};
+{"name": "Part unit tests", "extensions": [], "question_groups": [{"questions": [{"name": "Choose one from a list part", "tags": [], "metadata": {"description": "", "licence": "None specified"}, "statement": "", "advice": "", "rulesets": {}, "extensions": [], "variables": {}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": [], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "1_n_2", "useCustomName": false, "customName": "", "marks": 0, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [{"variables": [], "name": "Correct", "answer": {"valid": true, "value": [[true], [false], [false]], "empty": false}, "notes": [{"name": "mark", "expected": {"value": "nothing", "messages": ["You chose a correct answer."], "warnings": [], "error": "", "valid": true, "credit": 1}}]}, {"variables": [], "name": "Incorrect", "answer": {"valid": true, "value": [[false], [true], [false]], "empty": false}, "notes": [{"name": "mark", "expected": {"value": "nothing", "messages": ["You chose an incorrect answer."], "warnings": [], "error": "", "valid": true, "credit": 0}}]}], "minMarks": 0, "maxMarks": 0, "shuffleChoices": false, "displayType": "radiogroup", "displayColumns": 0, "showCellAnswerState": true, "choices": ["Choice 1", "Choice 2", "Choice 3"], "matrix": ["1", 0, 0], "distractors": ["", "", ""]}, {"type": "1_n_2", "useCustomName": false, "customName": "", "marks": 0, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [{"variables": [], "name": "Minimum score zero", "answer": {"valid": true, "value": [[false], [true], [false]], "empty": false}, "notes": [{"name": "mark", "expected": {"value": "nothing", "messages": ["You chose an incorrect answer.", "The minimum score for this part is 0."], "warnings": [], "error": "", "valid": true, "credit": 0}}]}], "minMarks": 0, "maxMarks": 0, "shuffleChoices": false, "displayType": "radiogroup", "displayColumns": 0, "showCellAnswerState": true, "choices": ["Choice 1", "Choice 2", "Choice 3"], "matrix": ["1", "-1", 0], "distractors": ["", "", ""]}, {"type": "1_n_2", "useCustomName": false, "customName": "", "marks": 0, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [{"variables": [], "name": "Correct", "answer": {"valid": true, "value": [[true], [false], [false]], "empty": false}, "notes": [{"name": "mark", "expected": {"value": "nothing", "messages": ["You chose a correct answer."], "warnings": [], "error": "", "valid": true, "credit": 1}}]}], "minMarks": 0, "maxMarks": 0, "shuffleChoices": false, "displayType": "radiogroup", "displayColumns": 0, "showCellAnswerState": true, "choices": "map(\"Choice \"+n,n,1..3)", "matrix": "[1,0,0]"}]}, {"name": "Choose several from a list part", "tags": [], "metadata": {"description": "", "licence": "None specified"}, "statement": "", "advice": "", "rulesets": {}, "extensions": [], "variables": {}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": [], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "m_n_2", "useCustomName": false, "customName": "", "marks": 0, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [{"variables": [], "name": "One correct choice", "answer": {"valid": true, "value": [[true], [false], [false], [false], [false]]}, "notes": [{"name": "mark", "expected": {"value": "nothing", "messages": ["You chose a correct answer."], "warnings": [], "error": "", "valid": true, "credit": 0.5}}]}, {"variables": [], "name": "Both correct choices", "answer": {"valid": true, "value": [[true], [true], [false], [false], [false]]}, "notes": [{"name": "mark", "expected": {"value": "nothing", "messages": ["You chose a correct answer.", "You chose a correct answer."], "warnings": [], "error": "", "valid": true, "credit": 1}}]}, {"variables": [], "name": "One correct, one incorrect", "answer": {"valid": true, "value": [[true], [false], [true], [false], [false]]}, "notes": [{"name": "mark", "expected": {"value": "nothing", "messages": ["You chose a correct answer.", "You chose an incorrect answer."], "warnings": [], "error": "", "valid": true, "credit": 0}}]}, {"variables": [], "name": "All but choice 2", "answer": {"valid": true, "value": [[true], [false], [true], [true], [true]]}, "notes": [{"name": "mark", "expected": {"value": "nothing", "messages": ["You chose a correct answer.\nYou chose an incorrect answer.\nYou chose an incorrect answer.\nYou chose an incorrect answer.\nThe minimum score for this part is 0."], "warnings": [], "error": "", "valid": true, "credit": 0}}]}], "minMarks": 0, "maxMarks": 0, "shuffleChoices": false, "displayType": "checkbox", "displayColumns": 0, "minAnswers": 0, "maxAnswers": 0, "warningType": "none", "showCellAnswerState": true, "choices": ["Choice 1", "Choice 2", "Choice 3", "Choice 4", "Choice 5"], "matrix": ["1", "1", "-1", "-1", "-1"], "distractors": ["", "", "", "", ""]}, {"type": "m_n_2", "useCustomName": false, "customName": "", "marks": 0, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [{"variables": [], "name": "First two choices", "answer": {"valid": true, "value": [[true], [true], [false], [false], [false]]}, "notes": [{"name": "mark", "expected": {"value": "nothing", "messages": ["You chose a correct answer.", "You chose a correct answer."], "warnings": [], "error": "", "valid": true, "credit": 0.6}}]}, {"variables": [], "name": "Choices 2 and 3", "answer": {"valid": true, "value": [[false], [true], [true], [false], [false]]}, "notes": [{"name": "mark", "expected": {"value": "nothing", "messages": ["You chose a correct answer.", "You chose a correct answer."], "warnings": [], "error": "", "valid": true, "credit": 1}}]}], "minMarks": 0, "maxMarks": 0, "shuffleChoices": false, "displayType": "checkbox", "displayColumns": 0, "minAnswers": 0, "maxAnswers": "2", "warningType": "prevent", "showCellAnswerState": true, "choices": ["Choice 1", "Choice 2", "Choice 3", "Choice 4", "Choice 5"], "matrix": ["1", "2", "3", "-1", "-1"], "distractors": ["", "", "", "", ""]}]}, {"name": "Match choices with answers part", "tags": [], "metadata": {"description": "", "licence": "None specified"}, "statement": "", "advice": "", "rulesets": {}, "extensions": [], "variables": {}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": [], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "m_n_x", "useCustomName": false, "customName": "", "marks": 0, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [{"variables": [], "name": "Both correct choices", "answer": {"valid": true, "value": [[true, false], [false, true]]}, "notes": [{"name": "mark", "expected": {"value": "nothing", "messages": ["You chose a correct answer.", "You chose a correct answer."], "warnings": [], "error": "", "valid": true, "credit": 1}}]}, {"variables": [], "name": "One right, one wrong", "answer": {"valid": true, "value": [[true, true], [false, false]]}, "notes": [{"name": "mark", "expected": {"value": "nothing", "messages": ["You chose a correct answer.", "You chose an incorrect answer."], "warnings": [], "error": "", "valid": true, "credit": 0}}]}, {"variables": [], "name": "Both wrong", "answer": {"valid": true, "value": [[false, true], [true, false]]}, "notes": [{"name": "mark", "expected": {"value": "nothing", "messages": ["You chose an incorrect answer.\nYou chose an incorrect answer.\nThe minimum score for this part is 0."], "warnings": [], "error": "", "valid": true, "credit": 0}}]}], "minMarks": 0, "maxMarks": 0, "minAnswers": 0, "maxAnswers": 0, "shuffleChoices": false, "shuffleAnswers": false, "displayType": "radiogroup", "warningType": "none", "showCellAnswerState": true, "choices": ["Choice 1", "Choice 2"], "matrix": [["1 ", "-1"], ["-1", "1"]], "layout": {"type": "all", "expression": ""}, "answers": ["Answer 1", "Answer 2"]}, {"type": "m_n_x", "useCustomName": false, "customName": "", "marks": 0, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [{"variables": [], "name": "All correct answers", "answer": {"valid": true, "value": [[true, true], [true, false]]}, "notes": [{"name": "mark", "expected": {"value": "nothing", "messages": ["You chose a correct answer.", "You chose a correct answer.", "You chose a correct answer."], "warnings": [], "error": "", "valid": true, "credit": 1}}]}, {"variables": [], "name": "Incorrect answer", "answer": {"valid": true, "value": [[false, true], [true, true]]}, "notes": [{"name": "mark", "expected": {"value": "nothing", "messages": ["You chose a correct answer.\nYou chose a correct answer.\nYou chose an incorrect answer.\nThe minimum score for this part is 0."], "warnings": [], "error": "", "valid": true, "credit": 0}}]}], "minMarks": 0, "maxMarks": 0, "minAnswers": 0, "maxAnswers": 0, "shuffleChoices": false, "shuffleAnswers": false, "displayType": "checkbox", "warningType": "none", "showCellAnswerState": true, "choices": ["Choice 1", "Choice 2"], "matrix": [["1", "1"], ["1", "-3"]], "layout": {"type": "all", "expression": ""}, "answers": ["Answer 1", "Answer 2"]}, {"type": "m_n_x", "useCustomName": false, "customName": "", "marks": 0, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [{"variables": [], "name": "All correct answers", "answer": {"valid": true, "value": [[true, false, false], [true, true, false], [true, true, true]]}, "notes": [{"name": "mark", "expected": {"value": "nothing", "messages": ["You chose a correct answer.", "You chose a correct answer.", "You chose a correct answer.", "You chose a correct answer.", "You chose a correct answer.", "You chose a correct answer.", "The maximum score for this part is 3."], "warnings": [], "error": "", "valid": true, "credit": 1}}]}], "minMarks": 0, "maxMarks": "3", "minAnswers": 0, "maxAnswers": 0, "shuffleChoices": false, "shuffleAnswers": false, "displayType": "checkbox", "warningType": "none", "showCellAnswerState": true, "choices": ["Choice 1", "Choice 2", "Choice 3"], "matrix": [["1", "1", "1"], ["1", "1", "1"], ["1", "1", "1"]], "layout": {"type": "uppertriangle", "expression": ""}, "answers": ["Answer 1", "Answer 2", "Answer 3"]}]}, {"name": "Match text pattern part", "tags": [], "metadata": {"description": "", "licence": "None specified"}, "statement": "", "advice": "", "rulesets": {}, "extensions": [], "variables": {}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": [], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "patternmatch", "useCustomName": false, "customName": "", "marks": 1, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [{"variables": [], "name": "\"thing!\" is correct", "answer": {"valid": true, "value": "thing!", "empty": false}, "notes": [{"name": "mark", "expected": {"value": "true", "messages": ["Your answer is correct."], "warnings": [], "error": "", "valid": true, "credit": 1}}]}, {"variables": [], "name": "\"THING!\" is correct", "answer": {"valid": true, "value": "THING!", "empty": false}, "notes": [{"name": "mark", "expected": {"value": "true", "messages": ["Your answer is correct."], "warnings": [], "error": "", "valid": true, "credit": 1}}]}], "answer": "thing!", "displayAnswer": "thing!", "matchMode": "exact"}, {"type": "patternmatch", "useCustomName": false, "customName": "", "marks": 1, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [{"variables": [], "name": "\"thing!\" is correct", "answer": {"valid": true, "value": "thing!", "empty": false}, "notes": [{"name": "mark", "expected": {"value": "true", "messages": ["Your answer is correct."], "warnings": [], "error": "", "valid": true, "credit": 1}}]}, {"variables": [], "name": "\"THING!\" is correct except for case", "answer": {"valid": true, "value": "THING!", "empty": false}, "notes": [{"name": "mark", "expected": {"value": "0.5", "messages": ["Your answer is correct, except for the case."], "warnings": [], "error": "", "valid": true, "credit": 0.5}}]}], "answer": "thing!", "displayAnswer": "thing!", "caseSensitive": true, "partialCredit": "50", "matchMode": "exact"}, {"type": "patternmatch", "useCustomName": false, "customName": "", "marks": 1, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [{"variables": [], "name": "\"two words\" is correct", "answer": {"valid": true, "value": "two words", "empty": false}, "notes": [{"name": "mark", "expected": {"value": "true", "messages": ["Your answer is correct."], "warnings": [], "error": "", "valid": true, "credit": 1}}]}, {"variables": [], "name": "\"this thing!\" is incorrect", "answer": {"valid": true, "value": "this thing!", "empty": false}, "notes": [{"name": "mark", "expected": {"value": "false", "messages": ["Your answer is incorrect."], "warnings": [], "error": "", "valid": true, "credit": 0}}]}], "answer": "\\w+ \\w+", "displayAnswer": "hello there", "matchMode": "regex"}]}, {"name": "Mathematical expression part", "tags": [], "metadata": {"description": "", "licence": "None specified"}, "statement": "", "advice": "", "rulesets": {}, "extensions": [], "variables": {}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": [], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "jme", "useCustomName": false, "customName": "", "marks": 1, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [{"variables": [], "name": "x is correct", "answer": {"valid": true, "value": "x"}, "notes": [{"name": "mark", "expected": {"value": "nothing", "messages": ["Your answer is numerically correct."], "warnings": [], "error": "", "valid": true, "credit": 1}}]}, {"variables": [], "name": "y is incorrect", "answer": {"valid": true, "value": "y"}, "notes": [{"name": "mark", "expected": {"value": "nothing", "messages": ["Your answer is incorrect."], "warnings": [], "error": "", "valid": true, "credit": 0}}]}, {"variables": [], "name": "x+0 is correct", "answer": {"valid": true, "value": "x+0"}, "notes": [{"name": "mark", "expected": {"value": "nothing", "messages": ["Your answer is numerically correct."], "warnings": [], "error": "", "valid": true, "credit": 1}}]}, {"variables": [], "name": "x+0*y is correct", "answer": {"valid": true, "value": "x+0y"}, "notes": [{"name": "mark", "expected": {"value": "nothing", "messages": ["Your answer is numerically correct."], "warnings": [], "error": "", "valid": true, "credit": 1}}]}], "answer": "x", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "valuegenerators": [{"name": "x", "value": ""}]}, {"type": "jme", "useCustomName": false, "customName": "", "marks": 1, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [{"variables": [], "name": "2x is correct", "answer": {"valid": true, "value": "2x"}, "notes": [{"name": "mark", "expected": {"value": "nothing", "messages": ["Your answer is numerically correct."], "warnings": [], "error": "", "valid": true, "credit": 1}}]}, {"variables": [], "name": "x+x gets a penalty", "answer": {"valid": true, "value": "x+x"}, "notes": [{"name": "mark", "expected": {"value": "nothing", "messages": ["Your answer is numerically correct.", "Your answer is not in the expected form: Should be number times x"], "warnings": [], "error": "", "valid": true, "credit": 0.5}}]}, {"variables": [], "name": "3x is wrong", "answer": {"valid": true, "value": "3x"}, "notes": [{"name": "mark", "expected": {"value": "nothing", "messages": ["Your answer is incorrect."], "warnings": [], "error": "", "valid": true, "credit": 0}}]}, {"variables": [], "name": "x+x+x is wrong and gets warning", "answer": {"valid": true, "value": "x+x+x"}, "notes": [{"name": "mark", "expected": {"value": "nothing", "messages": ["Your answer is incorrect.", "Your answer is not in the expected form: Should be number times x"], "warnings": [], "error": "", "valid": true, "credit": 0}}]}], "answer": "2x", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "mustmatchpattern": {"pattern": "$n*x", "partialCredit": "50", "message": "Should be number times x", "nameToCompare": ""}, "valuegenerators": [{"name": "x", "value": ""}]}, {"type": "jme", "useCustomName": false, "customName": "", "marks": 1, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [{"variables": [], "name": "xx is correct", "answer": {"valid": true, "value": "y>x"}, "notes": [{"name": "mark", "expected": {"value": "nothing", "messages": ["Your answer is numerically correct."], "warnings": [], "error": "", "valid": true, "credit": 1}}]}], "answer": "x