Step 1. Just convert the existing functions quiz_question_showbank and question_showbank and friends into methods of a class and subclass.
More to come.
The old implementation was string-based and flawed, so switched to a more readable array-based one.
Also removed strpos2() since it was only used in edit.php locally and due to this change became unused.
This was started and usability tested as a Finnish Summer of Code project, and then Olli did further work on it in his own time to get it in shape for inclusion in Moodle 2.0. I reviewed all the code. There are a number of minor outstanding issues that will be fixed soon. See the subtasks of MDL-17284 for a list.
The goal of these changes is to:
* help teachers new to Moodle, so when they first see the quiz editing page, they don't go "Huh! What on earth am I supposed to do here?"
* help novice Moodle users understand and learn to use some of the more advanced quiz feature;
* but, without slowing down more experienced quiz users.
Naturally, with ambitous goals like that, we won't have managed to satisy everybody, but I think this change is a big step in the right direction.
There is extensive documentation on this project at http://docs.moodle.org/en/Development:Quiz_UI_redesign.
Also, when you edit the quiz, and therefore any preview attempts are deleted automatically, make sure the attempts are deleted properly by calling quiz_delete_attempt on each one, rathern than leaving orphaned junk in the database.
I also took the opportunity to improve the layout of this message slightly, and clarify the message that tells you that you cannot add or remove questions from the quiz if there are attemts.
Merged from MOODLE_19_STABLE.
More significantly, this patch changes the '1 Students have made 1 attempts' string.
To start with, this code was being produced in five different places, so I made a function to do the work!. Next, as you can see, it is not gramatical. Also, some people find it confusing, as in MDL-6376.
Therefore, it now just says 'Attempts: 1'.
Merged from MOODLE_19_STABLE.
This check-in removes about 400 lines of code. I hope I have not screwed anything up. I would be grateful if people could review this change, and keep an eye on the navigation bar in modules.
Any navigation bar bugs you find in the near future, feel free to file them in the tracker and assign them to me. Thanks.
If not to many problems are found, I think I would like to backport this to 1.9 stable, but I am not sure that is a good idea. Opinions to the General Developer Forum please. I am about to start a thread there.
* Don't let the user set the name for random questions.
* Instead force the name to be "Random (catname)" (localised) whever the question is created or saved.
* When a category is renamed, rename all the random questions in it.
* Remove the restriction that Jamie seems to have added in 1.9 that was preventing the category of random questions from being edited.
- Removed $course parameter from build_navigation()
- Updated all calls to build_navigation()
Author: Matt Clarkson <mattc@catalyst.net.nz>
Committer: Matt Clarkson <mattc@catalyst.net.nz>