and most of
MDL-15540 - Write code to render the navigation panel - it does it all apart from working out the correct state in which to show each button, and apply appropriate styles as a result.
MDL-15537 - create oo attemptlib.php to hold shared code between attempt, summary and review.php
MDL-15541 - Refactor starting a new attempt into a new file startattempt.php
MDL-15538 - Rework attempt.php to use attemptlib.php
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.
Also, when the quiz has no questions, disable the Info, Reports and Preview tabs, which, in this case, just redirect back to the Edit tab anyway.
Finally, change a redirect in quiz view.php, which used a relative URL, to a full url starting $CFG->wwwroot.
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.
MDL-9451: Quiz answers can be lost if user navigates before page reloads. I am not totally sure I have fixed this, but I hope so. I moved the printing of the hidden form field with the list of questions on the page to the end of the form, so no answers will be processed unless the whole form loaded. Note that you could still lose data, but only if the page takes a really long time to load and you answer the first question and click submit before the whole quiz is loaded.
MDL-11463: The quiz uses two different timers, which is silly. I have removed the javascript that was ocasionally used to put a timer in the browser's title bar. Now we only use the one in the page for all cases.
Because MDL-8682 also needed javascript, I renamed timer.js to quiz.js so it could be a library of all the quiz's JavaScript, and started including it properly with require_js.
- 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>
- Modified to use build_navigation() for breadcrumb generation.
- Removed print_header method is now provided by base class.
Author: Matt Clarkson <mattc@catalyst.net.nz>
If there are any of the files styles.css, styles.php, script.js or script.php in the plugin folder, they will be linked to in the head of the quiz attempt page (only for the question types used on that page).
If you need to do something more complicated in your question type, you can override the get_html_head_contributions method instead.
It used not to work with random questions, and there were problems with the computation of the grade, and regrading. Fix thanks to Paulo Matos, who not only fixed the bug and tested it, but was also incredibly patient waiting for me to have time to commit the changes to CVS.
Merged from MOODLE_17_STABLE.