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

matthew lon-capa-cvs@mail.lon-capa.org
Fri, 15 Oct 2004 16:22:25 -0000


matthew		Fri Oct 15 12:22:25 2004 EDT

  Modified files:              
    /loncom/homework	response.pm 
  Log:
  check_if_computed: do not assume we have a hash - was causing ISE on 
  stringresponse
  
  
Index: loncom/homework/response.pm
diff -u loncom/homework/response.pm:1.105 loncom/homework/response.pm:1.106
--- loncom/homework/response.pm:1.105	Mon Sep 27 18:47:49 2004
+++ loncom/homework/response.pm	Fri Oct 15 12:22:25 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # various response type definitons response definition
 #
-# $Id: response.pm,v 1.105 2004/09/27 22:47:49 albertel Exp $
+# $Id: response.pm,v 1.106 2004/10/15 16:22:25 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -646,7 +646,7 @@
 sub check_if_computed {
     my ($token,$parstack,$safeeval,$name)=@_;
     my $value = &Apache::lonxml::get_param($name,$parstack,$safeeval);
-    if ($value ne $token->[2]{$name}) {
+    if (ref($token->[2]) eq 'HASH' && $value ne $token->[2]{$name}) {
 	my $part_id="$Apache::inputtags::part.$Apache::inputtags::response[-1]";
 	$Apache::lonhomework::analyze{"$part_id.answercomputed"} = 1;
     }