$mform = new configureScanningProcessForm(); $mform->_form->addElement('hidden', 'id', $id); $mform->_form->addElement('hidden', 'a', $a); if (!$mform->is_cancelled() && ($data = $mform->get_data())) { //this branch is where you process validated data. $data->blended = $blended->id; start_recognition_process($data, $course); // Print the main part of the page ---------------------------------- echo $OUTPUT->spacer(array('height' => 20)); echo $OUTPUT->heading(format_string(get_string('scan', 'blended'))); echo $OUTPUT->box(format_text(get_string('inserted', 'blended')), 'generalbox', 'intro'); echo $OUTPUT->spacer(array('height' => 20)); echo $OUTPUT->continue_button('correction.php?a=' . $a); } else { $currentpage = "scan.php"; show_scan_jobs($currentpage, $context, $blended); // Print the main part of the page ---------------------------------- echo $OUTPUT->spacer(array('height' => 20)); echo $OUTPUT->heading(format_string(get_string('scan', 'blended'))); echo $OUTPUT->box(format_text(get_string('scanpagedesc', 'blended')), 'generalbox', 'intro'); echo $OUTPUT->spacer(array('height' => 20)); // Formulario de opciones if ($mform->is_cancelled()) { //you need this section if you have a cancel button on your form //here you tell php what to do if your user presses cancel //probably a redirect is called for! $continue = "{$CFG->wwwroot}/mod/blended/view.php?id={$course->id}"; echo $strprocesscancelled; echo $OUTPUT->continue($continue); } else { $mform->display();
// print_header("$course->shortname: $blended->name: $strcorrectionpage", "$course->shortname",$navigation, // "", "", true, update_module_button($cm->id, $course->id, $blended->name, $strcorrectionpage), // navmenu($course, $cm)); echo $OUTPUT->header(); echo $OUTPUT->spacer(array('height' => 20)); echo $OUTPUT->box(format_text($strtable), 'generalbox', 'intro'); echo $OUTPUT->spacer(array('height' => 20)); // Print the main part of the page ---------------------------------- echo $OUTPUT->spacer(array('height' => 20)); echo $OUTPUT->heading(format_string(get_string('correction', 'blended'))); echo $OUTPUT->box(format_text(get_string('selectquiz', 'blended')), 'generalbox', 'intro'); echo $OUTPUT->spacer(array('height' => 20)); $currentpage = "correction.php"; /** * Show a list of quizzes */ show_quizzes($currentpage, $context, $blended); /** * Show a list of Scans */ echo $OUTPUT->box(format_text(get_string('correctionpagedesc', 'blended')), 'generalbox', 'intro'); echo $OUTPUT->spacer(array('height' => 20)); $arewaiting = show_scan_jobs($currentpage, $context, $blended); if ($arewaiting == true) { echo '<script type="text/JavaScript">setTimeout("location.reload(true);", 1000*60);</script>'; } echo "<center>"; // helpbutton($page='correction', get_string('pagehelp','blended'), $module='blended', $image=true, $linktext=true, $text='', $return=false,$imagetext=''); echo $OUTPUT->help_icon('pagehelp', 'blended'); echo "</center>"; echo $OUTPUT->footer();