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

albertel lon-capa-cvs-allow@mail.lon-capa.org
Tue, 22 May 2007 00:45:43 -0000


albertel		Mon May 21 20:45:43 2007 EDT

  Modified files:              
    /loncom/homework/caparesponse	caparesponse.pm 
  Log:
  - only thorugh expected fields error if we exect some fields (if non expected no answer yet definied...)
  
  
Index: loncom/homework/caparesponse/caparesponse.pm
diff -u loncom/homework/caparesponse/caparesponse.pm:1.213 loncom/homework/caparesponse/caparesponse.pm:1.214
--- loncom/homework/caparesponse/caparesponse.pm:1.213	Thu Apr 26 19:15:43 2007
+++ loncom/homework/caparesponse/caparesponse.pm	Mon May 21 20:45:43 2007
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # caparesponse definition
 #
-# $Id: caparesponse.pm,v 1.213 2007/04/26 23:15:43 albertel Exp $
+# $Id: caparesponse.pm,v 1.214 2007/05/22 00:45:43 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -827,7 +827,8 @@
     use Data::Dumper;
     &Apache::lonxml::debug("count dump is ".&Dumper(\%counts));
     my $expected_number_of_inputs = (keys(%counts))[0];
-    if ( $expected_number_of_inputs != scalar(@Apache::inputtags::inputlist)) {
+    if ( $expected_number_of_inputs > 0 
+	 && $expected_number_of_inputs != scalar(@Apache::inputtags::inputlist)) {
 	&Apache::lonxml::error(&mt("Expected [_1] input fields, but there were only [_2] seen.", 
 				   $expected_number_of_inputs,
 				   scalar(@Apache::inputtags::inputlist)));