mirror of
https://github.com/moodle/moodle.git
synced 2025-08-07 18:06:51 +02:00
mod quiz + questions MDL-22370 convert JavaScript to YUI3 and modules.
Note, quiz editing JS has not been done yet.
This commit is contained in:
parent
24f17d7588
commit
ff065f96bc
15 changed files with 418 additions and 478 deletions
|
@ -88,6 +88,10 @@
|
|||
|
||||
/// Print the quiz page ////////////////////////////////////////////////////////
|
||||
|
||||
// Initialise the JavaScript.
|
||||
$headtags = $attemptobj->get_html_head_contributions($page);
|
||||
$PAGE->requires->js_init_call('M.mod_quiz.init_attempt_form', null, false, quiz_get_js_module());
|
||||
|
||||
// Arrange for the navigation to be displayed.
|
||||
$navbc = $attemptobj->get_navigation_panel('quiz_attempt_nav_panel', $page);
|
||||
$firstregion = reset($PAGE->blocks->get_regions());
|
||||
|
@ -95,7 +99,6 @@
|
|||
|
||||
// Print the page header
|
||||
$title = get_string('attempt', 'quiz', $attemptobj->get_attempt_number());
|
||||
$headtags = $attemptobj->get_html_head_contributions($page);
|
||||
$PAGE->set_heading($attemptobj->get_course()->fullname);
|
||||
if ($accessmanager->securewindow_required($attemptobj->is_preview_user())) {
|
||||
$accessmanager->setup_secure_page($attemptobj->get_course()->shortname . ': ' .
|
||||
|
@ -129,11 +132,6 @@
|
|||
// Start the form
|
||||
echo '<form id="responseform" method="post" action="', s($attemptobj->processattempt_url()),
|
||||
'" enctype="multipart/form-data" accept-charset="utf-8">', "\n";
|
||||
|
||||
// A quiz page with a lot of questions can take a long time to load, and we
|
||||
// want the protection afforded by init_quiz_form immediately, so include the
|
||||
// JS now.
|
||||
echo html_writer::script(js_writer::function_call('init_quiz_form'));
|
||||
echo '<div>';
|
||||
|
||||
/// Print all the questions
|
||||
|
@ -154,7 +152,7 @@
|
|||
// Some hidden fields to trach what is going on.
|
||||
echo '<input type="hidden" name="attempt" value="' . $attemptobj->get_attemptid() . '" />';
|
||||
echo '<input type="hidden" name="nextpage" id="nextpagehiddeninput" value="' . $nextpage . '" />';
|
||||
echo '<input type="hidden" name="timeup" id="timeup" value="0" />';
|
||||
echo '<input type="hidden" name="timeup" value="0" />';
|
||||
echo '<input type="hidden" name="sesskey" value="' . sesskey() . '" />';
|
||||
|
||||
// Add a hidden field with questionids. Do this at the end of the form, so
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue