--- loncom/interface/lonparmset.pm 2005/02/02 19:23:59 1.181 +++ loncom/interface/lonparmset.pm 2005/02/05 06:21:57 1.182 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set parameters for assessments # -# $Id: lonparmset.pm,v 1.181 2005/02/02 19:23:59 albertel Exp $ +# $Id: lonparmset.pm,v 1.182 2005/02/05 06:21:57 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -96,10 +96,10 @@ Inputs: $what - a parameter spec (inclu Returns: A list, the first item is the index into the remaining list of items of parm valuse that is the active one, the list consists of parm values at the 11 possible levels -11- resource default -10- map default -9 - General Course -8 - Map or Folder level in course +11 - General Course +10 - Map or Folder level in course +9- resource default +8- map default 7 - resource level in course 6 - General for section 5 - Map or Folder level for section @@ -129,32 +129,35 @@ sub parmval { my $courselevelr=$ENV{'request.course.id'}.'.'.$symbparm; my $courselevelm=$ENV{'request.course.id'}.'.'.$mapparm; -# -------------------------------------------------------- first, check default - if (defined($def)) { $outpar[11]=$def; $result=11; } -# ----------------------------------------------------- second, check map parms - - my $thisparm=$parmhash{$symbparm}; - if (defined($thisparm)) { $outpar[10]=$thisparm; $result=10; } - -# --------------------------------------------------------- third, check course +# --------------------------------------------------------- first, check course if (defined($courseopt{$courselevel})) { - $outpar[9]=$courseopt{$courselevel}; - $result=9; + $outpar[11]=$courseopt{$courselevel}; + $result=11; } if (defined($courseopt{$courselevelm})) { - $outpar[8]=$courseopt{$courselevelm}; - $result=8; + $outpar[10]=$courseopt{$courselevelm}; + $result=10; } +# ------------------------------------------------------- second, check default + + if (defined($def)) { $outpar[9]=$def; $result=9; } + +# ------------------------------------------------------ third, check map parms + + my $thisparm=$parmhash{$symbparm}; + if (defined($thisparm)) { $outpar[8]=$thisparm; $result=8; } + if (defined($courseopt{$courselevelr})) { $outpar[7]=$courseopt{$courselevelr}; $result=7; } +# ------------------------------------------------------ fourth, back to course if (defined($csec)) { if (defined($courseopt{$seclevel})) { $outpar[6]=$courseopt{$seclevel}; @@ -171,7 +174,7 @@ sub parmval { } } -# ---------------------------------------------------------- fourth, check user +# ---------------------------------------------------------- fifth, check user if (defined($uname)) { if (defined($useropt{$courselevel})) { @@ -419,15 +422,14 @@ sub print_row { $$name{$which}.'.type', $rid,$$defaulttype{$which}); # cascade down manually - my $cascadetype=$defaulttype; - for (my $i=$#typeoutpar;$i>0;$i--) { + my $cascadetype=$$defaulttype{$which}; + for (my $i=11;$i>0;$i--) { if ($typeoutpar[$i]) { $cascadetype=$typeoutpar[$i]; } else { $typeoutpar[$i]=$cascadetype; } } - my $parm=$$display{$which}; if ($parmlev eq 'full' || $parmlev eq 'brief') { @@ -450,7 +452,7 @@ sub print_row { } elsif ($csec) { &print_td($r,6,$defbgtwo,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); } else { - &print_td($r,9,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); + &print_td($r,11,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); } } elsif ($parmlev eq 'map') { @@ -459,11 +461,11 @@ sub print_row { } elsif ($csec) { &print_td($r,5,$defbgtwo,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); } else { - &print_td($r,8,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); + &print_td($r,10,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); } } else { - &print_td($r,11,'#FFDDDD',$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); + &print_td($r,11,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); if ($parmlev eq 'brief') { @@ -477,9 +479,9 @@ sub print_row { } } else { - &print_td($r,10,'#FFDDDD',$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); - &print_td($r,9,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); - &print_td($r,8,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); + &print_td($r,10,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); + &print_td($r,9,'#FFDDDD',$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); + &print_td($r,8,'#FFDDDD',$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); &print_td($r,7,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); if ($csec) { @@ -520,7 +522,7 @@ sub print_td { my ($r,$which,$defbg,$result,$outpar,$mprefix,$value,$typeoutpar,$display)=@_; $r->print('