[LON-CAPA-cvs] cvs: loncom /homework inputtags.pm

ng lon-capa-cvs@mail.lon-capa.org
Thu, 01 Aug 2002 15:18:58 -0000


ng		Thu Aug  1 11:18:58 2002 EDT

  Modified files:              
    /loncom/homework	inputtags.pm 
  Log:
  Add capabilities to handle draft answer - by Guy
  
  
  
Index: loncom/homework/inputtags.pm
diff -u loncom/homework/inputtags.pm:1.58 loncom/homework/inputtags.pm:1.59
--- loncom/homework/inputtags.pm:1.58	Thu Jul 25 16:55:13 2002
+++ loncom/homework/inputtags.pm	Thu Aug  1 11:18:58 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # input  definitons
 #
-# $Id: inputtags.pm,v 1.58 2002/07/25 20:55:13 ng Exp $
+# $Id: inputtags.pm,v 1.59 2002/08/01 15:18:58 ng Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -232,6 +232,9 @@
     foreach $award (@_) { if ($award eq 'INCORRECT') {$result=$award; last;} }
   }
   if ($result eq '' ) {
+    foreach $award (@_) { if ($award eq 'DRAFT') {$result=$award; last;} }
+  }
+  if ($result eq '' ) {
     foreach $award (@_) { if ($award eq 'SUBMITTED') {$result=$award; last;} }
   }
   if ($result eq '' ) {
@@ -298,6 +301,9 @@
   } elsif ($award eq 'SUBMITTED') {
     $message = "Your submission has been recorded.";
     $button=1;
+  } elsif ($award eq 'DRAFT') {
+    $message = "A draft copy has been saved.";
+    $button=1;
   } else {
     $message = "Unknown message: $award";
     $button=1;
@@ -327,12 +333,14 @@
       $Apache::lonhomework::results{"resource.$id.tries"} =
 	$Apache::lonhomework::history{"resource.$id.tries"} + 1;
       $Apache::lonhomework::results{"resource.$id.solved"} =
-	'incorrect_attempted';
+	'incorrect_attempted'
     } elsif ( $award eq 'SUBMITTED' ) {
       $Apache::lonhomework::results{"resource.$id.tries"} =
 	$Apache::lonhomework::history{"resource.$id.tries"} + 1;
       $Apache::lonhomework::results{"resource.$id.solved"} =
 	'ungraded_attempted';
+    } elsif ( $award eq 'DRAFT' ) {
+      $Apache::lonhomework::results{"resource.$id.solved"} = '';
     } elsif ( $award eq 'NO_RESPONSE' ) {
       return '';
     } else {