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

albertel lon-capa-cvs@mail.lon-capa.org
Thu, 25 Apr 2002 18:58:04 -0000


albertel		Thu Apr 25 14:58:04 2002 EDT

  Modified files:              
    /loncom/homework	structuretags.pm 
  Log:
  
  - addressing BUG#288
     - don't do a grade pass if the problem in UNCHECKEDOUT
     - the form didn't work on mozilla, The rewritten version does
  
  - Barcode issues still exist though.
  
  
  
Index: loncom/homework/structuretags.pm
diff -u loncom/homework/structuretags.pm:1.90 loncom/homework/structuretags.pm:1.91
--- loncom/homework/structuretags.pm:1.90	Thu Apr 11 13:37:13 2002
+++ loncom/homework/structuretags.pm	Thu Apr 25 14:58:04 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA 
 # definition of tags that give a structure to a document
 #
-# $Id: structuretags.pm,v 1.90 2002/04/11 17:37:13 albertel Exp $
+# $Id: structuretags.pm,v 1.91 2002/04/25 18:58:04 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -150,11 +150,10 @@
 <font color=red>
 Checking out resources is subject to course policies, and may exclude future
 credit even if done erroneously.<p />
-</font>  
-<form method=post>
-<input type=button name="doescheckout" 
-value="Check out Exam for Viewing" 
-onClick="if (confirm('Check out Exam?')) { this.form.submit(); }" />
+</font>
+<form name="checkout" method="POST" action="$ENV{'request.uri'}">
+<input type="hidden" name="doescheckout" value="yes" />
+<input type="button" name="checkoutbutton" value="Check out Exam for Viewing" onClick="javascript:if (confirm('Check out Exam?')) { document.checkout.submit(); }" />
 </form>
 ENDCHECKOUT
 }
@@ -315,7 +314,8 @@
     if ( $target eq 'grade' && $Apache::inputtags::part eq '0') {
       # if part is zero, no <part>s existed, so we need to the grading
       &Apache::inputtags::grade;
-    } elsif ( $target eq 'web' && $Apache::inputtags::part eq '0') {
+    } elsif ( $target eq 'web' && $Apache::inputtags::part eq '0' && 
+	      $status ne 'UNCHECKEDOUT') {
       # if part is zero, no <part>s existed, so we need show the current 
       # grading status
       $result.= &Apache::inputtags::gradestatus($Apache::inputtags::part);
@@ -326,7 +326,8 @@
        ) {
       if ($status eq 'CAN_ANSWER') {
 	$result.="</form></body>\n"; 
-      } elsif ($status eq 'SHOW_ANSWER' || $status eq 'CANNOT_ANSWER') {
+      } elsif ($status eq 'SHOW_ANSWER' || $status eq 'CANNOT_ANSWER' ||
+	       $status eq 'UNCHECKEDOUT' ) {
 	$result.="</body>\n";
       }
       $result.=&Apache::lonxml::xmlend();