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

foxr foxr@source.lon-capa.org
Mon, 24 May 2010 09:32:11 -0000


foxr		Mon May 24 09:32:11 2010 EDT

  Modified files:              
    /loncom/interface	lonprintout.pm 
  Log:
  BZ 4707
  Fix up the validators for coded assignment strnigs to catch incompatible cases
  between number of coded assignments and single coded assignment section.
  
  
Index: loncom/interface/lonprintout.pm
diff -u loncom/interface/lonprintout.pm:1.577 loncom/interface/lonprintout.pm:1.578
--- loncom/interface/lonprintout.pm:1.577	Mon May 24 09:21:18 2010
+++ loncom/interface/lonprintout.pm	Mon May 24 09:32:11 2010
@@ -2,7 +2,7 @@
 # The LearningOnline Network
 # Printout
 #
-# $Id: lonprintout.pm,v 1.577 2010/05/24 09:21:18 foxr Exp $
+# $Id: lonprintout.pm,v 1.578 2010/05/24 09:32:11 foxr Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -201,9 +201,14 @@
 	if (((\$helper->{'VARS'}{'NUMBER_TO_PRINT_TOTAL'}+0) < 1) &&
 	    !\$helper->{'VARS'}{'REUSE_OLD_CODES'}                &&
             !\$helper->{'VARS'}{'SINGLE_CODE'}                    &&
-	    !\$helper->{'VARS'}{'CODE_SELECTED_FROM_LIST'}) {
+	    !\$helper->{'VARS'}{'CODE_SELECTED_FROM_LIST'} ) {
+
 	    return "You need to specify the number of assignments to print";
 	}
+        if (((\$helper->{'VARS'}{'NUMBER_TO_PRINT_TOTAL'}+0) >= 1)  &&
+             (\$helper->{'VARS'}{'SINGLE_CODE'} ne '') ) {
+            return 'Specifying number of codes to print and a specific code is not compatible';
+        }
 	return undef;
        </validator>
     </string>
@@ -229,7 +234,7 @@
 	      return &Apache::lonprintout::is_code_valid(\$helper->{'VARS'}{'SINGLE_CODE'},
 						      \$helper->{'VARS'}{'CODE_OPTION'});
 	  } elsif (\$helper->{'VARS'}{'SINGLE_CODE'} ne ''){
-	      return 'Specifying a code name is incompatible with what you have specified above';
+	      return 'Specifying a code name is incompatible with specifying number of codes.';
 	   } else {
 	       return undef;	# Other forces control us.
 	   }
@@ -3733,6 +3738,10 @@
 	    !\$helper->{'VARS'}{'CODE_SELECTED_FROM_LIST'}) {
 	    return "You need to specify the number of assignments to print";
 	}
+        if (((\$helper->{'VARS'}{'NUMBER_TO_PRINT_TOTAL'}+0) >= 1)  &&
+             (\$helper->{'VARS'}{'SINGLE_CODE'} ne '') ) {
+            return 'Specifying number of codes to print and a specific code is not compatible';
+        }
 	return undef;
        </validator>
     </string>
@@ -3757,7 +3766,7 @@
 	      return &Apache::lonprintout::is_code_valid(\$helper->{'VARS'}{'SINGLE_CODE'},
 						      \$helper->{'VARS'}{'CODE_OPTION'});
 	  } elsif (\$helper->{'VARS'}{'SINGLE_CODE'} ne ''){
-	      return 'Specifying a code name is incompatible with what you have specified above';
+	      return 'Specifying a code name is incompatible specifying number of codes.';
 	   } else {
 	       return undef;	# Other forces control us.
 	   }