--- loncom/interface/lonhtmlcommon.pm 2010/06/10 16:14:34 1.278 +++ loncom/interface/lonhtmlcommon.pm 2010/06/18 09:06:29 1.279 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common html routines # -# $Id: lonhtmlcommon.pm,v 1.278 2010/06/10 16:14:34 bisitz Exp $ +# $Id: lonhtmlcommon.pm,v 1.279 2010/06/18 09:06:29 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -940,7 +940,7 @@ Inputs: =item $extraInfo A description of the items being iterated over. Typically 'student'. -=item $step (optional) counter step. Will be set to default 1 if ommited. +=item $step (optional) counter step. Will be set to default 1 if ommited. step must be greater than 0 or empty. =back @@ -1052,9 +1052,7 @@ sub Update_PrgWin { # increment progress state sub Increment_PrgWin { my ($r,$prog_state,$extraInfo,$step)=@_; - if ( ($step == 0) || ($step !~ /^\d+(\.\d+)*$/) ) { - $step = 1; # default - } + $step = $step > 0 ? $step : 1; $$prog_state{'done'} += $step; # Catch (max modulo step) <> 0