}
// 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();
?>
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();
}
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();
}
$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();
$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();
}
protected function get_current_category($categoryandcontext) {
- global $DB;
+ global $DB, $OUTPUT;
list($categoryid, $contextid) = explode(',', $categoryandcontext);
if (!$categoryid) {
$this->print_choose_category_message($categoryandcontext);
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;
}
$html .= '<li>'.$permissionstr.'</li>';
}
$html .= '</ul>';
- print_box($html, 'boxwidthnarrow boxaligncenter generalbox');
+ echo $OUTPUT->box($html, 'boxwidthnarrow boxaligncenter generalbox');
}
$mform->display();
}
}
return array($question->id => $responses[$question->id]->responses);
}
-
+
/**
* @param object $question
* @return mixed either a integer score out of 1 that the average random
if ($isgraded) {
$grade = question_format_grade($cmoptions, $state->last_graded->grade).'/';
} else {
- $grade = '--/';
+ $grade = '--/';
}
}
$grade .= question_format_grade($cmoptions, $question->maxgrade);
$checksum = question_get_toggleflag_checksum($aid, $qid, $qsid);
$postdata = "qsid=$qsid&aid=$aid&qid=$qid&checksum=$checksum&sesskey=" . sesskey();
$flagcontent = '<input type="checkbox" id="' . $id . '" name="' . $id .
- '" value="1" ' . $checked . ' />' .
+ '" value="1" ' . $checked . ' />' .
'<label id="' . $id . 'label" for="' . $id . '">' . $this->get_question_flag_tag(
$state->flagged, $id . 'img') . '</label>' . "\n";
$PAGE->requires->js_function_call('question_flag_changer.init_flag', array($id, $postdata));
* 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 = '') {
$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 '<div class="correctness ' . $class . '">' . get_string($class, 'quiz') . '</div>';