From: nicolasconnault Date: Mon, 10 Aug 2009 05:01:23 +0000 (+0000) Subject: MDL-19820 Converted print_box* to $OUTPUT->box* X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=beb677cda6505c5fe4672792680d77559d54fb16;p=moodle.git MDL-19820 Converted print_box* to $OUTPUT->box* --- diff --git a/question/addquestion.php b/question/addquestion.php index cdba0607ec..0f6599dde4 100644 --- a/question/addquestion.php +++ b/question/addquestion.php @@ -96,9 +96,9 @@ if ($cm !== null) { } // Display a form to choose the question type. -print_box_start('generalbox boxwidthnormal boxaligncenter', 'chooseqtypebox'); +echo $OUTPUT->box_start('generalbox boxwidthnormal boxaligncenter', 'chooseqtypebox'); print_choose_qtype_to_add_form($hiddenparams); -print_box_end(); +echo $OUTPUT->box_end(); echo $OUTPUT->footer(); ?> diff --git a/question/category_class.php b/question/category_class.php index 65eb1fa4d6..10203b27a1 100644 --- a/question/category_class.php +++ b/question/category_class.php @@ -260,10 +260,10 @@ class question_category_object { foreach ($this->editlists as $context => $list){ $listhtml = $list->to_html(0, array('str'=>$this->str)); if ($listhtml){ - print_box_start('boxwidthwide boxaligncenter generalbox questioncategories contextlevel' . $list->context->contextlevel); + echo $OUTPUT->box_start('boxwidthwide boxaligncenter generalbox questioncategories contextlevel' . $list->context->contextlevel); echo $OUTPUT->heading(get_string('questioncatsfor', 'question', print_context_name(get_context_instance_by_id($context))), 3); echo $listhtml; - print_box_end(); + echo $OUTPUT->box_end(); } } echo $list->display_page_numbers(); @@ -369,10 +369,11 @@ class question_category_object { } public function display_move_form($questionsincategory, $category){ + global $OUTPUT; $vars = new stdClass; $vars->name = $category->name; $vars->count = $questionsincategory; - print_box(get_string('categorymove', 'quiz', $vars), 'generalbox boxaligncenter'); + echo $OUTPUT->box(get_string('categorymove', 'quiz', $vars), 'generalbox boxaligncenter'); $this->moveform->display(); } diff --git a/question/contextmove.php b/question/contextmove.php index f742b2db2f..1662132b76 100644 --- a/question/contextmove.php +++ b/question/contextmove.php @@ -235,9 +235,9 @@ $cattomove->toareaname = $toareaname; $cattomove->fromareaname = $fromareaname; - print_box(get_string('movingcategoryandfiles', 'question', $cattomove), 'boxwidthnarrow boxaligncenter generalbox'); + echo $OUTPUT->box(get_string('movingcategoryandfiles', 'question', $cattomove), 'boxwidthnarrow boxaligncenter generalbox'); } else { - print_box(get_string('movingcategorynofiles', 'question', $cattomove), 'boxwidthnarrow boxaligncenter generalbox'); + echo $OUTPUT->box(get_string('movingcategorynofiles', 'question', $cattomove), 'boxwidthnarrow boxaligncenter generalbox'); } $contextmoveform->display(); echo $OUTPUT->footer(); diff --git a/question/contextmoveq.php b/question/contextmoveq.php index f2fa3fefe9..6620e07856 100644 --- a/question/contextmoveq.php +++ b/question/contextmoveq.php @@ -235,9 +235,9 @@ if (count($urls)){ $questionsstr->toareaname = $toareaname; - print_box(get_string('movingquestionsandfiles', 'question', $questionsstr), 'boxwidthnarrow boxaligncenter generalbox'); + echo $OUTPUT->box(get_string('movingquestionsandfiles', 'question', $questionsstr), 'boxwidthnarrow boxaligncenter generalbox'); } else { - print_box(get_string('movingquestionsnofiles', 'question', $questionsstr), 'boxwidthnarrow boxaligncenter generalbox'); + echo $OUTPUT->box(get_string('movingquestionsnofiles', 'question', $questionsstr), 'boxwidthnarrow boxaligncenter generalbox'); } $contextmoveform->display(); echo $OUTPUT->footer(); diff --git a/question/editlib.php b/question/editlib.php index 97dca302d5..f833bc72bf 100644 --- a/question/editlib.php +++ b/question/editlib.php @@ -1130,7 +1130,7 @@ class question_bank_view { } protected function get_current_category($categoryandcontext) { - global $DB; + global $DB, $OUTPUT; list($categoryid, $contextid) = explode(',', $categoryandcontext); if (!$categoryid) { $this->print_choose_category_message($categoryandcontext); @@ -1139,9 +1139,9 @@ class question_bank_view { if (!$category = $DB->get_record('question_categories', array('id' => $categoryid, 'contextid' => $contextid))) { - print_box_start('generalbox questionbank'); + echo $OUTPUT->box_start('generalbox questionbank'); notify('Category not found!'); - print_box_end(); + echo $OUTPUT->box_end(); return false; } diff --git a/question/type/questiontype.php b/question/type/questiontype.php index c6935cbfd9..abf79ef754 100644 --- a/question/type/questiontype.php +++ b/question/type/questiontype.php @@ -247,7 +247,7 @@ class default_questiontype { $html .= '
  • '.$permissionstr.'
  • '; } $html .= ''; - print_box($html, 'boxwidthnarrow boxaligncenter generalbox'); + echo $OUTPUT->box($html, 'boxwidthnarrow boxaligncenter generalbox'); } $mform->display(); } @@ -710,7 +710,7 @@ class default_questiontype { } return array($question->id => $responses[$question->id]->responses); } - + /** * @param object $question * @return mixed either a integer score out of 1 that the average random @@ -934,7 +934,7 @@ class default_questiontype { if ($isgraded) { $grade = question_format_grade($cmoptions, $state->last_graded->grade).'/'; } else { - $grade = '--/'; + $grade = '--/'; } } $grade .= question_format_grade($cmoptions, $question->maxgrade); @@ -983,7 +983,7 @@ class default_questiontype { $checksum = question_get_toggleflag_checksum($aid, $qid, $qsid); $postdata = "qsid=$qsid&aid=$aid&qid=$qid&checksum=$checksum&sesskey=" . sesskey(); $flagcontent = '' . + '" value="1" ' . $checked . ' />' . '' . "\n"; $PAGE->requires->js_function_call('question_flag_changer.init_flag', array($id, $postdata)); @@ -1000,7 +1000,7 @@ class default_questiontype { * Work out the actual img tag needed for the flag * * @param boolean $flagged whether the question is currently flagged. - * @param string $id an id to be added as an attribute to the img (optional). + * @param string $id an id to be added as an attribute to the img (optional). * @return string the img tag. */ protected function get_question_flag_tag($flagged, $id = '') { @@ -1178,7 +1178,7 @@ class default_questiontype { $grade->raw = question_format_grade($cmoptions, $state->last_graded->raw_grade); // let student know wether the answer was correct - $class = question_get_feedback_class($state->last_graded->raw_grade / + $class = question_get_feedback_class($state->last_graded->raw_grade / $question->maxgrade); echo '
    ' . get_string($class, 'quiz') . '
    ';