Not sure I did the right thing on questiontypes/calculated/questiontype.php
Hope I didn't create a bug there.
(can people please remember to merge changes into head whenever they change stable?)
Now this function works following this:
- Iterate over every quiz category in the course (following parent-child relationships).
- If the category is being used*, move it to site level (under a container category) and
mark it as published.
- If the category isn't being used, remove** it completely (questions, instances...) and
re-parent its child categories.
- Feedback is shown in a table detailing all the changes performed.
* One category is being used if it has one question that is being used in any quiz,
independently of its publish status.
** Removal of categories (and associated questions) has benn improved but, it won't
be perfect until bug 3366 was solved.
Tested against some large courses with reused questions and multiple levels of
categories. Seems to work but
PLEASE TEST IT AND SEND ANY FEEDBACK TO BUG 2459
(http://moodle.org/bugs/bug.php?op=show&bugid=2459)
Exactly this function is going to be used in the upgrade script to solve
the orphan categories issue and it must work perfectly!
Merged from MOODLE_15_STABLE
The random questions have another option specifying whether they can choose their questions also from subcategories or not. This option is stored in the unused questiontext field.
options or not. This is handled as in the resource module. The
"Show advanced options" button is only shown if the admin has
chosen to declare some of the options as advanced.
There are now 4 review options as suggested by Martin in
http://moodle.org/mod/forum/discuss.php?d=16709
Provides separate buttons "Update this quiz" and "Edit questions",
see http://moodle.org/mod/forum/discuss.php?d=16708. To make this
possible edit.php can now be called with a quiz id and it saves
its data itself rather than relying on mod.php.
mod.html now has a "Save changes" and a "Save changes and edit questions" button.
"Attempt quiz now" button gets a different language string for
re-attempts. This is currently set to "Re-attempt quiz".
After viewing the feedback for an attempt the "Continue" button
leads back to the course homepage, as requested in bugs 1224 and
1976. If there is no feedback the user is brought straight to quiz/view.php.
Therefore all workarounds are removed from lib.php and an isolated workaround is included in random/questiontype.php in order to ensure backward compability.