]> git.mjollnir.org Git - moodle.git/commitdiff
Add option that allows students to resubmit after being graded
authormoodler <moodler>
Fri, 15 Nov 2002 03:32:30 +0000 (03:32 +0000)
committermoodler <moodler>
Fri, 15 Nov 2002 03:32:30 +0000 (03:32 +0000)
lang/en/assignment.php
lang/en/help/assignment/resubmit.html [new file with mode: 0644]
mod/assignment/db/mysql.php
mod/assignment/db/mysql.sql
mod/assignment/mod.html
mod/assignment/upload.php
mod/assignment/version.php
mod/assignment/view.php

index b952511cbab3c4d7232716e7d1cc38e69be98357..00e5f63bcfe67d1b902bc9eee275cb0929baf553 100644 (file)
@@ -2,6 +2,7 @@
       // assignment.php - created with Moodle 1.0.5 dev (2002092300)
 
 
+$string['allowresubmit'] = "Allow resubmitting";
 $string['assignmentdetails'] = "Assignment details";
 $string['assignmentname'] = "Assignment name";
 $string['assignmenttype'] = "Assignment type";
diff --git a/lang/en/help/assignment/resubmit.html b/lang/en/help/assignment/resubmit.html
new file mode 100644 (file)
index 0000000..1d4d3b1
--- /dev/null
@@ -0,0 +1,9 @@
+<P ALIGN=CENTER><B>Resubmitting assignments</B></P>
+
+<P>By default, students cannot resubmit assignments once the teacher has graded them</P>
+
+<P>If you turn this option on, then students will be allowed to resubmit assignments
+   after they have been graded (for you to re-grade).  This may be useful if the 
+   teacher wants to encourage students to do better work in an iterative process.</P>
+
+<P>Obviously, this option is not relevant for offline assignments.</P>
index de0d5b34307826c5dffbd3116b2cdfe25d6839f7..5a5a6bda55691a2e532c63dab24ead8550f981a4 100644 (file)
@@ -85,6 +85,9 @@ function assignment_upgrade($oldversion) {
     if ($oldversion < 2002110302) {
         execute_sql(" UPDATE `assignment` SET `type` = '1'");
     }
+    if ($oldversion < 2002111500) {
+        execute_sql(" ALTER TABLE `assignment` ADD `resubmit` TINYINT(2) UNSIGNED DEFAULT '0' NOT NULL AFTER `format` ");
+    }
 
     return true;
 }
index 812a92ededca018c975f0e9eabe546f78c0f98bf..2ce6431cf4cd8915eb0fa8e5b821e7f07a7b9e74 100644 (file)
@@ -8,6 +8,7 @@ CREATE TABLE `assignment` (
   `name` varchar(255) NOT NULL default '',
   `description` text NOT NULL,
   `format` tinyint(2) unsigned NOT NULL default '0',
+  `resubmit` tinyint(2) unsigned NOT NULL default '0',
   `type` int(10) unsigned NOT NULL default '1',
   `maxbytes` int(10) unsigned NOT NULL default '100000',
   `timedue` int(10) unsigned NOT NULL default '0',
index 368ecd49d45cc7fcb48cd6243e9bf0b3e2626bdf..ab6573b31bd9fc4f30f1fd6d0e42571a5d31cae3 100644 (file)
     ?>
     </td>
 </tr>
+<tr>
+    <td align=right><P><B><? print_string("allowresubmit", "assignment") ?>:</B></P></TD>
+    <td>
+    <?PHP 
+        $options[0] = get_string("no"); $options[1] = get_string("yes");
+        choose_from_menu($options, "resubmit", $form->resubmit, "");
+        helpbutton("resubmit", get_string("allowresubmit", "assignment"), "assignment");
+    ?>
+    </td>
+</tr>
 <tr valign=top>
     <td align=right><P><B><? print_string("maximumgrade") ?>:</B></P></TD>
     <td>
index 0ed3becc56c5ac7fa81ebcc599f45c797f6ab473..b1dbc04a725f46546a44d5aa59252b14ed67be19 100644 (file)
@@ -32,7 +32,7 @@
                   "", "", true);
 
     if ($submission = assignment_get_submission($assignment, $USER)) {
-        if ($submission->grade) {
+        if ($submission->grade and !$assignment->resubmit) {
             error("You've already been graded - there's no point in uploading anything");
         }
     }
index 60cd7f3fd532c8b69f7e97a45e66ad280963fcfe..114d6377a826987f9374357b242d94555c9443ad 100644 (file)
@@ -5,7 +5,7 @@
 //  This fragment is called by /admin/index.php
 ////////////////////////////////////////////////////////////////////////////////
 
-$module->version  = 2002110602;
+$module->version  = 2002111500;
 $module->cron     = 60;
 
 ?>
index 9ad6df9fcda6fc2b744997e42056b97d4f5cd3de..9eb6aad93c09523ac5a062317d3d29e19589995e 100644 (file)
             if ($submission and $submission->timemarked) {
                 print_heading(get_string("submissionfeedback", "assignment").":", "CENTER");
                 assignment_print_feedback($course, $submission);
-            } else {
+            }
+            if (!$submission->timemarked or $assignment->resubmit) {
                 if ($submission and $submission->timemodified) {
                     echo "<P ALIGN=CENTER>".get_string("overwritewarning", "assignment")."</P>";
                 }