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

raeburn lon-capa-cvs-allow@mail.lon-capa.org
Sat, 13 Sep 2008 02:47:04 -0000


raeburn		Fri Sep 12 22:47:04 2008 EDT

  Modified files:              (Branch: version_2_7_X)
    /loncom/homework/caparesponse	caparesponse.pm 
  Log:
  - backport 1.233 
  
  
Index: loncom/homework/caparesponse/caparesponse.pm
diff -u loncom/homework/caparesponse/caparesponse.pm:1.227.2.1 loncom/homework/caparesponse/caparesponse.pm:1.227.2.2
--- loncom/homework/caparesponse/caparesponse.pm:1.227.2.1	Fri Sep 12 06:09:18 2008
+++ loncom/homework/caparesponse/caparesponse.pm	Fri Sep 12 22:46:59 2008
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # caparesponse definition
 #
-# $Id: caparesponse.pm,v 1.227.2.1 2008/09/12 10:09:18 raeburn Exp $
+# $Id: caparesponse.pm,v 1.227.2.2 2008/09/13 02:46:59 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -447,8 +447,12 @@
 	}
     } elsif ($tag eq 'numericalresponse') {
 	$$args_ref{'type'}='float';
+    } elsif ($tag eq 'stringresponse') {
+        if ($$args_ref{'type'} eq '') {
+            $$args_ref{'type'} = 'ci';
+        }
     }
-    
+
     &add_in_tag_answer($parstack,$safeeval);
 
     if (!%answer) {
@@ -464,7 +468,7 @@
 	use Time::HiRes;
 	my $t0 = [Time::HiRes::gettimeofday()];
 	my ($result,@msgs) = 
-	    &Apache::run::run("&caparesponse_check_list($tag)",$safeeval);
+	    &Apache::run::run("&caparesponse_check_list()",$safeeval);
 	&Apache::lonxml::debug("checking $name $result with $response took ".&Time::HiRes::tv_interval($t0));
 	&Apache::lonxml::debug('msgs are '.join(':',@msgs));
 	my ($awards)=split(/:/,$result);
@@ -1171,13 +1175,15 @@
 		    my @args = ('type');
 		    my $args_ref = &setup_capa_args($safeeval,$parstack,
 						    \@args,$response);
-
+                    if ($$args_ref{'type'} eq '') {
+                        $$args_ref{'type'} = 'ci';
+                    }
 		    &add_in_tag_answer($parstack,$safeeval);
 		    my (@final_awards,@final_msgs,@names);
 		    foreach my $name (keys(%answer)) {
 			&Apache::lonxml::debug(" doing $name with ".join(':',@{ $answer{$name}{'answers'} }));
 			${$safeeval->varglob('LONCAPA::CAPAresponse_answer')}=dclone($answer{$name});
-			my ($result, @msgs)=&Apache::run::run("&caparesponse_check_list($$tagstack[-1])",$safeeval);
+			my ($result, @msgs)=&Apache::run::run("&caparesponse_check_list()",$safeeval);
 			&Apache::lonxml::debug('msgs are'.join(':',@msgs));
 			my ($awards)=split(/:/,$result);
 			my (@awards) = split(/,/,$awards);