diff --git a/course/view.php b/course/view.php index b21293dc10f..766a52aa88d 100644 --- a/course/view.php +++ b/course/view.php @@ -95,7 +95,7 @@ function print_side_block($heading="", $list=NULL, $footer="", $icons=NULL) { } else { echo ""; } - echo "\n
$string
"; echo "$choice->section
", - "", - "$aa
"); + if ($course->format == "weeks" || $course->format == "topics") { + $table->data[] = array ("$choice->section", + "coursemodule\">$choice->name", + "$aa"); + } else { + $table->data[] = array ("coursemodule\">$choice->name", + "$aa"); + } } print_table($table); diff --git a/mod/survey/index.php b/mod/survey/index.php index 42e95218a22..71f4d6d186c 100644 --- a/mod/survey/index.php +++ b/mod/survey/index.php @@ -21,8 +21,16 @@ notice("There are no surveys.", "../../course/view.php?id=$course->id"); } - $table->head = array ("Week", "Name", "Status"); - $table->align = array ("CENTER", "LEFT", "LEFT"); + if ($course->format == "weeks") { + $table->head = array ("Week", "Name", "Status"); + $table->align = array ("CENTER", "LEFT", "LEFT"); + } else if ($course->format == "topics") { + $table->head = array ("Topic", "Name", "Status"); + $table->align = array ("CENTER", "LEFT", "LEFT"); + } else { + $table->head = array ("Name", "Status"); + $table->align = array ("LEFT", "LEFT"); + } foreach ($surveys as $survey) { if (survey_already_done($survey->id, $USER->id)) { @@ -30,9 +38,14 @@ } else { $ss = "coursemodule\">Not done yet"; } - $table->data[] = array ("$survey->section", - "coursemodule\">$survey->name", - "$ss"); + if ($course->format == "weeks" or $course->format == "topics") { + $table->data[] = array ("$survey->section", + "coursemodule\">$survey->name", + "$ss"); + } else { + $table->data[] = array ("coursemodule\">$survey->name", + "$ss"); + } } print_table($table);