[LON-CAPA-cvs] cvs: loncom /interface lonprintout.pm

foxr lon-capa-cvs@mail.lon-capa.org
Tue, 16 Aug 2005 10:25:17 -0000


foxr		Tue Aug 16 06:25:17 2005 EDT

  Modified files:              
    /loncom/interface	lonprintout.pm 
  Log:
  Support 'type-in-the-code' printing for anonymous students.
  
  
Index: loncom/interface/lonprintout.pm
diff -u loncom/interface/lonprintout.pm:1.385 loncom/interface/lonprintout.pm:1.386
--- loncom/interface/lonprintout.pm:1.385	Tue Aug 16 06:11:24 2005
+++ loncom/interface/lonprintout.pm	Tue Aug 16 06:25:15 2005
@@ -1,7 +1,7 @@
 #  The LearningOnline Network
 # Printout
 #
-# $Id: lonprintout.pm,v 1.385 2005/08/16 10:11:24 foxr Exp $
+# $Id: lonprintout.pm,v 1.386 2005/08/16 10:25:15 foxr Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2196,13 +2196,27 @@
     <string variable="NUMBER_TO_PRINT_TOTAL" maxlength="5" size="5">
        <validator>
 	if (((\$helper->{'VARS'}{'NUMBER_TO_PRINT_TOTAL'}+0) < 1) &&
-	    !\$helper->{'VARS'}{'REUSE_OLD_CODES'}) {
+	    !\$helper->{'VARS'}{'REUSE_OLD_CODES'}                &&
+	    !\$helper->{'VARS'}{'SINGLE_CODE'}) {
 	    return "You need to specify the number of assignments to print";
 	}
 	return undef;
        </validator>
     </string>
     <message></td></tr><tr><td></message>
+    <message><b>Value of CODE to print?</b></td><td></message>
+    <string variable="SINGLE_CODE" size="10" defaultvalue="zzzz">
+        <validator>
+	   if(!\$helper->{'VARS'}{'NUMBER_TO_PRINT_TOTAL'}           &&
+	      !\$helper->{'VARS'}{'REUSE_OLD_CODES'}) {
+	      return &Apache::lonprintout::is_code_valid(\$helper->{'VARS'}{'SINGLE_CODE'},
+						      \$helper->{'VARS'}{'CODE_OPTION'});
+	   } else {
+	       return undef;	# Other forces control us.
+	   }
+        </validator>
+    </string>
+    <message></td></tr><tr><td></message>
     <message><b>Names to store the CODEs under for later:</b></message>
     <message></td><td></message>
     <string variable="ANON_CODE_STORAGE_NAME" maxlength="50" size="20" />