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
203 stars 117 forks source link

Check that invalid staged answers are saved after submitting #768

Closed christianp closed 3 years ago

christianp commented 3 years ago

From student reports, I think there's an unexpected behaviour when submitting an invalid answer.

Staged but unsubmitted answers are saved in the cmi.interactions.N.staged_answer key, so they'll be restored when the attempt is resumed. I suspect that if the student submits an invalid answer, the staged answer is cleared, so on resume it looks like they didn't write anything.

I think the right thing to do is to save invalid answers as the submitted answer, so when the attempt is resumed the invalid answer is restored and the part submitted again. This way the answer is not lost, and if the question is changed so that a previously invalid answer becomes valid, it will be marked.

christianp commented 3 years ago

I've just tried entering invalid answers to all the built-in part types, and they restored fine, so something else is causing this problem, if it isn't user error