--- loncom/interface/lonparmset.pm 2005/06/18 14:39:24 1.228
+++ loncom/interface/lonparmset.pm 2005/08/29 22:57:09 1.244
@@ -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.244 2005/08/29 22:57:09 banghart 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 ('','','','','');
+ }
+}
+
##################################################
##################################################
#
@@ -510,11 +524,12 @@ sub plink {
$winvalue=$env{'form.recent_'.(split(/\_/,$type))[0]};
}
}
-
-
+ my ($parmname)=((split(/\&/,$marker))[1]=~/\_([^\_]+)$/);
+ my ($hour,$min,$sec,$val)=&preset_defaults($parmname);
+ unless (defined($winvalue)) { $winvalue=$val; }
return
''.
+ .$marker."','".$return."','".$call."','".$hour."','".$min."','".$sec."'".');">'.
&valout($value,$type).'';
}
@@ -614,7 +629,10 @@ sub print_row {
} else {
$parm=~s|\[.*\]\s||g;
}
-
+ my $automatic=&rulescache(($which=~/\_([^\_]+)$/)[0].'_triggers');
+ if ($automatic) {
+ $parm.='
'.&mt('Automatically sets').' '.join(', ',split(/\:/,$automatic)).'';
+ }
$r->print('
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('