--- loncom/interface/lonparmset.pm 2005/06/14 02:33:18 1.221 +++ loncom/interface/lonparmset.pm 2005/06/14 15:43:54 1.222 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set parameters for assessments # -# $Id: lonparmset.pm,v 1.221 2005/06/14 02:33:18 www Exp $ +# $Id: lonparmset.pm,v 1.222 2005/06/14 15:43:54 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -2572,6 +2572,7 @@ $breadcrumbs
ENDDEFHEAD if ($env{'form.storerules'}) { +# storage here &resetrulescache(); } my @ids=(); @@ -2595,26 +2596,72 @@ ENDDEFHEAD 'sec' => 'Seconds', 'yes' => 'Yes', 'no' => 'No'); + my @standardoptions=('','default'); + my @standarddisplay=('',&mt('Default value when manually setting')); + my @dateoptions=('','default'); + my @datedisplay=('',&mt('Default value when manually setting')); + foreach my $tempkey (&keysindisplayorder(\%allparms,\%keyorder)) { + unless ($tempkey) { next; } + push @standardoptions,'when_setting_'.$tempkey; + push @standarddisplay,&mt('Automatically set when setting ').$tempkey; + if (&isdateparm($defkeytype{$tempkey})) { + push @dateoptions,'later_than_'.$tempkey; + push @datedisplay,&mt('Automatically set later than ').$tempkey; + push @dateoptions,'earlier_than_'.$tempkey; + push @datedisplay,&mt('Automatically set earlier than ').$tempkey; + } + } $r->print("\n'); + &mt('Action').''); foreach my $tempkey (&keysindisplayorder(\%allparms,\%keyorder)) { + unless ($tempkey) { next; } $r->print("\n'); - } $r->print("
".&mt('Rule for parameter').''. - &mt('Automatically set to ...').''.&mt('if ...').'
'.&mt('Value').'
".$allparms{$tempkey}."\n
(".$tempkey.')
'); + + my $action=&rulescache($tempkey.'_action'); + $r->print(''); + + + $r->print("\n\n"); + if (&isdateparm($defkeytype{$tempkey})) { + my $hours=&rulescache($tempkey.'_hours'); + my $min=&rulescache($tempkey.'_min'); + my $sec=&rulescache($tempkey.'_sec'); $r->print(<$lt{'hours'}
-$lt{'min'}
-$lt{'sec'} +$lt{'hours'}
+$lt{'min'}
+$lt{'sec'} ENDINPUTDATE } elsif ($defkeytype{$tempkey} eq 'string_yesno') { + my $yeschecked=''; + my $nochecked=''; + if (&rulescache($tempkey.'_value') eq 'yes') { $yeschecked='checked="checked"'; } + if (&rulescache($tempkey.'_value') eq 'no') { $nochecked='checked="checked"'; } + $r->print(< $lt{'yes'}
- +
+ ENDYESNO } else { - $r->print(''); + $r->print(''); } $r->print('
"); return;