[LON-CAPA-cvs] cvs: loncom /homework default_homework.lcpm /homework/caparesponse caparesponse.pm /interface lonparmset.pm /xml lonxml.pm

albertel lon-capa-cvs@mail.lon-capa.org
Fri, 04 Jun 2004 22:56:47 -0000


albertel		Fri Jun  4 18:56:47 2004 EDT

  Modified files:              
    /loncom/interface	lonparmset.pm 
    /loncom/homework/caparesponse	caparesponse.pm 
    /loncom/homework	default_homework.lcpm 
    /loncom/xml	lonxml.pm 
  Log:
  - new course PARM 'disablesigfigs' allows one to turn off sigfig checking in the entire course (BUG#2842)
  
  
  
Index: loncom/interface/lonparmset.pm
diff -u loncom/interface/lonparmset.pm:1.162 loncom/interface/lonparmset.pm:1.163
--- loncom/interface/lonparmset.pm:1.162	Wed Jun  2 17:51:01 2004
+++ loncom/interface/lonparmset.pm	Fri Jun  4 18:56:45 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to set parameters for assessments
 #
-# $Id: lonparmset.pm,v 1.162 2004/06/02 21:51:01 albertel Exp $
+# $Id: lonparmset.pm,v 1.163 2004/06/04 22:56:45 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1617,6 +1617,9 @@
              'disable_receipt_display'
                  => '<b>'.&mt('Disable display of problem receipts').'</b><br />'.
                     ' ('.&mt('"[_1]" to disable, anything else if not','<tt>yes</tt>').')',
+	     'disablesigfigs'
+	         => '<b>'.&mt('Disable checking of Significant Figures').'</b><br />'.
+                    ' ('.&mt('"[_1]" to disable, anything else if not','<tt>yes</tt>').')',
 	     'tthoptions'
 	         => '<b>'.&mt('Default set of options to pass to tth/m when converting tex').'</b>'
              ); 
@@ -1639,7 +1642,8 @@
                              'hideemptyrows',
                              'default_enrollment_start_date',
                              'default_enrollment_end_date',
-			     'tthoptions'
+			     'tthoptions',
+			     'disablesigfigs'
                              );
 	foreach my $parameter (sort(keys(%values))) {
             unless ($parameter =~ m/^internal\./) {
Index: loncom/homework/caparesponse/caparesponse.pm
diff -u loncom/homework/caparesponse/caparesponse.pm:1.146 loncom/homework/caparesponse/caparesponse.pm:1.147
--- loncom/homework/caparesponse/caparesponse.pm:1.146	Fri Jun  4 18:06:07 2004
+++ loncom/homework/caparesponse/caparesponse.pm	Fri Jun  4 18:56:45 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # caparesponse definition
 #
-# $Id: caparesponse.pm,v 1.146 2004/06/04 22:06:07 albertel Exp $
+# $Id: caparesponse.pm,v 1.147 2004/06/04 22:56:45 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -517,6 +517,10 @@
 sub get_sigrange {
     my ($sig)=@_;
     &Apache::lonxml::debug("Got a sig of :$sig:");
+    my $courseid=$ENV{'request.course.id'};
+    if (lc($ENV{"course.$courseid.disablesigfigs"}) eq 'yes') {
+	return (15,0);
+    }
     my $sig_lbound;
     my $sig_ubound;
     if ($sig eq '') {
Index: loncom/homework/default_homework.lcpm
diff -u loncom/homework/default_homework.lcpm:1.84 loncom/homework/default_homework.lcpm:1.85
--- loncom/homework/default_homework.lcpm:1.84	Thu May 27 00:25:13 2004
+++ loncom/homework/default_homework.lcpm	Fri Jun  4 18:56:46 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA 
 # used by lonxml::xmlparse() as input variable $safeinit to Apache::run::run()
 #
-# $Id: default_homework.lcpm,v 1.84 2004/05/27 04:25:13 albertel Exp $
+# $Id: default_homework.lcpm,v 1.85 2004/06/04 22:56:46 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -106,17 +106,8 @@
 	}
     }
 
-    if ($sig eq '') {
-	$sig_lbound = 0; #SIG_LB_DEFAULT
-	$sig_ubound =15; #SIG_UB_DEFAULT
-    } else {
-	($sig_lbound,$sig_ubound) = split /,/,$sig;
-	if (!defined($sig_lbound)) {
-	    $sig_lbound = 0; #SIG_LB_DEFAULT
-	    $sig_ubound =15; #SIG_UB_DEFAULT
-	}
-	if (!defined($sig_ubound)) { $sig_ubound=$sig_lbound; }
-    }
+    ($sig_ubound,$sig_lbound)=&LONCAPA_INTERNAL_get_sigrange($sig);
+
     my $reterror="";
     my $result = &caparesponse_capa_check_answer($response,$answer,$type,
 						 $tol_type,$tol,
Index: loncom/xml/lonxml.pm
diff -u loncom/xml/lonxml.pm:1.321 loncom/xml/lonxml.pm:1.322
--- loncom/xml/lonxml.pm:1.321	Fri Jun  4 10:03:57 2004
+++ loncom/xml/lonxml.pm	Fri Jun  4 18:56:46 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # XML Parser Module 
 #
-# $Id: lonxml.pm,v 1.321 2004/06/04 14:03:57 www Exp $
+# $Id: lonxml.pm,v 1.322 2004/06/04 22:56:46 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -736,6 +736,7 @@
   $safehole->wrap(\&Math::Random::random_set_seed,$safeeval,'&random_set_seed');
   $safehole->wrap(\&Apache::lonxml::error,$safeeval,'&LONCAPA_INTERNAL_ERROR');
   $safehole->wrap(\&Apache::lonxml::debug,$safeeval,'&LONCAPA_INTERNAL_DEBUG');
+  $safehole->wrap(\&Apache::caparesponse::get_sigrange,$safeeval,'&LONCAPA_INTERNAL_get_sigrange');
 
 #need to inspect this class of ops
 # $safeeval->deny(":base_orig");