Skip to content

Commit a98390b

Browse files
Added flag for generating more detailed feedback when available.
1 parent 6eee380 commit a98390b

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

app/feedback/symbolic_comparison.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
}[tag]
8080
feedback_generators["IDENTIFY_REASON"] = lambda tag: lambda inputs: {
8181
"UNKNOWN": None,
82-
"ONE_ADDITION_TO_SUBTRACTION": f"{inputs['criterion'].children[0].content_string()} if one addition is changed to a subtraction or vice versa.",
82+
"ONE_ADDITION_TO_SUBTRACTION": f"{inputs['criterion'].children[0].content_string()} is true if one addition is changed to a subtraction or vice versa.",
8383
"ONE_EXPONENT_FLIP": f"{inputs['criterion'].children[0].content_string()} is true if one exponent has its sign changed.",
8484
"ONE_SWAP_ADDITION_AND_MULTIPLICATION": f"{inputs['criterion'].children[0].content_string()} is true if one addition is replaced with a multiplication or vice versa.",
8585
}[tag]

app/symbolic_comparison_evaluation.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -543,12 +543,16 @@ def get_candidates(unused_input):
543543
candidates = set(["response candidates "+", ".join([str(e) for e in values_and_expressions[response_value]])])
544544
return candidates
545545
for (group_label, group_info) in variation_groups.items():
546+
if local_parameters.get("detailed_feedback", False) is True:
547+
feedback_generator_label = group_label
548+
else:
549+
feedback_generator_label = "UNKNOWN"
546550
graph.attach(
547551
label+"_IDENTIFY_REASON",
548552
label+"_"+group_label,
549553
summary=group_info["summary"](expression_to_vary, group_info["variations"]),
550554
details=group_info["details"](expression_to_vary, group_info["variations"]),
551-
feedback_string_generator=symbolic_feedback_generators["IDENTIFY_REASON"]("UNKNOWN")
555+
feedback_string_generator=symbolic_feedback_generators["IDENTIFY_REASON"](feedback_generator_label)
552556
)
553557
graph.attach(
554558
label+"_"+group_label,

app/symbolic_comparison_evaluation_tests.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1175,6 +1175,8 @@ def test_no_reserved_keywords_in_old_format_input_symbol_alternatives(self):
11751175
}
11761176
),
11771177
("-2525", "-2525", "response = a*50 + d*51*25 where a=77; d=-5", True, [], {}),
1178+
("4/9", "(2/9*(3*b-2)^(3/2)-b^2/4-b)-(2/9*(3*a-2)^(3/2)-a^2/4-a)", "response = answer where a=2; b=6", True, [], {}),
1179+
("0", "0", "2*tan(response)*tan(response) = 0", True, [], {}),
11781180
]
11791181
)
11801182
def test_criteria_based_comparison(self, response, answer, criteria, value, feedback_tags, additional_params):

0 commit comments

Comments
 (0)