[LON-CAPA-cvs] cvs: loncom /homework/caparesponse caparesponse.pm /localize/localize newphrases.txt

albertel lon-capa-cvs@mail.lon-capa.org
Fri, 20 Feb 2004 18:04:43 -0000


albertel		Fri Feb 20 13:04:43 2004 EDT

  Modified files:              
    /loncom/localize/localize	newphrases.txt 
    /loncom/homework/caparesponse	caparesponse.pm 
  Log:
  - BUG#2760, detect and throw error about invalid sig figs
  
  
Index: loncom/localize/localize/newphrases.txt
diff -u loncom/localize/localize/newphrases.txt:1.34 loncom/localize/localize/newphrases.txt:1.35
--- loncom/localize/localize/newphrases.txt:1.34	Mon Feb 16 15:30:34 2004
+++ loncom/localize/localize/newphrases.txt	Fri Feb 20 13:04:43 2004
@@ -52,4 +52,6 @@
 Show Feedback
 Don't Show Feedback
 Change
-is in this state by royal decree.
\ No newline at end of file
+is in this state by royal decree.
+Done
+Invalid Significant figures detected
\ No newline at end of file
Index: loncom/homework/caparesponse/caparesponse.pm
diff -u loncom/homework/caparesponse/caparesponse.pm:1.132 loncom/homework/caparesponse/caparesponse.pm:1.133
--- loncom/homework/caparesponse/caparesponse.pm:1.132	Thu Feb 19 16:49:33 2004
+++ loncom/homework/caparesponse/caparesponse.pm	Fri Feb 20 13:04:43 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # caparesponse definition
 #
-# $Id: caparesponse.pm,v 1.132 2004/02/19 21:49:33 sakharuk Exp $
+# $Id: caparesponse.pm,v 1.133 2004/02/20 18:04:43 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -513,6 +513,16 @@
 	    $sig_ubound =15; #SIG_UB_DEFAULT
 	}
 	if (!$sig_ubound) { $sig_ubound=$sig_lbound; }
+    }
+    if (($sig_ubound<$sig_lbound) ||
+	($sig_lbound > 15) ||
+	($sig =~/(\+|-)/ ) ) {
+	my $errormsg=&mt("Invalid Significant figures detected")." ($sig)";
+	if ($ENV{'request.state'} eq 'construct') {
+	    $errormsg.=
+		&Apache::loncommon::help_open_topic('Significant_Figures');
+	}
+	&Apache::lonxml::error($errormsg);
     }
     return ($sig_ubound,$sig_lbound);
 }