}
public function process_actions_needing_ui() {
- global $DB;
+ global $DB, $OUTPUT;
if (optional_param('deleteselected', false, PARAM_BOOL)) {
// make a list of all the questions that are selected
$rawquestions = $_REQUEST; // This code is called by both POST forms and GET links, so cannot use data_submitted.
if ($inuse) {
$questionnames .= '<br />'.get_string('questionsinuse', 'quiz');
}
- notice_yesno(get_string("deletequestionscheck", "quiz", $questionnames),
- $this->baseurl->out_action(),
- $this->baseurl->out(true),
- array('deleteselected'=>$questionlist, 'confirm'=>md5($questionlist)),
- $this->baseurl->params(), 'post', 'get');
+ echo $OUTPUT->confirm(get_string("deletequestionscheck", "quiz", $questionnames),
+ $this->baseurl->out_action(array('deleteselected'=>$questionlist, 'confirm'=>md5($questionlist))),
+ $this->baseurl);
return true;
}
global $CFG, $PAGE, $OUTPUT;
static $choiceformprinted = false;
$params['category'] = $categoryid;
- print_single_button($CFG->wwwroot . '/question/addquestion.php', $params,
- $caption,'get', '', false, $tooltip, $disabled);
+ $form = html_form::make_button($CFG->wwwroot . '/question/addquestion.php', $params, $caption,'get');
+ $form->button->title = $tooltip;
+ $form->button->disabled = $disabled;
+ echo $OUTPUT->button($form);
+
echo $OUTPUT->help_icon(moodle_help_icon::make('types', get_string('createnewquestion', 'question'), 'question'));
$PAGE->requires->yui_lib('dragdrop');
$PAGE->requires->yui_lib('container');
}
if (!empty($result->noticeyesno)) {
- notice_yesno($result->noticeyesno, "question.php?id=$question->id&courseid={$course->id}",
- "edit.php?courseid={$course->id}");
+ echo $OUTPUT->confirm($result->noticeyesno, "question.php?id=$question->id&courseid={$course->id}",
+ "edit.php?courseid={$course->id}");
echo $OUTPUT->footer();
exit;
}
* Used by print_question()
*/
function history($question, $state, $number, $cmoptions, $options) {
- global $DB;
+ global $DB, $OUTPUT;
$history = '';
if(isset($options->history) and $options->history) {
if ($options->history == 'all') {
}
if (count($states) > 1) {
$strreviewquestion = get_string('reviewresponse', 'quiz');
- $table = new stdClass;
+ $table = new html_table();
$table->width = '100%';
if ($options->scores) {
$table->head = array (
);
}
}
- $history = print_table($table, true);
+ $history = $OUTPUT->table($table);
}
}
return $history;