Currently the only use is the quiz Redo question button, and that would
be much better placed in the feedback area, not least for langages where
the button label needs to be longer.
Derived table support was altered in MySQL 5.7 changing the way in which
DELETE FROM works in some cases.
This change modifies the way in which deletion occurs by selecting all IDs
and batching them into groups of 1000.
Only change from 2.9 is the modification of the slasharguments
admin setting string to recommend always to keep the setting enabled
and fix the problem in the server, warning about the drawbacks
of disabling it.
Also, there is a little phpdoc note added to one custom check
to have clearly specified when we can get rid of it.
The change in MDL-51090 broke manually commenting on questions for which
no mark is given (max mark == 0). This fixes it, with unit tests.
Thanks to Nick Phillips for the original suggestion of the fix.
This feature is designed for use on pracice or formative quizzes.
It is available for quizzes that use Interactive or Immediate feedback
behaviour.
If the teacher turns this on in the quiz settings, then once a student
has finished a question, they get a 'Redo question' button beside the
question. If they click it, then the question they finished is replaced
by a new one so they can try again to practise that particul skill or
bit of knowledge a bit more.
When randomisation is involved, the studnets will be given a question or
variant that they have not seen before if possible.
* A method to change the max mark for one question_attempt in the usage
* A method to replace one question in a usage with another, moving the
old question_attempt to the end.
* Methods to set and get metadata (string name value pairs) for each
question_attempt in the usage. This gets stored in the first step in a
way that should not interfere with anything else.
There are several improvements over what we had before:
1. We track all the questions seen in the the student's previous
quiz attempts, so that when they start a new quiz attempt, they get
questions they have not seen before if possible.
2. When there are no more unseen questions, we start repeating, but
always taking from the questions with the fewest attempts so far.
3. A similar logic is applied with variants within one question.
There is lots of credit to go around here. Oleg Sychev's students Alex
Shkarupa, Sergei Bastrykin and Darya Beda all worked on this over
several years, helping to clarify the problem and shape the best
solution. In the end, their various attempts were rewritten into this
final patch by me.
Further improvements to this code, including resolving edge cases:
* The new feature can only be used when it is possible for the
previous question in the quiz to be complete.
* Also, this new feature cannot be used in combination with shuffle
questions, because that make no sense; nor in combination with
sequential navigation, because to make that work properly would be a lot
of effort. If someone needs that to work later, it should be possible
for them to implement it.
* There were changes in the edit renderer API, to try to make things
more consistent, and to make it less likely we will need to change
things again in the future. See mod/quiz/upgrade.txt.
* As part of this change, the styling of the Edit quiz page was tweaked
to make slighly more efficient use of the horizontal space, and to be
more symmetrical.
The new steps make it more efficient to create questions.
While making the changes, I took the opportunity to alter the tests to
follow Behat best practices, and only test one thing per scenario.
Variant has two purposes. First to determine which version of the
question the student will see. Hence it is used to set up the state
of the quetsion when the question is started. Then the internal state of
the question is saved in the first step.
Once that has been done, the variant number is purely informative, and
just used to break down the statistics.
In some cases (the one I have in mind is qtype_opaque) then there is a
complex randomisation process, which may lead to several inital variant
numbers acutally giving the same version of the question. In this case
it is nice if the question can update the stored variant number, to make
the statistics more meaningful.
The MySQL (& Maria DB) query 'optimizer' was failing to handle this
query, so for that DB only, we give it an equivalent query that it can
get right.
With unit test.
The sequence of questions that made up a quiz used to be stored as a
comma-separated list in quiz.questions. Now the same information is
stored in the rows in the quiz_slots table. This is not just 'better' in
a database design sense, but it allows for the future changes we will
need as we enhance the quiz in the MDL-40987 epic.
Having changed the database structure, all the rest of the code needs to
be changed to account for it, and that is done here.
Note that there are not many unit tests for the changed bit. That is
because as part of MDL-40987 we will be changing the code further, and
we will add unit tests then.
This data should all have been upgraded when moving to Moodle 2.1. It
was only kept as a back-up, and now, after 3 years have past, we can
clean it up.
In Moodle 2.1, there was a major DB upgrade relating to questions, and
it was possible to delay some of that upgrade. Now, those DB tables are
changing again, and the time has come to insist that all the updata has
been upgraded (or deleted).
If the validation failed, so the manual grading page was re-displayed
with a validation error, then any comment that had just been typed in
was getting lost. This fixes that.
Whether the comments on manually graded questions were visible to
students should have been controlled by the 'Specific feedback' Review
option in the quiz settings. However, the quiz was not setting
$displayoptions->manualcomment, so it did not work.
This was breaking with oracle master/master replication. Fortunately all
the places that needed to be changed were private to datalib.php. There
is still some ordering by id there, but only places where we want a
consitent, rather than meaningful, order, so that is OK.
The queries changed by this patch all have subqueries in aggregate
queries that pull out the latest step for a question_attempt. Those
queries used to look for MAX(id) but now they look for
MAX(sequencenumber). This is equivalent (for databases where ids always
increase with time, except for auto-saved steps. In the past, an
auto-saved step might have been considered latest. Now the latest step
will always be one that has been properly processed. You can aruge that
this change is an improvement. Anyway, it is a moot point. All these
queries are only used in reports which are run on completed attempts,
where there will not be any autosaved data.
Before this, autosave was only working to save data when a student went
back in to continue an attempt. If the student, having crashed out,
never went back in and continued the attempt, their auto-saved responses
were not used when the attempt was automatically finished. That was a
rather bad oversight, which should now be fixed.
Adds a set of options to the essay question type which implement
the following new features:
-Adds an input format which accepts only file uploads, and no
inline text.
-Adds an option to make the inline text response optional when
attachments are enabled, so students can choose to upload
an essay file.
-Adds an option to make attachments required, so essays without
attachments will be marked incomplete.