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

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


albertel		Fri Jun  4 18:31:27 2004 EDT

  Modified files:              
    /loncom/homework	inputtags.pm 
  Log:
  - Bug #186. Sig figs will be the death of me.
  
  
Index: loncom/homework/inputtags.pm
diff -u loncom/homework/inputtags.pm:1.144 loncom/homework/inputtags.pm:1.145
--- loncom/homework/inputtags.pm:1.144	Fri Jun  4 18:06:07 2004
+++ loncom/homework/inputtags.pm	Fri Jun  4 18:31:25 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # input  definitons
 #
-# $Id: inputtags.pm,v 1.144 2004/06/04 22:06:07 albertel Exp $
+# $Id: inputtags.pm,v 1.145 2004/06/04 22:31:25 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -423,7 +423,11 @@
 	$bgcolor=$possiblecolors{'not_charged_try'};
 	$button=1;
     } elsif ($award eq 'SIG_FAIL') {
-	$message = &mt("Significant figures are incorrect, you provided [_1] significant figures while [_2] to [_3] were expected. Submission not graded.",(split(/:/,$awardmsg)));
+	my ($used,$min,$max)=split(':',$awardmsg);
+	my $word;
+	if ($used < $min) { $word=&mt('more'); }
+	if ($used > $max) { $word=&mt('fewer'); }
+	$message = &mt("Submission not graded.  Use [_2] digits.",$used,$word);
 	$bgcolor=$possiblecolors{'not_charged_try'};
 	$button=1;
     } elsif ($award eq 'UNIT_INVALID_INSTRUCTOR') {