$confirm = optional_param('confirm', 0, PARAM_BOOL);
if (!$confirm) {
- print_simple_box_start("center", "60%", "#FFAAAA", 20, "noticebox");
+ echo $OUTPUT->box_start("generalbox boxaligncenter boxwidthnormal errorboxcontent");
if (count($regrade_hotpots)==1) {
echo $OUTPUT->heading(get_string('regradecheck', 'hotpot', $regrade_hotpots[$regrade]->name));
. '</td></tr></table></div>'
;
- print_simple_box_end();
+ echo $OUTPUT->box_end();
echo $OUTPUT->footer();
exit;
// regrade attempts for these hotpots
foreach ($regrade_hotpots as $hotpot) {
- notify("<b>$hotpot->name</b>");
+ echo $OUTPUT->notification("<b>$hotpot->name</b>");
// delete questions and responses for this hotpot
if ($records = $DB->get_records('hotpot_questions', array('hotpot'=>$hotpot->id), '', 'id,hotpot')) {
if (!empty($CFG->hotpot_showtimes)) {
$msg .= ' ('.format_time(sprintf("%0.2f", microtime_diff($attemptstart, microtime()))).')';
}
- notify($msg);
+ echo $OUTPUT->notification($msg);
}
$hotpotcount++;
} // end foreach $hotpots
if (!empty($CFG->hotpot_showtimes)) {
$msg .= ' ('.format_time(sprintf("%0.2f", microtime_diff($hotpotstart, microtime()))).')';
}
- notify($msg);
+ echo $OUTPUT->notification($msg);
}
- notify(get_string('regradecomplete', 'quiz'));
+ echo $OUTPUT->notification(get_string('regradecomplete', 'quiz'));
} // end if $confirm
} // end regrade
* @param string $strtable
*/
function hotpot_delete_and_notify($table, $select, $params, $strtable) {
- global $DB;
+ global $DB, $OUTPUT;
$count = max(0, $DB->count_records_select($table, $select, $params));
if ($count) {
$DB->delete_records_select($table, $select, $params);
$count -= max(0, $DB->count_records_select($table, $select, $params));
if ($count) {
- notify(get_string('deleted')." $count x $strtable");
+ echo $OUTPUT->notification(get_string('deleted')." $count x $strtable");
}
}
}
);
print '<tr><td>';
- helpbutton('reportcontent', get_string('reportcontent', 'hotpot'), 'hotpot');
+ echo $OUTPUT->help_icon(moodle_help_icon::make('reportcontent', get_string('reportcontent', 'hotpot'), 'hotpot'));
print '</td><th align="right" scope="col">'.get_string('reportcontent', 'hotpot').':</th><td colspan="7">';
foreach ($menus as $name => $options) {
$value = $formdata[$name];
);
print '<tr><td>';
- helpbutton('reportformat', get_string('reportformat', 'hotpot'), 'hotpot');
+ echo $OUTPUT->help_icon(moodle_help_icon::make('reportformat', get_string('reportformat', 'hotpot'), 'hotpot'));
print '</td>';
foreach ($menus as $name => $options) {
$value = $formdata[$name];
}
}
function print_html_start(&$table) {
-
+ global $OUTPUT;
// default class for the table
if (empty($table->tableclass)) {
$table->tableclass = 'generaltable';
print $table->start."\n";
}
- print_simple_box_start("$table->tablealign", "$table->width", "#ffffff", 0);
+ echo $OUTPUT->box_start("generalbox boxalign$table->tablealign");
print '<table width="100%" border="'.$table->border.'" valign="top" align="center" cellpadding="'.$table->cellpadding.'" cellspacing="'.$table->cellspacing.'" class="'.$table->tableclass.'">'."\n";
if (isset($table->caption)) {
}
}
function print_html_finish(&$table) {
+ global $OUTPUT;
print "</table>\n";
- print_simple_box_end();
+ echo $OUTPUT->box_end();
if (isset($table->finish)) {
print $table->finish."\n";
return true;
}
function create_responses_table(&$hotpot, &$course, &$users, &$attempts, &$questions, &$options, &$tables) {
- global $CFG;
+ global $CFG, $OUTPUT;
$is_html = ($options['reportformat']=='htm');
// shortcuts for font tags
$br = $is_html ? "<br />\n" : "\n";
if (empty($table->caption)) {
$table->caption = get_string('indivresp', 'quiz');
if ($is_html) {
- $table->caption .= helpbutton('responsestable', $table->caption, 'hotpot', true, false, '', true);
+ $table->caption .= $OUTPUT->help_icon(moodle_help_icon::make('responsestable', $table->caption, 'hotpot'));
}
}
$hints = empty($response->hints) ? 0 : $response->hints;
$tables[] = &$table;
}
function create_analysis_table(&$users, &$attempts, &$questions, &$options, &$tables) {
+ global $OUTPUT;
$is_html = ($options['reportformat']=='htm');
// the fields we are interested in, in the order we want them
$fields = array('correct', 'wrong', 'ignored', 'hints', 'clues', 'checks', 'weighting');
$br = $is_html ? '<br />' : "\n";
$space = $is_html ? ' ' : "";
$no_value = $is_html ? '--' : "";
- $help_button = $is_html ? helpbutton("discrimination", get_string('discrimination', 'quiz'), "quiz", true, false, "", true) : "";
+ $help_button = $is_html ? $OUTPUT->help_icon(moodle_help_icon::make("discrimination", get_string('discrimination', 'quiz'), "quiz")) : "";
// table properties
unset($table);
$table->border = 1;
$table->width = '100%';
$table->caption = get_string('itemanal', 'quiz');
if ($is_html) {
- $table->caption .= helpbutton('analysistable', $table->caption, 'hotpot', true, false, '', true);
+ $table->caption .= $OUTPUT->help_icon(moodle_help_icon::make('analysistable', $table->caption, 'hotpot'));
}
// initialize legend, if necessary
if (!empty($options['reportshowlegend'])) {
///////////////////////////
function hotpot_print_attempt_summary(&$hotpot, &$attempt) {
// start table
- print_simple_box_start("center", "80%", "#ffffff", 0);
+ global $OUTPUT;
+ echo $OUTPUT->box_start("generalbox boxaligncenter boxwidthwide");
print '<table width="100%" border="1" valign="top" align="center" cellpadding="2" cellspacing="2" class="generaltable">'."\n";
// add attempt properties
$fields = array('attempt', 'score', 'penalties', 'status', 'timetaken', 'timerecorded');
}
// finish table
print '</table>';
- print_simple_box_end();
+ echo $OUTPUT->box_end();
}
function hotpot_print_review_buttons(&$course, &$hotpot, &$attempt, $context) {
global $DB;
print "</table>\n";
}
function hotpot_print_attempt_details(&$hotpot, &$attempt) {
- global $DB;
+ global $DB, $OUTPUT;
// define fields to print
$textfields = array('correct', 'ignored', 'wrong');
}
$colspan = max(2, $colspan);
// start table of questions and responses
- print_simple_box_start("center", "80%", "#ffffff", 0);
+ echo $OUTPUT->box_start("generalbox boxaligncenter boxwidthwide");
print '<table width="100%" border="1" valign="top" align="center" cellpadding="2" cellspacing="2" class="generaltable">'."\n";
if (empty($q)) {
print '<tr><td align="center" class="generaltablecell"><b>'.get_string("noresponses", "hotpot")."</b></td></tr>\n";
}
// finish table
print "</table>\n";
- print_simple_box_end();
+ echo $OUTPUT->box_end();
}
?>
//]]>
</script>
<?php
- print_simple_box_start("center", "96%");
+ echo $OUTPUT->box_start("generalbox boxaligncenter boxwidthwide");
if($hp = new hotpot_xml_quiz($params)) {
print '<pre id="contents">';
switch ($params->action) {
}
print '</pre>';
} else {
- print_simple_box("Could not open Hot Potatoes XML file", "center", "", "#FFBBBB");
+ echo $OUTPUT->box("Could not open Hot Potatoes XML file", "errorboxcontent generalbox");
}
- print_simple_box_end();
+ echo $OUTPUT->box_end();
print '<br />';
echo $OUTPUT->close_window_button();
?>
$boxalign = 'center';
$boxwidth = 500;
if (trim(strip_tags($hotpot->summary))) {
- print_simple_box_start($boxalign, $boxwidth);
+ echo $OUTPUT->box_start("generalbox boxalign$boxalign");
print '<div class="mdl-align">'.format_text($hotpot->summary)."</div>\n";
- print_simple_box_end();
+ echo $OUTPUT->box_end();
print "<br />\n";
}
print '<form id="passwordform" method="post" action="view.php?id='.$cm->id.'">'."\n";
- print_simple_box_start($boxalign, $boxwidth);
+ echo $OUTPUT->box_start("generalbox boxalign$boxalign");
print '<div class="mdl-align">';
print get_string('requirepasswordmessage', 'quiz').'<br /><br />';
print '<b>'.get_string('password').':</b> ';
print '<input name="hppassword" type="password" value="" /> ';
print '<input type="submit" value="'.get_string("ok").'" /> ';
print "</div>\n";
- print_simple_box_end();
+ echo $OUTPUT->box_end();
print "</form>\n";
echo $OUTPUT->footer();
exit;
print_header($title, $heading, $navigation, "", $head.$styles.$scripts, true, $button, $loggedinas, false, $body_tags
);
if (!empty($available_msg)) {
- notify($available_msg);
+ echo $OUTPUT->notification($available_msg);
}
print $body.$footer;
break;
$loggedinas, false, $body_tags
);
if (!empty($available_msg)) {
- notify($available_msg);
+ echo $OUTPUT->notification($available_msg);
}
print "<iframe id=\"$iframe_id\" src=\"view.php?id=$cm->id&framename=main\" height=\"100%\" width=\"100%\">";
print "<ilayer name=\"$iframe_id\" src=\"view.php?id=$cm->id&framename=main\" height=\"100%\" width=\"100%\">";