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

albertel lon-capa-cvs-allow@mail.lon-capa.org
Wed, 29 Aug 2007 21:55:37 -0000


albertel		Wed Aug 29 17:55:37 2007 EDT

  Modified files:              
    /loncom/homework/caparesponse	caparesponse.pm 
  Log:
  - if checking a submission and no answers are defined for the problem, 
    need to throw and error
  
  
Index: loncom/homework/caparesponse/caparesponse.pm
diff -u loncom/homework/caparesponse/caparesponse.pm:1.217 loncom/homework/caparesponse/caparesponse.pm:1.218
--- loncom/homework/caparesponse/caparesponse.pm:1.217	Wed Aug 29 06:09:56 2007
+++ loncom/homework/caparesponse/caparesponse.pm	Wed Aug 29 17:55:37 2007
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # caparesponse definition
 #
-# $Id: caparesponse.pm,v 1.217 2007/08/29 10:09:56 foxr Exp $
+# $Id: caparesponse.pm,v 1.218 2007/08/29 21:55:37 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -431,6 +431,10 @@
     
     &add_in_tag_answer($parstack,$safeeval);
 
+    if (!%answer) {
+	&Apache::lonxml::error("No answers are defined");
+    }
+
     my (@final_awards,@final_msgs,@names);
     foreach my $name (keys(%answer)) {
 	&Apache::lonxml::debug(" doing $name with ".join(':',@{ $answer{$name}{'answers'} }));