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

albertel lon-capa-cvs@mail.lon-capa.org
Mon, 04 Dec 2006 21:23:04 -0000


albertel		Mon Dec  4 16:23:04 2006 EDT

  Modified files:              
    /loncom/homework	response.pm chemresponse.pm 
  Log:
  - expecting an array of values in answertxt now (for when there are multiple input fields)
  
  
Index: loncom/homework/response.pm
diff -u loncom/homework/response.pm:1.151 loncom/homework/response.pm:1.152
--- loncom/homework/response.pm:1.151	Mon Dec  4 16:12:57 2006
+++ loncom/homework/response.pm	Mon Dec  4 16:23:01 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # various response type definitons response definition
 #
-# $Id: response.pm,v 1.151 2006/12/04 21:12:57 albertel Exp $
+# $Id: response.pm,v 1.152 2006/12/04 21:23:01 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -373,7 +373,7 @@
   	if (  &Apache::response::show_answer() ) {
 	    my $answer = &Apache::lonxml::get_param('answerdisplay',$parstack,
 						   $safeeval);
-	    $Apache::inputtags::answertxt{$id}=$answer;
+	    $Apache::inputtags::answertxt{$id}=[$answer];
 	}
     } elsif ($target eq 'edit') {
 	$result.=&Apache::edit::tag_start($target,$token);
@@ -464,7 +464,7 @@
   	if (  &Apache::response::show_answer() ) {
 	    my $answer = &Apache::lonxml::get_param('answerdisplay',$parstack,
 						   $safeeval);
-	    $Apache::inputtags::answertxt{$id}=$answer;
+	    $Apache::inputtags::answertxt{$id}=[$answer];
 	}
     } elsif ($target eq 'edit') {
 	$result.=&Apache::edit::tag_start($target,$token);
Index: loncom/homework/chemresponse.pm
diff -u loncom/homework/chemresponse.pm:1.70 loncom/homework/chemresponse.pm:1.71
--- loncom/homework/chemresponse.pm:1.70	Tue Aug  1 10:04:59 2006
+++ loncom/homework/chemresponse.pm	Mon Dec  4 16:23:01 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # chemical equation style response
 #
-# $Id: chemresponse.pm,v 1.70 2006/08/01 14:04:59 albertel Exp $
+# $Id: chemresponse.pm,v 1.71 2006/12/04 21:23:01 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -467,7 +467,7 @@
 		&Apache::lonxml::default_homework_load($safeeval);
 	    }
 	    @Apache::scripttag::parser_env = @_;
-	    $Apache::inputtags::answertxt{$id}=&Apache::run::run("return &chemparse(q\0$ans\0);",$safeeval);
+	    $Apache::inputtags::answertxt{$id}=[&Apache::run::run("return &chemparse(q\0$ans\0);",$safeeval)];
 	}
     } elsif ($target eq "edit") {
 	$result .=&Apache::edit::tag_start($target,$token);