diff -Naur moodle/mod/quiz/attempt.php moodle-working/mod/quiz/attempt.php
--- moodle/mod/quiz/attempt.php	2008-10-02 20:20:06.000000000 -0400
+++ moodle-working/mod/quiz/attempt.php	2008-12-03 09:56:29.000000000 -0500
@@ -400,6 +400,15 @@
         quiz_send_notification_emails($course, $quiz, $attempt, $context, $cm);
     }
 
+    // check the quiz times
+    if ($timestamp < $quiz->timeopen || ($quiz->timeclose and $timestamp > $quiz->timeclose) and $quiz->preventlatesubmissions ) {
+        if ($isteacher) {
+            notify(get_string('notavailabletostudents', 'quiz'));
+        } else {
+            notice(get_string('notavailable', 'quiz'), "view.php?id={$cm->id}");
+        }
+    }
+
     if ($finishattempt) {
         if (!empty($SESSION->passwordcheckedquizzes[$quiz->id])) {
             unset($SESSION->passwordcheckedquizzes[$quiz->id]);
@@ -408,7 +417,7 @@
     }
 
 // Now is the right time to check the open and close times.
-    if (!$ispreviewing && ($timestamp < $quiz->timeopen || ($quiz->timeclose && $timestamp > $quiz->timeclose))) {
+    if (!$ispreviewing && ($timestamp < $quiz->timeopen || ($quiz->timeclose && $timestamp > $quiz->timeclose)) && $quiz->preventlatesubmissions) {
         print_error('notavailable', 'quiz', "view.php?id={$cm->id}");
     }
 
@@ -537,6 +546,21 @@
         $timerstartvalue = min($timerstartvalue, $attempt->timestart + $quiz->timelimit*60- time());
         $showtimer = true;
     }
+    
+	// Quizzes that allow late submissions will only show a timer if
+    // there is a time limit set on the quiz.
+    // Since late submissions are allowed, disregard the close time
+    // and always show the time limit itself.
+    // @author Brett Profitt <brett.profitt@eschoolconsultants.com>
+	if (!$quiz->preventlatesubmissions) {
+		if ($quiz->timelimit > 0) {
+			$showtimer = true;
+			$timerstartvalue = $quiz->timelimit * 60;
+		} else {
+			$showtimer = false;
+		}
+    }
+    
     if ($showtimer && (!$ispreviewing || $timerstartvalue > 0)) {
         $timerstartvalue = max($timerstartvalue, 1); // Make sure it starts just above zero.
         require('jstimer.php');
diff -Naur moodle/mod/quiz/db/install.xml moodle-working/mod/quiz/db/install.xml
--- moodle/mod/quiz/db/install.xml	2007-09-24 22:12:00.000000000 -0400
+++ moodle-working/mod/quiz/db/install.xml	2008-12-03 09:54:45.000000000 -0500
@@ -201,7 +201,8 @@
         <FIELD NAME="subnet" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="password" NEXT="popup"/>
         <FIELD NAME="popup" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="subnet" NEXT="delay1"/>
         <FIELD NAME="delay1" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="popup" NEXT="delay2"/>
-        <FIELD NAME="delay2" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="delay1"/>
+        <FIELD NAME="delay2" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="delay1" NEXT="preventlatesubmissions"/>
+        <FIELD NAME="preventlatesubmissions" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" COMMENT="Determines if late submissions should be prevented" PREVIOUS="delay2"/>
       </FIELDS>
       <KEYS>
         <KEY NAME="primary" TYPE="primary" FIELDS="id" />
diff -Naur moodle/mod/quiz/mod_form.php moodle-working/mod/quiz/mod_form.php
--- moodle/mod/quiz/mod_form.php	2008-08-13 20:20:22.000000000 -0400
+++ moodle-working/mod/quiz/mod_form.php	2008-12-03 09:59:03.000000000 -0500
@@ -33,6 +33,8 @@
 
         $mform->addElement('date_time_selector', 'timeclose', get_string('quizclose', 'quiz'), array('optional'=>true));
         $mform->setHelpButton('timeclose', array('timeopen', get_string('quizclose', 'quiz'), 'quiz'));
+        
+        $mform->addElement( 'selectyesno', 'preventlatesubmissions', 'Prevent Late Submissions' );
 
 
         $timelimitgrp=array();
@@ -272,6 +274,12 @@
         if (isset($default_values['timelimit'])) {
             $default_values['timelimitenable'] = $default_values['timelimit'] > 0;
         }
+        
+        if (empty($default_values['preventlatesubmissions'])) {
+            $default_values['preventlatesubmissions'] = 0;
+        } else {
+            $default_values['preventlatesubmissions'] = 1;
+        }
 
         if (isset($default_values['review'])){
             $review = (int)$default_values['review'];
diff -Naur moodle/mod/quiz/view.php moodle-working/mod/quiz/view.php
--- moodle/mod/quiz/view.php	2008-08-26 20:19:26.000000000 -0400
+++ moodle-working/mod/quiz/view.php	2008-12-03 09:59:45.000000000 -0500
@@ -103,7 +103,7 @@
 
         // Print information about timings.
         $timenow = time();
-        $available = ($quiz->timeopen < $timenow and ($timenow < $quiz->timeclose or !$quiz->timeclose));
+        $available = ($quiz->timeopen < $timenow and ($timenow < $quiz->timeclose or !$quiz->timeclose or !$quiz->preventlatesubmissions ));
         if ($available) {
             if ($quiz->timelimit) {
                 echo "<p>".get_string("quiztimelimit","quiz", format_time($quiz->timelimit * 60))."</p>";
