Once students start answering a quiz, it will become clearer what kind of mistakes they are making. STACK is in principle intelligent enough so that one can detect a particular type of mistake in a student's answer and then give tailored feedback. This requires adding extra nodes to the response tree of the STACK question. Is this possible to do even after some students have already started taking the quiz?
Good question. I'm not 100% familiar with what outcomes are cached by "quiz/question attempts", as this is a part of Moodle rather than STACK itself. I've done some experiments today. Yes, you can edit a question once it is in a quiz, and students have attempted it. They then get updated feedback. However, the marks do not change. I think you need to do a "regrade" to achieve this from the quiz review page as the teacher.
I think this is a sensible protocol, and quite helpful to teachers.
Chris's experiments were good, in that they correctly determined how the code works.
Grades (and question state (correct / partial / incorrect) are calculated and stored at the moment when the student submits their responses. (Exactly when that happens depends on the question behaviour.) The feedback is re-computed whenever we display the question.
(Hmm, I guess that is a bit weird and inconsistent, but actually it seems to work OK.)
Re-grading will re-compute the grade and question state using the latest question definition.
A similar observation which I made quite a while ago (so it can be outdated, but perhaps worth checking anyway if the need arises):
If I presented a defect question to the students, somebody pointed the problem out, and I fixed the question, then the students had to start a new quiz to get the corrected version of the question. Quizzes that were started before the question was fixed still were served the old version.
The question behaviour for the test is now adaptive, with new attempts not building on previous ones, but I am not 100% sure I have not changed that afterwards.
Thank you for these helpful answers. If I combine Tim's answer and Mikael's answer I get that question feedback is recomputed each time the question is displayed, but the question text is recomputed only when the student starts a new quiz. Is that correct?
Mikael's observation is out-of-date. The situation changed in March this year (https://github.com/maths/moodle-qtype_stack/commit/4685a355da329e8feb9e3fcf9f852b6d9e456132 ).
Now, the only unique thing done when a student starts a question is to generate the random seed. Then, each time the student views the question, everything else is re-generate from that. (So, if you edit the question in a stupid way, you could break things badly.) On the other hand, it does let you fix typos in the question text.
Note that this is not inefficient, because of the CAS caching. All the calculation is done in one CAS call, which will be in the cache after the first time the student starts the question - unless you edit the question in a non-trivial way, in which case it will become a cache miss, and things will get recomputed.
If you want to see the details, here is the code:
- Starting an attempt at a question: https://github.com/maths/moodle-qtype_stack/blob/3239dc60a5a15ab54cdbd0107fdeb549b1eb872e/question.php#L238
- Re-visiting an existing attempt: https://github.com/maths/moodle-qtype_stack/blob/3239dc60a5a15ab54cdbd0107fdeb549b1eb872e/question.php#L334