--- loncom/interface/lonparmset.pm 2001/03/21 01:45:01 1.25 +++ loncom/interface/lonparmset.pm 2001/03/23 23:04:32 1.26 @@ -11,7 +11,7 @@ # # 11/20,11/21,11/22,11/23,11/24,11/25,11/27,11/28, # 12/08,12/12, -# 16/01/01,02/08,03/20 Gerd Kortemeyer +# 16/01/01,02/08,03/20,03/23 Gerd Kortemeyer package Apache::lonparmset; @@ -36,6 +36,7 @@ my %keyp; my %defp; my %allkeys; +my %allmaps; my $uname; my $udom; @@ -183,6 +184,9 @@ sub handler { $udom=$ENV{'form.udom'}; unless ($udom) { $udom=$r->dir_config('lonDefDomain'); } + my $pscat=$ENV{'form.pscat'}; + my $pschp=$ENV{'form.pschp'}; + my $id=$ENV{'form.id'}; if (($id) && ($udom)) { $uname=(&Apache::lonnet::idget($udom,$id))[1]; @@ -235,8 +239,9 @@ sub handler { $ENV{'request.course.fn'}.'_parms.db',&GDBM_READER,0640))) { # --------------------------------------------------------- Get all assessments - %allkeys=(); - %defp=(); + undef %allkeys; + undef %allmaps; + undef %defp; map { if ($_=~/^src\_(\d+)\.(\d+)$/) { my $mapid=$1; @@ -273,6 +278,7 @@ sub handler { &Apache::lonnet::metadata($srcf,'keys')); $mapp{$id}= &Apache::lonnet::declutter($bighash{'map_id_'.$mapid}); + $allmaps{$mapid}=$mapp{$id}; $symbp{$id}=$mapp{$id}. '___'.$resid.'___'. &Apache::lonnet::declutter($srcf); @@ -462,7 +468,6 @@ or ID at Domain - @@ -473,16 +478,36 @@ ENDHEAD } ('tolerance','date_default','date_start','date_end','date_interval', 'int','float','string'); - $r->print('

'.$message.'

Sort list by '); - $r->print(''); $r->print(''); map { $r->print(''); } keys %allkeys; - $r->print(''); + $r->print( + 'Select Enclosing MapSelect Parameter
'); + if (($pscat) || ($pschp)) { # ----------------------------------------------------------------- Start Table + my $catmarker='parameter_'.$pscat; + $catmarker=~s/\./\_/g; my $coursespan=$csec?8:5; $r->print(< @@ -516,6 +541,8 @@ ENDTABLEHEADFOUR my $defbgone=''; my $defbgtwo=''; map { + my $rid=$_; + if (($pschp eq 'all') || ($allmaps{$pschp} eq $mapp{$rid})) { # ------------------------------------------------------ Entry for one resource if ($defbgone eq '"E0E099"') { $defbgone='"E0E0DD"'; @@ -528,7 +555,6 @@ ENDTABLEHEADFOUR $defbgtwo='"FFFF99"'; } @outpar=(); - my $rid=$_; my $thistitle=''; my %name= (); my %part= (); @@ -551,6 +577,7 @@ ENDTABLEHEADFOUR my $totalparms=scalar keys %name; my $isdef=1; unless ($totalparms) { $totalparms=1; $isdef=0; } + if ($pscat ne 'all') { $totalparms=1; } $r->print(''); if ($isdef) { map { + if (($_ eq $catmarker) || ($pscat eq 'all')) { my $result=&parmval($part{$_}.'.'.$name{$_},$rid,$default{$_}); $r->print(""); + } } sort keys %name; } else { - $r->print("\n"); + $r->print("\n"); } # -------------------------------------------------- End entry for one resource + } } @ids; - $r->print('
'. join(' / ',split(/\//,$uri)). @@ -567,6 +594,7 @@ ENDTABLEHEADFOUR join(' / ',split(/\//,$mapp{$rid})).'\n
'); + $r->print(''); + } + $r->print(''); untie(%bighash); untie(%parmhash); }