--- loncom/interface/lonparmset.pm 2005/06/18 14:39:24 1.228 +++ loncom/interface/lonparmset.pm 2005/11/22 19:02:40 1.268.2.1 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set parameters for assessments # -# $Id: lonparmset.pm,v 1.228 2005/06/18 14:39:24 www Exp $ +# $Id: lonparmset.pm,v 1.268.2.1 2005/11/22 19:02:40 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -260,6 +260,20 @@ sub rulescache { return $rules{$id}; } +sub preset_defaults { + my $type=shift; + if (&rulescache($type.'_action') eq 'default') { +# yes, there is something + return (&rulescache($type.'_hours'), + &rulescache($type.'_min'), + &rulescache($type.'_sec'), + &rulescache($type.'_value')); + } else { +# nothing there or something else + return ('','','','',''); + } +} + ################################################## ################################################## # @@ -302,6 +316,8 @@ sub storeparm_by_symb { # store parameter &storeparm_by_symb_inner ($symb,$spnam,$snum,$nval,$ntype,$uname,$udom,$csec); +# don't do anything if parameter was reset + unless ($nval) { return; } my ($prefix,$parm)=($spnam=~/^(.*[\_\.])([^\_\.]+)$/); # remember that this was set $recstack{$parm}=1; @@ -510,12 +526,13 @@ sub plink { $winvalue=$env{'form.recent_'.(split(/\_/,$type))[0]}; } } - - - return + my ($parmname)=((split(/\&/,$marker))[1]=~/\_([^\_]+)$/); + my ($hour,$min,$sec,$val)=&preset_defaults($parmname); + unless (defined($winvalue)) { $winvalue=$val; } + return '
'. ''. - &valout($value,$type).''; + .$marker."','".$return."','".$call."','".$hour."','".$min."','".$sec."'".');">'. + &valout($value,$type).' |
print("\n | '); + $r->print('>'.$$allparms{$tempkey}.''); $cnt++; if ($cnt==3) { $r->print(" | |
-Select All -Select Common Only +Select All +Select Common Only |
-Add Problem Dates
-Add Content Dates -Add Discussion Settings -Add Visibilities -Add Part Parameters +Add Problem Dates +Add Content Dates +Add Discussion Settings +Add Visibilities +Add Part Parameters | -Unselect All +Unselect All | '); $r->print('