* @param object $question
*/
function survey_print_single($question) {
- global $DB, $qnum;
+ global $DB, $qnum, $OUTPUT;
$rowclass = survey_question_rowclass(0);
} else if ($question->type < 0) { // Choose several of a number
$options = explode( ",", $question->options);
- notify("This question type not supported yet");
+ echo $OUTPUT->notification("This question type not supported yet");
}
echo "</td></tr></table>";
$groupingid = $cm->groupingid;
- print_simple_box_start("center");
+ echo $OUTPUT->box_start("generalbox boxaligncenter");
if ($showscales) {
echo "<a href=\"report.php?action=summary&id=$id\">$strsummary</a>";
echo " <a href=\"report.php?action=scales&id=$id\">$strscales</a>";
$action = "questions";
}
}
- print_simple_box_end();
+ echo $OUTPUT->box_end();
$spacer = new html_image();
$spacer->height = 30;
survey_print_graph("id=$id&group=$currentgroup&type=overall.png");
echo "</a></div>";
} else {
- notify(get_string("nobodyyet","survey"));
+ echo $OUTPUT->notification(get_string("nobodyyet","survey"));
}
break;
echo $OUTPUT->heading($strscales);
if (! $results = survey_get_responses($survey->id, $currentgroup, $groupingid) ) {
- notify(get_string("nobodyyet","survey"));
+ echo $OUTPUT->notification(get_string("nobodyyet","survey"));
} else {
}
if (! $results = survey_get_responses($survey->id, $currentgroup, $groupingid) ) {
- notify(get_string("nobodyyet","survey"));
+ echo $OUTPUT->notification(get_string("nobodyyet","survey"));
} else {
echo $OUTPUT->heading(get_string("analysisof", "survey", get_string('participants')));
if (! $results = survey_get_responses($survey->id, $currentgroup, $groupingid) ) {
- notify(get_string("nobodyyet","survey"));
+ echo $OUTPUT->notification(get_string("nobodyyet","survey"));
} else {
survey_print_all_responses($cm->id, $results, $course->id);
}
if ($notes != '' and confirm_sesskey()) {
if (survey_get_analysis($survey->id, $user->id)) {
if (! survey_update_analysis($survey->id, $user->id, $notes)) {
- notify("An error occurred while saving your notes. Sorry.");
+ echo $OUTPUT->notification("An error occurred while saving your notes. Sorry.");
} else {
- notify(get_string("savednotes", "survey"));
+ echo $OUTPUT->notification(get_string("savednotes", "survey"));
}
} else {
if (! survey_add_analysis($survey->id, $user->id, $notes)) {
- notify("An error occurred while saving your notes. Sorry.");
+ echo $OUTPUT->notification("An error occurred while saving your notes. Sorry.");
} else {
- notify(get_string("savednotes", "survey"));
+ echo $OUTPUT->notification(get_string("savednotes", "survey"));
}
}
}
}
if (isguest()) {
- notify(get_string("guestsnotallowed", "survey"));
+ echo $OUTPUT->notification(get_string("guestsnotallowed", "survey"));
}
echo '<div>';
echo "<input type=\"hidden\" name=\"id\" value=\"$id\" />";
- print_simple_box(format_module_intro('survey', $survey, $cm->id), 'center', '70%', '', 5, 'generalbox', 'intro');
+ echo $OUTPUT->box(format_module_intro('survey', $survey, $cm->id), 'generalbox boxaligncenter bowidthnormal', 'intro');
// Get all the major questions and their proper order
if (! $questions = $DB->get_records_list("survey_questions", "id", explode(',', $survey->questions))) {