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
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.
This solution shows the message "Recently added question!" and the question text for each question that has been added since the reviewed attempt.
The advantage with the chosen solution is that it will work fine for the (soon to come) "Each attempt builds on the last" quiz option.
As I don't have the karma needed for updating in lang/en/, the message does not yet look quite as I described it above.
For numerical there was also a need to allow typical shortanswer responses whenever there could be answers like n/a, inf, -inf, nan etc.
Further more about numerical, there can be more than one answer alternative defined (just like for shortanswer). This is not supported by numerical.html but everywhere else. MULTIANSWER included, it is up to any taker to update numerical.html. This is more than likely to lead to overlappings between numerical ranges if more than one is defined. Think of the case where the highest grade answer ranges between 0 and 2 and the half grade answer ranges between 2 and 4. How should we grade 2? We should pick the highest grade!
set utomatically the publish field to 1.
If a question exists in DB (by category, questiontext and qtype) it isn't
duplicated.
This produce some problems restoring answes, but avoid duplicates.
Modified methods are quiz_get_answers and quiz_grade_attempt_results.
For quiz_grade_attempt_results, the switch statement has been separated out into method quiz_grade_attempt_question_result.
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. ;-)