Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions app/evaluation_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions app/tests/example_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')",
Expand Down
4 changes: 4 additions & 0 deletions app/utility/evaluation_result_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down