What happens is that adding random questions used to set the timestamps
of these questions to the same value. This is fine in normal operation,
but it stuffs up the backup of that course, overwriting the question.
When the course is restored, the missing questions cause quizzes to
have lots of red notices like "Question not found".
Anyhow, this patch should safely fix older installations that may have
these duplicate questions lying around.
THANKS ELOY!
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.
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).
created. Works OK after limited testing.
I've also renamed some strings to do with "Random Match", so that this
question type is now called "Random Short-Answer Match".
Later there will be a new 'Random Match' which randomly selects one of the
existing "Match" questions.
... this grade is used as the default grade when adding questions
to a quiz.
At the moment it's just so that some imported questions can have
different defaults, but a field should be added to all question
editing pages.
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.
Moodle tables.
ie user -> userid in many tables, plus in user_students
start -> starttime and end -> endtime
I've just done all this as carefully as I could ... I don't think
I missed anything but it's pretty intensive work and I'd be fooling myself
if I didn't think I'd missed a couple.
Note that this version should pretty much be able to bootstrap itself
using PostgreSQL now ... but this is untested
Basically all the Database functions are in lib/datalib.php
and the web functions are all in lib/weblib.php, so
moodlelib.php is much thinner than it was.
Data functions have been extended ... most old calls will
still work, but now many more SQL commands can be performed
using the datalib functions rather than using SQL. I'm
currently moving through the whole tree replacing SQL
calls or at least concentrating them in one section of
mod/xxx/lib.php
Still working on forums, quizzes, surveys, resources.
The tree is currently not full working ... some things are
half-completed ... will resume tomorrow.
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 ...