Commit 56d5bba1 by Will Daly

Update student training messaging in authoring.

parent 5c94f48c
...@@ -189,9 +189,9 @@ def validate_training_examples(rubric, examples): ...@@ -189,9 +189,9 @@ def validate_training_examples(rubric, examples):
] ]
if len(set(criteria_options) - set(criteria_without_options)) == 0: if len(set(criteria_options) - set(criteria_without_options)) == 0:
return [_( return [_(
u"When you include a student training assessment, " "If your assignment includes a student training step, "
u"the rubric for the assessment must contain at least one criterion, " "the rubric must have at least one criterion, "
u"and each criterion must contain at least two options." "and that criterion must have at least one option."
)] )]
# Check each example # Check each example
......
...@@ -577,7 +577,7 @@ ...@@ -577,7 +577,7 @@
"options_selected": {} "options_selected": {}
} }
], ],
"errors": ["When you include a student training assessment, the rubric for the assessment must contain at least one criterion, and each criterion must contain at least two options."] "errors": ["If your assignment includes a student training step, the rubric must have at least one criterion, and that criterion must have at least one option."]
} }
} }
...@@ -975,7 +975,7 @@ ...@@ -975,7 +975,7 @@
} }
], ],
"editor_assessments_order": ["student-training", "peer-assessment", "self-assessment"], "editor_assessments_order": ["student-training", "peer-assessment", "self-assessment"],
"expected_error": "student training example option does not match the rubric" "expected_error": "example 1 has an extra option for \"not a criterion!\"; example 1 is missing an option for \"0\""
}, },
"missing_editor_assessments_order": { "missing_editor_assessments_order": {
......
...@@ -303,7 +303,10 @@ class ValidationIntegrationTest(TestCase): ...@@ -303,7 +303,10 @@ class ValidationIntegrationTest(TestCase):
# Expect a validation error # Expect a validation error
is_valid, msg = self.validator(self.RUBRIC, mutated_assessments) is_valid, msg = self.validator(self.RUBRIC, mutated_assessments)
self.assertFalse(is_valid) self.assertFalse(is_valid)
self.assertEqual(msg, u'Student training example option does not match the rubric.') self.assertEqual(msg, (
u'Example 1 has an extra option for \"Invalid criterion!"; '
u'Example 1 is missing an option for "vocabulary"'
))
def test_student_training_examples_invalid_option(self): def test_student_training_examples_invalid_option(self):
# Mutate the assessment training examples so the option names don't match the rubric # Mutate the assessment training examples so the option names don't match the rubric
...@@ -313,7 +316,7 @@ class ValidationIntegrationTest(TestCase): ...@@ -313,7 +316,7 @@ class ValidationIntegrationTest(TestCase):
# Expect a validation error # Expect a validation error
is_valid, msg = self.validator(self.RUBRIC, mutated_assessments) is_valid, msg = self.validator(self.RUBRIC, mutated_assessments)
self.assertFalse(is_valid) self.assertFalse(is_valid)
self.assertEqual(msg, u'Student training example option does not match the rubric.') self.assertEqual(msg, u'Example 1 has an invalid option for "vocabulary": "Invalid option!"')
def test_example_based_assessment_duplicate_point_values(self): def test_example_based_assessment_duplicate_point_values(self):
# Mutate the rubric so that two options have the same point value # Mutate the rubric so that two options have the same point value
......
...@@ -295,7 +295,7 @@ def validate_assessment_examples(rubric_dict, assessments, _): ...@@ -295,7 +295,7 @@ def validate_assessment_examples(rubric_dict, assessments, _):
# examples against the rubric. # examples against the rubric.
errors = validate_training_examples(rubric_dict, examples) errors = validate_training_examples(rubric_dict, examples)
if errors: if errors:
return False, _(u"Student training example option does not match the rubric.") return False, "; ".join(errors)
return True, u'' return True, u''
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment