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

albertel lon-capa-cvs-allow@mail.lon-capa.org
Fri, 05 Oct 2007 18:08:40 -0000


albertel		Fri Oct  5 14:08:40 2007 EDT

  Modified files:              
    /loncom/homework	lonhomework.pm 
  Log:
  - BUG#5470, display errors for valid responses that cause an error such that no answer has even exists
  
  
Index: loncom/homework/lonhomework.pm
diff -u loncom/homework/lonhomework.pm:1.274 loncom/homework/lonhomework.pm:1.275
--- loncom/homework/lonhomework.pm:1.274	Mon Sep 10 09:31:39 2007
+++ loncom/homework/lonhomework.pm	Fri Oct  5 14:08:40 2007
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Homework handler
 #
-# $Id: lonhomework.pm,v 1.274 2007/09/10 13:31:39 www Exp $
+# $Id: lonhomework.pm,v 1.275 2007/10/05 18:08:40 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -788,6 +788,14 @@
 			$i++;
 		    }
 		}
+		if (!keys(%{ $analyze{$part.'.answer'} })) {
+		    my $answer_part = 
+			['<span class="LC_error">'.&mt('Error').'</span>'];
+		    $seedexample{join("\0",$part,0,@{$answer_part})}=
+			$thisseed;
+		    push( @{ $overall{$part.'.answer'}[0] },
+			  $answer_part);
+		}
 	    }
 	}
     }