I'm having trouble getting enthused about this one. I'm still not entirely sure of the expected semantics of the button. What, for example, would a teacher expect to see in the question's Review panel? And if there's randomisation, would you expect to get a new random variant or not?
Certainly it's not acceptable to me to reset the question in the sense of deleting all question attempt steps to date - rewinding history is anathema.
There is a question state notstarted, so it might be possible to have an extra button that resets the question to that state, but it still makes me nervous. There could well be assumptions within the question engine that would be contradicted by telling a lie like that. And I find the idea of a button that mysteriously appears only with 0-mark questions a bit inelegant. The alternative - an extra UI button to turn this feature on - feels like feature bloat and I wouldn't be keen on that.
However, here's a much simpler idea, which might be good enough. There's a Reset question button that's displayed whenever there's a non-empty answer-box preload for the question. This warns students that they're about to lose all their current edits, but if they say OK, the answer-box is reset to its preload state. Although it doesn't currently do so, I think it would be OK if a reset button click also hid the Result Table. If it did that, and you preloaded all 0-mark question answer boxes with a comment like
# You can reset this question at any time with the Reset button.
would that satisfy your needs?
Note that:
- This is a local in-browser reset only. If the page is reloaded after clicking the button the state will revert to the non-reset state. The reset doesn't become "hard" until a new answer is (Pre)checked. But it is at least guaranteed not to cause any unpleasant side effects in the question engine.
- If the question has built-in randomisation, you would still be dealing with the original variant - you wouldn't get a new random version of the question.
Another possible approach which appeals more to me would be to allow the question author to relabel the "Precheck" button with a custom label. Then, using a combinator template grader the question author could place any desired interpretation on such button clicks. In your case, you could display a message saying the question had been reset in lieu of a result table. There would still need to be a way to reset the current answer, but I'm pretty sure we could find a way to do that. However, this approach still doesn't allow generation of an alternative randomisation of the question.
An even more general extension of the above is to allow question authors to add arbitrarily many additional custom buttons, but I fear we're again getting into feature bloat.
I'd be interested to hear Tim's and your team's thoughts on this request and the various possible solutions.