$timenow = time();
- $table->head = array ("Week", "Question", "Answer");
- $table->align = array ("CENTER", "LEFT", "CENTER");
+ if ($course->format == "weeks") {
+ $table->head = array ("Week", "Question", "Answer");
+ $table->align = array ("CENTER", "LEFT", "LEFT");
+ } else if ($course->format == "topics") {
+ $table->head = array ("Topic", "Question", "Answer");
+ $table->align = array ("CENTER", "LEFT", "LEFT");
+ } else {
+ $table->head = array ("Question", "Answer");
+ $table->align = array ("LEFT", "LEFT");
+ }
foreach ($choices as $choice) {
$answer = $answers[$choice->id];
break;
}
- $table->data[] = array ("<P>$choice->section</P>",
- "<P><A HREF=\"view.php?id=$choice->coursemodule\">$choice->name</A></P>",
- "<P>$aa</P>");
+ if ($course->format == "weeks" || $course->format == "topics") {
+ $table->data[] = array ("$choice->section",
+ "<A HREF=\"view.php?id=$choice->coursemodule\">$choice->name</A>",
+ "$aa");
+ } else {
+ $table->data[] = array ("<A HREF=\"view.php?id=$choice->coursemodule\">$choice->name</A>",
+ "$aa");
+ }
}
print_table($table);
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)) {
} else {
$ss = "<A HREF=\"view.php?id=$survey->coursemodule\">Not done yet</A>";
}
- $table->data[] = array ("$survey->section",
- "<A HREF=\"view.php?id=$survey->coursemodule\">$survey->name</A>",
- "$ss");
+ if ($course->format == "weeks" or $course->format == "topics") {
+ $table->data[] = array ("$survey->section",
+ "<A HREF=\"view.php?id=$survey->coursemodule\">$survey->name</A>",
+ "$ss");
+ } else {
+ $table->data[] = array ("<A HREF=\"view.php?id=$survey->coursemodule\">$survey->name</A>",
+ "$ss");
+ }
}
print_table($table);