1) in all module-indpendent code the variable $quiz has been renamed to $cmoptions (it holds the options set by the course module which does not necessarily have to be a quiz, it could be a lesson for example).
2) quiz_restore_question_sessions() has the simpler name quiz_get_states
Also got rid of the quizfile.php in favour of file.php
Moved all code that is not specific to the quiz module out of locallib.php into questionlib.php.
The default questiontype class is now defined in quiz/questiontypes/questiontype.php.
See http://mantis.york.ac.uk/moodle/mod/forum/discuss.php?d=852
Fix for bug 3316: Now students which have attempted the quiz but have
since been unenrolled from the course are shown with a dimmed style.
Also merging Gustav's nicer error messages (the MERGED tag wasn't up to date)
Deletion (or move to site course) of orphan categories
executed in the upgrade process. Now we shouldn't have
such orphans anymore! B-)
Part of bug 2459
(http://moodle.org/bugs/bug.php?op=show&bugid=2459)
Important NOTE: In the upgrade code for postgreSQL I've included
some steps that weren't up to date. They seem to
standard SQL code but they should be tested
properly.... hope all works!
Merged from MOODLE_15_STABLE
executed in the upgrade process. Now we shouldn't have
such orphans anymore! B-)
Part of bug 2459
(http://moodle.org/bugs/bug.php?op=show&bugid=2459)
Important NOTE: In the upgrade code for postgreSQL I've included
some steps that weren't up to date. They seem to
standard SQL code but they should be tested
properly.... hope all works!
Merged from MOODLE_15_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
I was using the $excluded parameter to avoid
loops between categories. A->B->A. Think we can
assume such loops won't exist, so I've deleted
the $excluded use.
Merged from MOODLE_15_STABLE
returns an ordered array of categories following
the parent-child relationships. It doesn't forget
any category and returns all the categories passed
although their parent were incorrect. Try to build
as much tree structure as possible.
Merged from MOODLE_15_STABLE
quizzes that are using questions from one category.
It relies in the quizzes_question_used() function. Will
be use in the 'orphan_categories' bug (#2459)
(http://moodle.org/bugs/bug.php?op=show&bugid=2459)
Merged from MOODLE_15_STABLE
With some previously unmerged changes added too!! Please check them
Gustav!!