Diff for /loncom/interface/lonparmset.pm between versions 1.70 and 1.71

version 1.70, 2002/10/01 06:21:23 version 1.71, 2002/10/01 07:09:05
Line 87  my $coursename; Line 87  my $coursename;
   
 Figure out a cascading parameter.  Figure out a cascading parameter.
   
 Inputs:  $what $id $def  Inputs:  $what - a parameter spec (incluse part info and name I.E. 0.weight)
            $id   - a bighash Id number
 Returns: I am not entirely sure.           $def  - the resource's default value   'stupid emacs
   
   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 level in course
   7 - resource level in course
   6 - General for section
   5 - Map level for section
   4 - resource level in section
   3 - General for specific student
   2 - Map level for specific student
   1 - resource level for specific student
   
 =cut  =cut
   
Line 123  sub parmval { Line 137  sub parmval {
   
 # --------------------------------------------------------- third, check course  # --------------------------------------------------------- third, check course
   
     if ($courseopt{$courselevel}) {      if (defined($courseopt{$courselevel})) {
  $outpar[9]=$courseopt{$courselevel};   $outpar[9]=$courseopt{$courselevel};
  $result=9;   $result=9;
     }      }
   
     if ($courseopt{$courselevelm}) {      if (defined($courseopt{$courselevelm})) {
  $outpar[8]=$courseopt{$courselevelm};   $outpar[8]=$courseopt{$courselevelm};
  $result=8;   $result=8;
     }      }
   
     if ($courseopt{$courselevelr}) {      if (defined($courseopt{$courselevelr})) {
  $outpar[7]=$courseopt{$courselevelr};   $outpar[7]=$courseopt{$courselevelr};
  $result=7;   $result=7;
     }      }
   
     if ($csec) {      if (defined($csec)) {
         if ($courseopt{$seclevel}) {          if (defined($courseopt{$seclevel})) {
     $outpar[6]=$courseopt{$seclevel};      $outpar[6]=$courseopt{$seclevel};
     $result=6;      $result=6;
  }   }
         if ($courseopt{$seclevelm}) {          if (defined($courseopt{$seclevelm})) {
     $outpar[5]=$courseopt{$seclevelm};      $outpar[5]=$courseopt{$seclevelm};
     $result=5;      $result=5;
  }   }
   
         if ($courseopt{$seclevelr}) {          if (defined($courseopt{$seclevelr})) {
     $outpar[4]=$courseopt{$seclevelr};      $outpar[4]=$courseopt{$seclevelr};
     $result=4;      $result=4;
  }   }
Line 156  sub parmval { Line 170  sub parmval {
   
 # ---------------------------------------------------------- fourth, check user  # ---------------------------------------------------------- fourth, check user
   
     if ($uname) {      if (defined($uname)) {
  if ($useropt{$courselevel}) {   if (defined($useropt{$courselevel})) {
     $outpar[3]=$useropt{$courselevel};      $outpar[3]=$useropt{$courselevel};
     $result=3;      $result=3;
  }   }
   
  if ($useropt{$courselevelm}) {   if (defined($useropt{$courselevelm})) {
     $outpar[2]=$useropt{$courselevelm};      $outpar[2]=$useropt{$courselevelm};
     $result=2;      $result=2;
  }   }
   
  if ($useropt{$courselevelr}) {   if (defined($useropt{$courselevelr})) {
     $outpar[1]=$useropt{$courselevelr};      $outpar[1]=$useropt{$courselevelr};
     $result=1;      $result=1;
  }   }
     }      }
   
     return ($result,@outpar);      return ($result,@outpar);
 }  }
   
Line 199  sub valout { Line 212  sub valout {
     my $result = '';      my $result = '';
     # Values of zero are valid.      # Values of zero are valid.
     if (! $value && $value ne '0') {      if (! $value && $value ne '0') {
         $result = '  ';   $result = '  ';
     } else {      } else {
         if ($type eq 'date_interval') {          if ($type eq 'date_interval') {
             my ($sec,$min,$hour,$mday,$mon,$year)=gmtime($value);              my ($sec,$min,$hour,$mday,$mon,$year)=gmtime($value);

Removed from v.1.70  
changed lines
  Added in v.1.71


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>