This fix rids warnings that used to come when a student for the first time attempts a quiz with the option "Each attempt builds on the last" = Yes (attemptonlast).
Now the option is not in effect when a student attempts a quiz for the first time, i.e. when there is no last attempt to build on.
This makes it possible for students to take a tedious quiz, save it half-way and have it graded. The student can then, at a later point, get back to the quiz and have the previous answers already filled in and graded. The student can then continue with the remaining questions as well as redo all the answers that got wrong at the previous attempt.
It seems to work fine with one little twisted exception:
Say that the student attempts the quiz first and that the teacher thereafter edits the quiz and removes or adds a few questions. This will work out fine for as long as the teacher do not get the idea of adding a question with question type RANDOM. The quiz will be fully functional again after removing that RANDOM question or resetting the option 'Each attempt builds on the last" to NO.
Not a very serious problem but it takes someone with greater insight in question type RANDOM to resolve it.
As always, I can not commit lang/en/quiz.php.
---
As I was using the function quiz_get_attempt_responses I had it refactored removing the obsolete argument $quiz. I also changed the call from review.php
is shown in the titlebar (drawn with javascript).
An alert is shown at ten minutes, and zero minutes.
This doesn't prevent students from doing anything, but it serves
as a reminder and just looks cool. ;-)
same order. Note that shuffled ANSWERS may still appear reshuffled.
When viewing reports, all shuffling is switched off so that quizzes
always appear in the default order (for easier comparison).
Also a few tweaks, robustness etc
When you add a random question to a quiz, then a question
is chosen randomly from the same category.
Questions are not repeated in a particular quiz attempt.
This still needs more testing, but it's looking OK so far.
of questions. These use 2 or more short answer questions at
random to construct a questions where you have to match
answers to questions. Only lightly tested so far.
Quiz questions can now be edited with Richtext editor.
Sundry little fixes along the way.
Should be fixed now. As a bonus, I've removed all the uses of
HTTP_POST_VARS from all scripts.
All forms should use the new data_submitted() function to collect
form data (it does the match_referer thing internally now).
Much nicer.
record upon showing the quiz, and completing it upon submit.
Two new fields in quiz_attempts... should be upgrade friendly.
(Old attempts will show up as being of duration zero)
Also some small fixes here and there.
If you have existing quizzes, delete them all, then
drop all the quiz tables and delete the quiz line from
the modules table.
Things to do still:
- add/edit/remove categories
- display question feedback on submissions ...
- record the time they started the quiz, as well as the completion.
- place time limits between attempts
- add full specification of quiz open time and quiz close time
At this stage this module:
- prints quizzes,
- accepts answers (for multiple attempts) and grades them,
- stores the grades.
Really, it's usable as long as you don't mind using the database manually. :)
Next up is quiz reports, then I'll tackle quiz creation.
but can't mark them yet. I've been constructing quizzes manually in the
database and it's helping to refine the database structure. Don't count
on anything stable in the quiz module for a few days yet ...