From 8de9f89a568d1729fb2b94e2dba7c7dcc46abebc Mon Sep 17 00:00:00 2001 From: tjhunt Date: Wed, 31 Oct 2007 16:42:02 +0000 Subject: [PATCH] MDL-11624 - /mod/quiz/index.php too dependant on individual course format names. I basically changed it to do the same as the forum module. Merged from MOODLE_18_STABLE. --- mod/quiz/index.php | 31 +++++++++++-------------------- 1 file changed, 11 insertions(+), 20 deletions(-) diff --git a/mod/quiz/index.php b/mod/quiz/index.php index 54d19c7360..f2581761d6 100644 --- a/mod/quiz/index.php +++ b/mod/quiz/index.php @@ -47,32 +47,25 @@ // Configure table for displaying the list of instances. $headings = array(get_string('name'), get_string('quizcloses', 'quiz')); $align = array('left', 'left'); - $colsize = array('', ''); - if ($course->format == "weeks" || $course->format == "weekscss") { + if ($course->format == 'weeks' or $course->format == 'weekscss') { array_unshift($headings, get_string('week')); - array_unshift($align, 'center'); - array_unshift($colsize, 10); - } else if ($course->format == "topics") { - array_unshift($headings, get_string('topic')); - array_unshift($align, 'center'); - array_unshift($colsize, 10); + } else { + array_unshift($headings, get_string('section')); } + array_unshift($align, 'center'); if (has_capability('mod/quiz:viewreports', $coursecontext)) { array_push($headings, get_string('attempts', 'quiz')); array_push($align, 'left'); - array_push($colsize, ''); $showing = 'stats'; } else if (has_capability('mod/quiz:attempt', $coursecontext)) { array_push($headings, get_string('bestgrade', 'quiz'), get_string('feedback', 'quiz')); array_push($align, 'left', 'left'); - array_push($colsize, '', ''); $showing = 'scores'; } $table->head = $headings; $table->align = $align; - $table->size = $colsize; // Poplate the table with the list of instances. $currentsection = ''; @@ -84,16 +77,14 @@ // Section number if necessary. $strsection = ''; - if ($course->format == "weeks" || $course->format == "weekscss" || $course->format == "topics") { - if ($quiz->section !== $currentsection) { - if ($quiz->section) { - $strsection = $quiz->section; - } - if ($currentsection !== "") { - $table->data[] = 'hr'; - } - $currentsection = $quiz->section; + if ($quiz->section != $currentsection) { + if ($quiz->section) { + $strsection = $quiz->section; + } + if ($currentsection) { + $learningtable->data[] = 'hr'; } + $currentsection = $quiz->section; } $data[] = $strsection; -- 2.39.5