[LON-CAPA-cvs] cvs: loncom /interface lonhtmlcommon.pm
bisitz
bisitz@source.lon-capa.org
Thu, 10 Jun 2010 09:09:59 -0000
bisitz Thu Jun 10 09:09:59 2010 EDT
Modified files:
/loncom/interface lonhtmlcommon.pm
Log:
Optimized counter steps in status bar (sub Increment_PrgWin), introduced in lonhtmlcommon.pm 1.275:
- Avoid ISE when called with invalid value 0
- Allow values 0 < x < 1
Index: loncom/interface/lonhtmlcommon.pm
diff -u loncom/interface/lonhtmlcommon.pm:1.276 loncom/interface/lonhtmlcommon.pm:1.277
--- loncom/interface/lonhtmlcommon.pm:1.276 Wed Jun 9 16:17:00 2010
+++ loncom/interface/lonhtmlcommon.pm Thu Jun 10 09:09:59 2010
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common html routines
#
-# $Id: lonhtmlcommon.pm,v 1.276 2010/06/09 16:17:00 bisitz Exp $
+# $Id: lonhtmlcommon.pm,v 1.277 2010/06/10 09:09:59 bisitz Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1052,7 +1052,7 @@
# increment progress state
sub Increment_PrgWin {
my ($r,$prog_state,$extraInfo,$step)=@_;
- if ($step !~ /^\d+$/) {
+ if ( ($step == 0) || ($step !~ /^\d+(\.\d+)*$/) ) {
$step = 1; # default
}
$$prog_state{'done'} += $step;