# This patch file was generated by NetBeans IDE
# This patch can be applied using context Tools: Apply Diff Patch action on respective folder.
# It uses platform neutral UTF-8 encoding.
# Above lines and this line are ignored by the patching process.
Index: moodle/mod/quiz/index.php
--- moodle/mod/quiz/index.php Base (1.46.2.12)
+++ moodle/mod/quiz/index.php Locally Modified (Based On 1.46.2.12)
@@ -43,9 +43,21 @@
         die;
     }
 
+// Check if we need the closing date header
+    $showclosingheader = false;
+    foreach ($quizzes as $quiz) {
+        if ($quiz->timeclose!=0) $showclosingheader=true;
+    }
+
 // Configure table for displaying the list of instances.
-    $headings = array(get_string('name'), get_string('quizcloses', 'quiz'));
-    $align = array('left', 'left');
+    $headings = array(get_string('name'));
+    $align = array('left');
+
+    if ($showclosingheader) {
+        array_push($headings, get_string('quizcloses', 'quiz'));
+        array_push($align, 'left');
+    }
+
     if ($course->format == 'weeks' or $course->format == 'weekscss') {
         array_unshift($headings, get_string('week'));
     } else {
@@ -99,7 +111,7 @@
         if ($quiz->timeclose) {
             $data[] = userdate($quiz->timeclose);
         } else {
-            $data[] = '';
+            if ($showclosingheader) $data[] = '';
         }
 
         if ($showing == 'stats') {
