echo implode("\n", $rows); echo "\n</tbody></table>\n"; } /// Summary table end ============================================================================== /// Form for saving flags if necessary. if ($options->flags == QUESTION_FLAGSEDITABLE) { echo '<form action="' . s($attemptobj->review_url(0, $page, $showall)) . '" method="post"><div>'; echo '<input type="hidden" name="sesskey" value="' . sesskey() . '" />'; } /// Print all the questions. if ($showall) { $thispage = 'all'; $lastpage = true; } else { $thispage = $page; $lastpage = $attemptobj->is_last_page($page); } foreach ($attemptobj->get_question_ids($thispage) as $id) { $attemptobj->print_question($id, true, $attemptobj->review_url($id, $page, $showall)); } /// Close form if we opened it. if ($options->flags == QUESTION_FLAGSEDITABLE) { echo '<div class="submitbtns">' . "\n" . '<input type="submit" id="savingflagssubmit" name="savingflags" value="' . get_string('saveflags', 'question') . '" />' . "</div>\n" . "\n</div></form>\n"; $PAGE->requires->js_function_call('question_flag_changer.init_flag_save_form', array('savingflagssubmit')); } /// Print a link to the next page. echo '<div class="submitbtns">'; if ($lastpage) { $accessmanager->print_finish_review_link($attemptobj->is_preview_user()); } else { echo link_arrow_right(get_string('next'), s($attemptobj->review_url(0, $page + 1)));
/** * Ouputs the form for making an attempt * * @param quiz_attempt $attemptobj * @param int $page Current page number * @param array $slots Array of integers relating to questions * @param int $id ID of the attempt * @param int $nextpage Next page number */ public function attempt_form($attemptobj, $page, $slots, $id, $nextpage) { $output = ''; // Start the form. $output .= html_writer::start_tag('form', array('action' => $attemptobj->processattempt_url(), 'method' => 'post', 'enctype' => 'multipart/form-data', 'accept-charset' => 'utf-8', 'id' => 'responseform')); $output .= html_writer::start_tag('div'); // Print all the questions. foreach ($slots as $slot) { $output .= $attemptobj->render_question($slot, false, $this, $attemptobj->attempt_url($slot, $page), $this); } $navmethod = $attemptobj->get_quiz()->navmethod; $output .= $this->attempt_navigation_buttons($page, $attemptobj->is_last_page($page), $navmethod); // Some hidden fields to trach what is going on. $output .= html_writer::empty_tag('input', array('type' => 'hidden', 'name' => 'attempt', 'value' => $attemptobj->get_attemptid())); $output .= html_writer::empty_tag('input', array('type' => 'hidden', 'name' => 'thispage', 'value' => $page, 'id' => 'followingpage')); $output .= html_writer::empty_tag('input', array('type' => 'hidden', 'name' => 'nextpage', 'value' => $nextpage)); $output .= html_writer::empty_tag('input', array('type' => 'hidden', 'name' => 'timeup', 'value' => '0', 'id' => 'timeup')); $output .= html_writer::empty_tag('input', array('type' => 'hidden', 'name' => 'sesskey', 'value' => sesskey())); $output .= html_writer::empty_tag('input', array('type' => 'hidden', 'name' => 'scrollpos', 'value' => '', 'id' => 'scrollpos')); // Add a hidden field with questionids. Do this at the end of the form, so // if you navigate before the form has finished loading, it does not wipe all // the student's answers. $output .= html_writer::empty_tag('input', array('type' => 'hidden', 'name' => 'slots', 'value' => implode(',', $attemptobj->get_active_slots($page)))); // Finish the form. $output .= html_writer::end_tag('div'); $output .= html_writer::end_tag('form'); $output .= $this->connection_warning(); return $output; }
--> </style> <?php //echo "<SCRIPT language='JavaScript' SRC='$CFG->wwwroot/count/countdown.php?countto=1250744400'></SCRIPT>"; print_container_start(); echo skip_main_destination(); /// Print all the questions foreach ($attemptobj->get_question_ids($page) as $id) { $actual = $attemptobj->print_question($id, false, $attemptobj->attempt_url($id, $page)); //$actual = $attemptobj->get_actual_id($id, false, $attemptobj->attempt_url($id, $page)); saveQCAQuestions($id, $actual); } /// Print a link to the next page. echo '<div class="submitbtns">'; if ($attemptobj->is_last_page($page)) { $nextpage = -1; $nextpageforie = 'gotosummary'; } else { $nextpage = $page + 1; $nextpageforie = 'gotopage' . $nextpage; } echo '<input type="submit" name="' . $nextpageforie . '" value="' . get_string('next') . '" />'; echo "</div>"; // 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" value="' . $nextpage . '" />'; echo '<input type="hidden" name="timeup" id="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 // if you navigate before the form has finished loading, it does not wipe all