numbas / Numbas

A completely browser-based e-assessment/e-learning system, with an emphasis on mathematics
http://www.numbas.org.uk
Apache License 2.0
205 stars 120 forks source link

Feedback should be visible if a code validation test fails #1116

Closed chrismgraham closed 1 week ago

chrismgraham commented 1 week ago

Putting this here as I think it relates more to recent changes to the numbas runtime than programming extension.

When a code question fails a validation test, I think that the feedback should be shown automatically, otherwise the validation test message isn't very useful to the student. For example, try entering y = 1 into https://numbas.mathcentre.ac.uk/question/114031/assign-a-variable/preview/

I think the same thing happens with e.g. a syntax error in a mathematical expression, but in that case an alert is visible. Perhaps a different solution is to give an alert in the programming extension when a validation test fails?

chrismgraham commented 1 week ago

If you have a syntax error in your code / other things in stderr, then that also gets hidden in the feedback currently and I think should be visible

christianp commented 1 week ago

I've made the code input widget open the feedback when you use Ctrl+Enter to submit.

I've also made the marking algorithm for the code part type give a warning as well as a feedback message when there's an error running the code or when a validation test fails.