Skip to content

Commit

Permalink
Merge branch 'master' into part-feedback-alignment
Browse files Browse the repository at this point in the history
  • Loading branch information
christianp committed Oct 15, 2024
2 parents adf1e93 + 48bb8ae commit 96a3261
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 29 deletions.
46 changes: 25 additions & 21 deletions tests/locales.js
Original file line number Diff line number Diff line change
Expand Up @@ -1492,26 +1492,26 @@ Numbas.locale = {
"question.explore.no parts defined": "In dieser Frage wurden keine Teile angelegt.",
"answer": "Antwort",
"worksheet.answersheet show question content": "Inhalt der Frage in Antwortblättern zeigen?",
"modal.confirm end exam": "Write <code>{{endConfirmation}}</code> in the box to confirm:",
"modal.end exam button": "End exam",
"lightbox.zoom in on image": "Zoom in on this image",
"exam.progress": "Progress",
"exam.questions answered": "{{numAnsweredQuestions}} of {{numQuestions}} questions answered.",
"result.question marks available": "Marks Available",
"result.question answered": "Answered?",
"control.confirm end.correct": "You may now end the exam.",
"control.confirm end.incorrect": "This is not the expected text.",
"control.confirm end.password": "end",
"jme.typecheck.for in name wrong type": "The name in a <code>for</code> statement must be a name or list of names, not {{type}}.",
"jme.makeFast.no fast definition of function": "The function <code>{{name}}</code> here isn't defined in a way that can be made fast.",
"part.show feedback": "Show feedback",
"part.hide feedback": "Hide feedback",
"part.feedback title": "Feedback for {{name}}.",
"part.jme.must-match.warning": "Your answer is not in the expected form: {{-message}}",
"part.numberentry.write your answer as a fraction": "Write your answer as a fraction.",
"question.nav.label": "Question controls",
"question.answer saved": "Answer saved",
"question.all answers saved": "All answers saved"
"modal.confirm end exam": "Schreiben Sie zur Bestätigung <code>{{endConfirmation}}</code> in die Box:",
"modal.end exam button": "Test beenden",
"lightbox.zoom in on image": "Hereinzoomen",
"exam.progress": "Fortschritt",
"exam.questions answered": "{{numAnsweredQuestions}} von {{numQuestions}} Fragen beantwortet.",
"result.question marks available": "Bewertungen verfügbar",
"result.question answered": "Beantwortet?",
"control.confirm end.correct": "Sie können den Test nun beenden.",
"control.confirm end.incorrect": "Dies ist nicht der erwartete Text.",
"control.confirm end.password": "Beenden",
"jme.typecheck.for in name wrong type": "Der Name in einem <code>for</code>-Statement muss ein Name oder eine Liste von Namen sein, nicht {{type}}.",
"jme.makeFast.no fast definition of function": "Die Funktion <code>{{name}}</code> hier ist nicht so definiert, dass sie schnell ausgeführt werden kann.",
"part.show feedback": "Feedback anzeigen",
"part.hide feedback": "Feedback verbergen",
"part.feedback title": "Feedback für {{name}}.",
"part.jme.must-match.warning": "Ihre Antwort hat nicht die erwartete Form: {{-message}}",
"part.numberentry.write your answer as a fraction": "Schreiben Sie Ihre Antwort als Bruchzahl.",
"question.nav.label": "Fragen-Navigation",
"question.answer saved": "Antwort gespeichert",
"question.all answers saved": "Alle Antworten gespeichert"
}}
,
"en-gb": {translation:
Expand Down Expand Up @@ -1809,8 +1809,11 @@ Numbas.locale = {
"part.unknown type": "{{part}}: Unrecognised part type {{type}}",
"part.setting not present": "Property '{{property}}' not set",
"part.feedback out of date": "This feedback is based on your last submitted answer. Save your changed answer to get updated feedback.",
"part.there is new feedback": "The feedback has changed.",
"part.input title": "Answer for part {{name}}",
"part.show feedback": "Show feedback",
"part.feedback message count": " (1 message)",
"part.feedback message count_plural": " ({{count}} messages)",
"part.hide feedback": "Hide feedback",
"part.feedback title": "Feedback for {{name}}.",
"part.correct answer title": "Expected answer for part {{name}}",
Expand Down Expand Up @@ -2007,7 +2010,8 @@ Numbas.locale = {
"worksheet.reconfigure": "Generate different sheets",
"worksheet.show sheet": "Preview the sheet with ID:",
"worksheet.answersheet show question content": "Show question content in answer sheets?"
}}
}
}
,
"en-school": {translation:
{
Expand Down
2 changes: 1 addition & 1 deletion tests/numbas-runtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -22219,7 +22219,7 @@ if(res) { \
*/
markingComment: function(message, reason, format)
{
if(!this.settings.showFeedbackIcon && reason == 'incorrect' || reason=='correct') {
if(!this.settings.showFeedbackIcon && (reason == 'incorrect' || reason=='correct')) {
return;
}
this.markingFeedback.push({
Expand Down
15 changes: 8 additions & 7 deletions tests/parts/part-tests.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,10 @@ Numbas.queueScript('part_tests',['qunit','json','jme','localisation','parts/numb
await res.waiting_for_pre_submit;
res = p.mark_answer(p.rawStudentAnswerAsJME(),p.getScope());
}
assert.ok(res.state_valid.mark,'mark note is valid');
var prefix = `${p.name}: ${test.name}: `
assert.ok(res.state_valid.mark,prefix + 'mark note is valid');
test.notes.forEach(function(note) {
assert.ok(res.states[note.name]!==undefined,'Note "'+note.name+'" exists');
assert.ok(res.states[note.name]!==undefined,prefix + 'Note "'+note.name+'" exists');
var value = res.values[note.name];
var expectedValue = Numbas.jme.builtinScope.evaluate(note.expected.value);
var bothValues = expectedValue && value;
Expand All @@ -90,7 +91,7 @@ Numbas.queueScript('part_tests',['qunit','json','jme','localisation','parts/numb
} else {
differentValue = expectedValue==value;
}
assert.notOk(differentValue,'Note "'+note.name+'" has value "'+note.expected.value+'"');
assert.notOk(differentValue,prefix + 'Note "'+note.name+'" has value "'+note.expected.value+'"');
});

p.credit = 0;
Expand All @@ -100,12 +101,12 @@ Numbas.queueScript('part_tests',['qunit','json','jme','localisation','parts/numb
var messages = final_res.markingFeedback.map(function(action){ return action.message; }).join('\n');
var mark_note = test.notes.find(function(n) { return n.name=='mark' });
var expectedMessages = mark_note.expected.messages.join('\n');
assert.equal(messages,expectedMessages,'Feedback messages');
assert.equal(messages,expectedMessages,prefix + 'Feedback messages');
var warnings = final_res.warnings.join('\n');
var expectedWarnings = mark_note.expected.warnings.join('\n');
assert.equal(warnings, expectedWarnings,'Warnings');
assert.equal(res.state_valid.mark,mark_note.expected.valid,'Valid');
assert.equal(final_res.credit,mark_note.expected.credit,'Credit');
assert.equal(warnings, expectedWarnings,prefix + 'Warnings');
assert.equal(res.state_valid.mark,mark_note.expected.valid,prefix + 'Valid');
assert.equal(final_res.credit,mark_note.expected.credit,prefix + 'Credit');
done();
};
}
Expand Down

0 comments on commit 96a3261

Please sign in to comment.