diff --git a/app/evaluation_tests.py b/app/evaluation_tests.py index 21b8609..a9c3d45 100755 --- a/app/evaluation_tests.py +++ b/app/evaluation_tests.py @@ -94,6 +94,20 @@ def test_physical_qualities_no_tolerance(self): result = evaluation_function(response, answer, params) assert result["is_correct"] is False + def test_physical_qualities_correct_feedback(self): + params = { + "atol": 0.0, + "rtol": 0.0, + "strict_syntax": False, + "physical_quantity": True, + "elementary_functions": True, + } + response = "0.6 Nm" + answer = "0.6 Nm" + result = evaluation_function(response, answer, params) + assert result["is_correct"] is True + assert result["feedback"] == "Response matches answer." + def test_euler_preview_evaluate(self): response = "ER_2" params = Params(is_latex=True, elementary_functions=False, strict_syntax=False) diff --git a/app/tests/example_tests.py b/app/tests/example_tests.py index 4e99325..1b2301d 100644 --- a/app/tests/example_tests.py +++ b/app/tests/example_tests.py @@ -651,8 +651,8 @@ def test_custom_comparison_with_criteria_contains(self, response, value, tags): "2+answer > response_UNKNOWN", ], { - "answer <= response_TRUE": "AAA", - "2+answer > response_UNKNOWN": "BBB", + "answer <= response_TRUE": "Custom response true", + "2+answer > response_UNKNOWN": "μ Custom response unknown", }, { "symbol_assumptions": "('x', 'real')", diff --git a/app/utility/evaluation_result_utilities.py b/app/utility/evaluation_result_utilities.py index f1c0eb5..c7c222f 100644 --- a/app/utility/evaluation_result_utilities.py +++ b/app/utility/evaluation_result_utilities.py @@ -38,6 +38,10 @@ def add_feedback_from_tags(self, tags, graph, custom_feedback=None): feedback_string = graph.criteria[tag].feedback_string_generator(dict()) else: feedback_string = graph.criteria[tag].feedback_string_generator(inputs) + + if feedback_string is not None and feedback_string[0].isalpha() and feedback_string[0].isascii(): + feedback_string = feedback_string.capitalize() + self.add_feedback((tag, feedback_string)) def add_criteria_graph(self, name, graph):