It would be nice if instead a check was made to make sure that the
category wasn't being used by other courses, then even public
categories could be deleted.
As the wild card feature makes it possible for a response to match more than one answer alternative, I made sure that the alternative with the
highest grade would count.
I also fixed bug #945 for the short answer case.
Each format is now in it's own subdirectory, which allows the
format to have as many files as it likes. The formats are now
detected automatically (no need to edit lib.php anymore) and
the parent class is now in mod/quiz/format.php
Lastly, I added Paul Shew's new GIFT format.
to allow import of questions like this:
Every seriously injured person is likely to go into
A) shock.
B) infection.
C) hemorrhage.
D) respiratory pain.
ANSWER: A
Especially for multianswer questions it is often desirable to have the grade of the question in a quiz larger than the earlier maximum of 10 points.
The new function quiz_gradesmenu_options($defaultgrade) makes quiz question list grade selector drop-down have the maximum grade option set to the highest value between 10 and the defaultgrade of the question.
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 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!
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.
The code for reviewing an existing attempt is now separate
in review.php and now has a log entry of it's own.
The overview and regrade reports are now in separate subdirectories
under the "report" directory. Each has a primary "report.php" file
which implements the report as a class.
These existing reports are very simple, but now more complex ones
can easily be written. (I am about to do one).