From 02f78a2688b68216684921dbad558996e74cbe2a Mon Sep 17 00:00:00 2001
From: nicolasconnault
";
- print_table($table);
+ echo $OUTPUT->table($table);
echo $OUTPUT->footer();
?>
diff --git a/mod/survey/lib.php b/mod/survey/lib.php
index 34902e457dc..55515a62f7a 100644
--- a/mod/survey/lib.php
+++ b/mod/survey/lib.php
@@ -170,11 +170,11 @@ function survey_user_outline($course, $user, $mod, $survey) {
* @param object $survey
*/
function survey_user_complete($course, $user, $mod, $survey) {
- global $CFG, $DB;
+ global $CFG, $DB, $OUTPUT;
if (survey_already_done($survey->id, $user->id)) {
if ($survey->template == SURVEY_CIQ) { // print out answers for critical incidents
- $table = NULL;
+ $table = new html_table();
$table->align = array("left", "left");
$questions = $DB->get_records_list("survey_questions", "id", explode(',', $survey->questions));
@@ -191,7 +191,7 @@ function survey_user_complete($course, $user, $mod, $survey) {
}
$table->data[] = array("$questiontext", $answertext);
}
- print_table($table);
+ echo $OUTPUT->table($table);
} else {
@@ -463,19 +463,19 @@ function survey_count_responses($surveyid, $groupid, $groupingid) {
* @param int $courseid
*/
function survey_print_all_responses($cmid, $results, $courseid) {
-
- $table = new object();
+ global $OUTPUT;
+ $table = new html_table();
$table->head = array ("", get_string("name"), get_string("time"));
$table->align = array ("", "left", "left");
$table->size = array (35, "", "" );
foreach ($results as $a) {
- $table->data[] = array(print_user_picture($a->id, $courseid, $a->picture, false, true, false),
- "id&id=$cmid\">".fullname($a)."",
+ $table->data[] = array($OUTPUT->user_picture(moodle_user_picture::make($a, $courseid)),
+ $OUTPUT->link("report.php?action=student&student=$a->id&id=$cmid", fullname($a)),
userdate($a->time));
}
- print_table($table);
+ echo $OUTPUT->table($table);
}
/**
diff --git a/mod/survey/report.php b/mod/survey/report.php
index 2f0fdff5db4..64bfc955760 100644
--- a/mod/survey/report.php
+++ b/mod/survey/report.php
@@ -236,7 +236,7 @@
echo "
"; - print_user_picture($user->id, $course->id, $user->picture, true); + echo $OUTPUT->user_picture(moodle_user_picture::make($user->id, $course->id)); echo "
"; $questions = $DB->get_records_list("survey_questions", "id", explode(',', $survey->questions)); @@ -388,12 +389,12 @@ $question = $questions[$val]; if ($question->type == 0 or $question->type == 1) { if ($answer = survey_get_user_answer($survey->id, $question->id, $user->id)) { - $table = NULL; + $table = new html_table(); $table->head = array(get_string($question->text, "survey")); $table->align = array ("left"); $table->data[] = array(s($answer->answer1)); // no html here, just plain text - print_table($table); - print_spacer(30); + echo $OUTPUT->table($table); + echo $OUTPUT->spacer(30); } } } @@ -430,20 +431,20 @@ echo ''.get_string("downloadinfo", "survey").'
'; - echo ' '; + echo $OUTPUT->button(html_form::make_button("download.php", $options, get_string("downloadtext"))); + echo $OUTPUT->container_end(); break; diff --git a/mod/survey/view.php b/mod/survey/view.php index 89bfc558055..44691a87b54 100644 --- a/mod/survey/view.php +++ b/mod/survey/view.php @@ -90,11 +90,11 @@ $question = $questions[$val]; if ($question->type == 0 or $question->type == 1) { if ($answer = survey_get_user_answer($survey->id, $question->id, $USER->id)) { - $table = NULL; + $table = new html_table(); $table->head = array(get_string($question->text, "survey")); $table->align = array ("left"); $table->data[] = array(s($answer->answer1));//no html here, just plain text - print_table($table); + echo $OUTPUT->table($table); echo $OUTPUT->spacer(clone($spacer)) . '