quiz MDL-21533 remove all mention of overlib from the quiz, by moving necessary code to qtype_multianswer, which is the only place it is used.
This commit is contained in:
@@ -87,10 +87,6 @@
|
||||
$attemptobj->load_question_states($questionids);
|
||||
|
||||
/// Print the quiz page ////////////////////////////////////////////////////////
|
||||
$PAGE->requires->js('/lib/overlib/overlib.js', true);
|
||||
$PAGE->requires->js('/lib/overlib/overlib_cssstyle.js', true);
|
||||
|
||||
|
||||
|
||||
// Arrange for the navigation to be displayed.
|
||||
$navbc = $attemptobj->get_navigation_panel('quiz_attempt_nav_panel', $page);
|
||||
@@ -112,7 +108,6 @@
|
||||
$PAGE->set_title(format_string($attemptobj->get_quiz_name()));
|
||||
echo $OUTPUT->header();
|
||||
}
|
||||
echo '<div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div>'; // for overlib
|
||||
|
||||
if ($attemptobj->is_preview_user()) {
|
||||
|
||||
|
||||
@@ -53,12 +53,8 @@ class quiz_grading_report extends quiz_default_report {
|
||||
$viewoptions += array('gradenextungraded'=> $gradenextungraded);
|
||||
}
|
||||
|
||||
|
||||
$this->cm = $cm;
|
||||
|
||||
echo html_writer::script('', $CFG->wwwroot.'/lib/overlib/overlib.js');
|
||||
echo html_writer::script('', $CFG->wwwroot.'/lib/overlib/overlib_cssstyle.js');
|
||||
|
||||
$this->print_header_and_tabs($cm, $course, $quiz, $reportmode="grading");
|
||||
|
||||
// Check permissions
|
||||
@@ -110,8 +106,6 @@ class quiz_grading_report extends quiz_default_report {
|
||||
|
||||
add_to_log($course->id, "quiz", "manualgrading", "report.php?mode=grading&q=$quiz->id", "$quiz->id", "$cm->id");
|
||||
|
||||
echo '<div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div>'; // for overlib
|
||||
|
||||
if ($data = data_submitted()) { // post data submitted, process it
|
||||
if (confirm_sesskey() && $this->users){
|
||||
|
||||
|
||||
@@ -90,9 +90,6 @@
|
||||
$firstregion = reset($PAGE->blocks->get_regions());
|
||||
$PAGE->blocks->add_pretend_block($navbc, $firstregion);
|
||||
|
||||
$PAGE->requires->js('/lib/overlib/overlib.js', true);
|
||||
$PAGE->requires->js('/lib/overlib/overlib_cssstyle.js', true);
|
||||
|
||||
/// Print the page header
|
||||
$headtags = $attemptobj->get_html_head_contributions($page);
|
||||
if ($accessmanager->securewindow_required($attemptobj->is_preview_user())) {
|
||||
@@ -108,7 +105,6 @@
|
||||
$PAGE->set_heading($attemptobj->get_course()->fullname);
|
||||
echo $OUTPUT->header();
|
||||
}
|
||||
echo '<div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div>'; // for overlib
|
||||
|
||||
/// Print heading.
|
||||
if ($attemptobj->is_preview_user() && $attemptobj->is_own_attempt()) {
|
||||
|
||||
@@ -67,15 +67,11 @@
|
||||
($stateid ? '&state=' . $stateid : ''),
|
||||
$attemptobj->get_quizid(), $attemptobj->get_cmid());
|
||||
|
||||
$PAGE->requires->js('/lib/overlib/overlib.js', true);
|
||||
$PAGE->requires->js('/lib/overlib/overlib_cssstyle.js', true);
|
||||
|
||||
/// Print the page header
|
||||
$attemptobj->get_question_html_head_contributions($questionid);
|
||||
$PAGE->set_title($attemptobj->get_course()->shortname . ': '.format_string($attemptobj->get_quiz_name()));
|
||||
$PAGE->set_heading($COURSE->fullname);
|
||||
echo $OUTPUT->header();
|
||||
echo '<div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div>'; // for overlib
|
||||
|
||||
/// Print infobox
|
||||
$rows = array();
|
||||
|
||||
@@ -276,9 +276,22 @@ class embedded_cloze_qtype extends default_questiontype {
|
||||
return $details;
|
||||
}
|
||||
|
||||
function get_html_head_contributions(&$question, &$state) {
|
||||
global $PAGE;
|
||||
parent::get_html_head_contributions($question, $state);
|
||||
$PAGE->requires->js('/lib/overlib/overlib.js', true);
|
||||
$PAGE->requires->js('/lib/overlib/overlib_cssstyle.js', true);
|
||||
}
|
||||
|
||||
function print_question_formulation_and_controls(&$question, &$state, $cmoptions, $options) {
|
||||
global $QTYPES, $CFG, $USER, $OUTPUT, $PAGE;
|
||||
|
||||
static $overlibdivoutput = false;
|
||||
if (!$overlibdivoutput) {
|
||||
echo '<div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div>'; // for overlib
|
||||
$overlibdivoutput = true;
|
||||
}
|
||||
|
||||
$readonly = empty($options->readonly) ? '' : 'readonly="readonly"';
|
||||
$disabled = empty($options->readonly) ? '' : 'disabled="disabled"';
|
||||
$formatoptions = new stdClass;
|
||||
@@ -306,11 +319,6 @@ class embedded_cloze_qtype extends default_questiontype {
|
||||
|
||||
// The regex will recognize text snippets of type {#X}
|
||||
// where the X can be any text not containg } or white-space characters.
|
||||
|
||||
// TODO: stop using overlib, use YUI instead
|
||||
echo html_writer::script('', $CFG->wwwroot.'/lib/overlib/overlib.js');
|
||||
echo html_writer::script('', $CFG->wwwroot.'/lib/overlib/overlib_cssstyle.js');
|
||||
|
||||
while (preg_match('~\{#([^[:space:]}]*)}~', $qtextremaining, $regs)) {
|
||||
$qtextsplits = explode($regs[0], $qtextremaining, 2);
|
||||
echo $qtextsplits[0];
|
||||
|
||||
Reference in New Issue
Block a user