... before trying to create the unique index that should be there.
The violations may come from old buggy code.
We do two things.
1. First we delete all previews.
2. Then, if there are still problems, we renumber attempts to eliminate
the duplicates.
restructuring the validation function of edit_calculatedmulti_form.php
correcting attempt
defining = new stdClass() before using them : Strict standards
1/ type/match/tests/walkthrough_test.php - tests are failing randomly, looks like some weird randomisation is going on there - see TODOs
2/ type/multianswer/tests/upgradelibnewqe_test.php contains invalid expected value - see TODO
The files that belong to the question hints are neither moved when the
question is moved to another context, nor deleted when the question is
deleted.
Oops! How come no one noticed that until today.
This was one of those innocent seeming issues where, once you start
digging, you find a mess. In this case, the code that is now in
question_wizard_form::add_hidden_fields used to exist in four different
places, in four inconsistent versions. This is now all nicely
re-factored, and that solves the problem.
Along the way, I found and fixed some wrong string references in
qtype_random, and stripped out some unnecessary &s in function
declarations.
When shortanswer, numerical, calculated and calculatedsimple questions
did not have a '*' match-anything answer, then any student response that
did not match any of the teacher-given answers were classified as
'[No response]', which was not right.
This patch fixes that. Such responses are now classified as
[Did not match any answer].
While I was doing this, I noticed that the display of tolerance
intervals for numerical questions in the response analysis was horrible,
so I improved it.
Conflicts:
question/type/upgrade.txt
There were already one just added upgrade.txt file so this ended
conflicting. Reviewed the contents, I've deleted the less detailed
note about pluginname, leaving the longer description added by Tim.
Ciao :-)
This applies to:
1. Upgrade from 1.9,
2. Import of questions exported from 1.9, and
3. Restore of courses backed-up from 1.9.
It also applies to the calculated question type.
There were two main problems:
1. The unit tests for upgrading adaptive quiz attempts had slighly the
wrong $expectedqa, and so matching that the upgrade was doing the wrong
thing in certain situations. The main issue was that it was setting
-_try = 1 on the first step, which broke the penalty calculation when
the quiz was regraded. There were also some other subtleties with
incrementing -_try that were not right before.
2. It was possible in 2.0 and earlier for two question_states to get the
same seq_number, and restoring 2.0 backups was rashly assuming that that
was unique.