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

www lon-capa-cvs@mail.lon-capa.org
Tue, 19 Dec 2006 14:53:21 -0000


www		Tue Dec 19 09:53:21 2006 EDT

  Modified files:              
    /loncom/homework	hint.pm 
    /loncom/homework/caparesponse	caparesponse.pm 
    /loncom/xml	lonxml.pm 
  Log:
  - Make <formulahint> work with MAXIMA
  - fix normal formulahint. Didn't have access to &capa_formula_fix
  
  
Index: loncom/homework/hint.pm
diff -u loncom/homework/hint.pm:1.66 loncom/homework/hint.pm:1.67
--- loncom/homework/hint.pm:1.66	Mon Dec 18 19:49:53 2006
+++ loncom/homework/hint.pm	Tue Dec 19 09:53:17 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA 
 # implements the tags that control the hints
 #
-# $Id: hint.pm,v 1.66 2006/12/19 00:49:53 albertel Exp $
+# $Id: hint.pm,v 1.67 2006/12/19 14:53:17 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -178,7 +178,11 @@
 	if (lc($hideunit) eq "yes") { delete($$args_ref{'unit'}); }
 
 	if ($$tagstack[-1] eq 'formulahint') {
-	    $$args_ref{'type'}='fml';
+            if ($$args_ref{'samples'}) {
+                $$args_ref{'type'}='fml';
+            } else {
+                $$args_ref{'type'}='math';
+            }
 	} elsif ($$tagstack[-1] eq 'numericalhint') {
 	    $$args_ref{'type'}='float';
 	}
Index: loncom/homework/caparesponse/caparesponse.pm
diff -u loncom/homework/caparesponse/caparesponse.pm:1.204 loncom/homework/caparesponse/caparesponse.pm:1.205
--- loncom/homework/caparesponse/caparesponse.pm:1.204	Mon Dec 18 19:49:53 2006
+++ loncom/homework/caparesponse/caparesponse.pm	Tue Dec 19 09:53:18 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # caparesponse definition
 #
-# $Id: caparesponse.pm,v 1.204 2006/12/19 00:49:53 albertel Exp $
+# $Id: caparesponse.pm,v 1.205 2006/12/19 14:53:18 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -395,9 +395,6 @@
     my $tag;
     my $safehole = new Safe::Hole;
     $safeeval->share_from('capa',['&caparesponse_capa_check_answer']);
-    $safehole->wrap(\&Apache::lonmaxima::maxima_check,$safeeval,'&maxima_check');
-    $safehole->wrap(\&Apache::lonmaxima::maxima_cas_formula_fix,$safeeval,'&maxima_cas_formula_fix');
-    $safehole->wrap(\&capa_formula_fix,$safeeval,'&capa_formula_fix');
 
     if (scalar(@$tagstack)) { $tag=$$tagstack[-1]; }
     if ( $target eq 'grade' && &Apache::response::submitted() ) {
Index: loncom/xml/lonxml.pm
diff -u loncom/xml/lonxml.pm:1.431 loncom/xml/lonxml.pm:1.432
--- loncom/xml/lonxml.pm:1.431	Tue Dec 19 09:24:07 2006
+++ loncom/xml/lonxml.pm	Tue Dec 19 09:53:18 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # XML Parser Module 
 #
-# $Id: lonxml.pm,v 1.431 2006/12/19 14:24:07 www Exp $
+# $Id: lonxml.pm,v 1.432 2006/12/19 14:53:18 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -676,6 +676,9 @@
   $safehole->wrap(\&Apache::response::check_status,$safeeval,'&check_status');
 
   $safehole->wrap(\&Apache::lonmaxima::maxima_eval,$safeeval,'&maxima_eval');
+  $safehole->wrap(\&Apache::lonmaxima::maxima_check,$safeeval,'&maxima_check');
+  $safehole->wrap(\&Apache::lonmaxima::maxima_cas_formula_fix,$safeeval,'&maxima_cas_formula_fix');
+  $safehole->wrap(\&capa_formula_fix,$safeeval,'&capa_formula_fix');
 
   $safehole->wrap(\&Math::Cephes::asin,$safeeval,'&asin');
   $safehole->wrap(\&Math::Cephes::acos,$safeeval,'&acos');