Diff for /loncom/lonnet/perl/lonnet.pm between versions 1.60 and 1.62

version 1.60, 2000/11/14 02:39:30 version 1.62, 2000/11/14 15:58:39
Line 43 Line 43
 #                        state string  #                        state string
 # condval(index)     : value of condition index based on state  # condval(index)     : value of condition index based on state
 # EXT(name)          : value of a variable  # EXT(name)          : value of a variable
 # refreshstate()     : refresh the state information string  
 # symblist(map,hash) : Updates symbolic storage links  # symblist(map,hash) : Updates symbolic storage links
 # symbread([filename]) : returns the data handle (filename optional)  # symbread([filename]) : returns the data handle (filename optional)
 # rndseed()          : returns a random seed    # rndseed()          : returns a random seed  
Line 971  sub allowed { Line 970  sub allowed {
    return 'F';     return 'F';
 }  }
   
 # ---------------------------------------------------------- Refresh State Info  
   
 sub refreshstate {  
 }  
   
 # ----------------------------------------------------------------- Define Role  # ----------------------------------------------------------------- Define Role
   
 sub definerole {  sub definerole {
Line 1328  sub EXT { Line 1322  sub EXT {
     return '';      return '';
 }  }
   
   # ---------------------------------------- Append resource parms to environment
   
   sub appendparms {
       my ($symb,$parms)=@_;
       my %storehash=();
       my $prefix='resource.parms.'.$ENV{'request.course.id'}.'.'.$symb;
       map {
    my ($typename,$value)=split(/\=/,$_);
           my ($type,$name)=split(/\:/,$typename);
           $storehash{$prefix.'.'.unescape($name)}=unescape($value);
    $storehash{$prefix.'.'.unescape($name).'.type'}=unescape($type);
       } split(/\&/,$parms);
       &appenv(%storehash);
   }
   
 # ------------------------------------------------- Update symbolic store links  # ------------------------------------------------- Update symbolic store links
   
 sub symblist {  sub symblist {
Line 1359  sub symbread { Line 1368  sub symbread {
     my %hash;      my %hash;
     my %bighash;      my %bighash;
     my $syval='';      my $syval='';
       my $parms='';
     if (($ENV{'request.course.fn'}) && ($thisfn)) {      if (($ENV{'request.course.fn'}) && ($thisfn)) {
         if (tie(%hash,'GDBM_File',$ENV{'request.course.fn'}.'_symb.db',          if (tie(%hash,'GDBM_File',$ENV{'request.course.fn'}.'_symb.db',
                       &GDBM_READER,0640)) {                        &GDBM_READER,0640)) {
Line 1386  sub symbread { Line 1396  sub symbread {
                  if ($#possibilities==0) {                   if ($#possibilities==0) {
 # ----------------------------------------------- There is only one possibility  # ----------------------------------------------- There is only one possibility
      my ($mapid,$resid)=split(/\./,$ids);       my ($mapid,$resid)=split(/\./,$ids);
                        $parms=$bighash{'param_'.$ids};
                      $syval=declutter($bighash{'map_id_'.$mapid}).'___'.$resid;                       $syval=declutter($bighash{'map_id_'.$mapid}).'___'.$resid;
                  } else {                   } else {
 # ------------------------------------------ There is more than one possibility  # ------------------------------------------ There is more than one possibility
Line 1396  sub symbread { Line 1407  sub symbread {
              my ($mapid,$resid)=split(/\./,$_);               my ($mapid,$resid)=split(/\./,$_);
                             if ($bighash{'map_type_'.$mapid} ne 'page') {                              if ($bighash{'map_type_'.$mapid} ne 'page') {
  $realpossible++;   $realpossible++;
                                   $parms=$bighash{'param_'.$_};
                                 $syval=declutter($bighash{'map_id_'.$mapid}).                                  $syval=declutter($bighash{'map_id_'.$mapid}).
                                        '___'.$resid;                                         '___'.$resid;
                             }                              }
Line 1407  sub symbread { Line 1419  sub symbread {
               untie(%bighash)                untie(%bighash)
            }              } 
         }          }
         if ($syval) { return $syval.'___'.$thisfn; }          if ($syval) {
              if ($parms) {
          &appendparms($syval.'___'.$thisfn,$parms);
              }
              return $syval.'___'.$thisfn; 
           }
     }      }
     &appenv('request.ambiguous' => $thisfn);      &appenv('request.ambiguous' => $thisfn);
     return '';      return '';

Removed from v.1.60  
changed lines
  Added in v.1.62


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