The code to print blocks in now in theme layout.php files. (Or in
moodle_core_renderer::handle_legacy_theme)
Code for printing blocks everywhere else has been stripped out.
(Total diffstat 1225 insertions, 2019 deletions)
The way the HTML for a block instance is generated has been cleaned
up a lot. Now, the block_instance generates a block_contents
object which gives a structured representation of the block,
and then $OUTPUT->block builds all the HTML from that.
How theme config.php files specify the layout template and block
regions by page general type has been changed to be even more flexible.
Further refinement for how the theme and block code gets initialised.
Ability for scrits to add 'pretend blocks' to the page. That is,
things that look like blocks, but are not normal block_instances.
(Like the add a new block UI.)
Things that are still broken:
* some pages in lesson, quiz and resource. I'm working on it.
* lots of developer debug notices pointing out things that
need to be updated.
There is a new implementation of require_js in lib/deprecatedlib.php,
based on $PAGE->requires.
There were a few other recently introduced functions in lib/weblib.php,
namely print_js_call, print_delayed_js_call, print_js_config and
standard_js_config. These have been removed, since they were never in
a stable branch, and all the places that used them have been changed
to use the newer $PAGE->requires->... methods.
get_require_js_code is also gone, and the evil places that were calling
it, even though it is an internal function, have been fixed.
Also, I made some minor improvements to the code I committed yesterday
for MDL-16695.
All that remains is to update all the places in core code that are
still using require_js.
(This commit also fixes the problem where the admin tree would not
start with the right categories expanded.)
I don't know why the quiz only logged every 10 minutes. No other part of Moodle worked like that. However, it has always been like that and I did not have a good reason to change it until now.
What was a problem becuase it made it harder to catch people doing a primitive DOS attack against the server by hitting Reload repeatedly.
And MDL-17568 minor niggles with new queston navigation:
* The bit that scrolls down to the question you just submitted in adaptive mode was not working with random questions.
* Teachers reviewing an open attempt were shown the qusetions as editable, not read only!
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>