You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
strict_syntax^ (XOR) and relational sides crash check_equality/check_order instead of giving feedback #307
With strict_syntax: true, ^ is kept as Python XOR, which is intended. But a response or answer that uses it crashes grading, and the learner gets an EvaluationError instead of feedback.
check_equality: x^2 parses to a boolean (Not), and lhs_expr - rhs_expr raises TypeError: unsupported operand type(s) for -: 'Not' and 'Not'.
check_order (app/context/symbolic/comparison.py): it computes lhs_expr - rhs_expr with no guard. Fix TypeError when the answer or response is an inequality #297 added a guard to check_equality only, so an order criterion with a boolean or relational side fails in the same way.
x(x) is read as a call of a function x, so it is graded incorrect against x^2 with no explanation.
Expression(s)/input that trigger it
Response
Answer
Params
Result
x^2
x^2
strict_syntax: true
EvaluationError ('Not' - 'Not' TypeError)
x(x)
x^2
strict_syntax: true
incorrect, no feedback
Expected vs. actual result
Expected:^ stays XOR. The response is graded incorrect, and the feedback includes NOTATION_WARNING_EXPONENT ("use ** for powers"). check_order treats a side it can't subtract as "cannot determine", as check_equality does.
Actual: EvaluationError.
Steps to reproduce / where it was used
evaluation_function("x^2", "x^2", {"strict_syntax": True}). Same result on pre-refactor main, on main, and on the stack top.
Activity