rstudio/pygradethis

Isolate problematic ast node for better feedback

Closed this issue · 0 comments

When the student's code differs in a particular part of the expression or block of code, we should isolate that part for feedback.

For e.g.:

Student submits: 1 + sum([1,2,3])
Solution expects: 1 + sum([1,2])

Feedback message should be:

"I did not expect 3 in sum([1,2,3])"

or more specifically:

"I did not expect 3 in [1,2,3]"

Tasks:

  • add ability to get source text back from an AST node
  • isolate to the nearest outer AST node where code diverges