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
When checking whether an object is correctly created and the exercise only contains a single = operator in addition to other 'object-mutating' operations that don't use =, highlighting trips up.
The x = [] will be highlighted, even though the mistake is in the x.append() step. This is extremely confusing for students! You can see it in action here
Reproducible example (in code)
frompythonwhat.localimportsetup_statefrompythonwhat.TestimportTestFailsol_code="x = []\nfor i in range(3): x.append(i)"stu_code="x = []\nfor i in range(3): x.append(2 * i)"s=setup_state(sol_code, stu_code)
try:
s.check_object('x').has_equal_value()
exceptTestFailase:
line_info=e.feedback.line_infoline_info
When checking whether an object is correctly created and the exercise only contains a single
=
operator in addition to other 'object-mutating' operations that don't use=
, highlighting trips up.Reproducible example (in words)
If the student submits:
The
x = []
will be highlighted, even though the mistake is in thex.append()
step. This is extremely confusing for students! You can see it in action hereReproducible example (in code)
This will print out:
While it should have a
line_start
online_end
equal to 2, or just not highlight anything at all.The text was updated successfully, but these errors were encountered: