Diff for /loncom/interface/lonnavmaps.pm between versions 1.210 and 1.211

version 1.210, 2003/06/25 16:45:54 version 1.211, 2003/06/25 18:27:18
Line 1566  You must obtain resource objects through Line 1566  You must obtain resource objects through
 =over 4  =over 4
   
 =item * B<new>(navHashFile, parmHashFile, genCourseAndUserOptions,  =item * B<new>(navHashFile, parmHashFile, genCourseAndUserOptions,
   genMailDiscussStatus):    genMailDiscussStatus, getUserData):
   
 Binds a new navmap object to the compiled nav map hash and parm hash  Binds a new navmap object to the compiled nav map hash and parm hash
 given as filenames. genCourseAndUserOptions is a flag saying whether  given as filenames. genCourseAndUserOptions is a flag saying whether
Line 1577  documentation. genMailDiscussStatus caus Line 1577  documentation. genMailDiscussStatus caus
 information about the email and discussion status of  information about the email and discussion status of
 resources. Returns the navmap object if this is successful, or  resources. Returns the navmap object if this is successful, or
 B<undef> if not. You must check for undef; errors will occur when you  B<undef> if not. You must check for undef; errors will occur when you
 try to use the other methods otherwise.  try to use the other methods otherwise. getUserData, if true, will 
   retreive the user's performance data for various problems.
   
 =item * B<getIterator>(first, finish, filter, condition):  =item * B<getIterator>(first, finish, filter, condition):
   
Line 1598  sub new { Line 1599  sub new {
     $self->{PARM_HASH_FILE} = shift;      $self->{PARM_HASH_FILE} = shift;
     $self->{GENERATE_COURSE_USER_OPT} = shift;      $self->{GENERATE_COURSE_USER_OPT} = shift;
     $self->{GENERATE_EMAIL_DISCUSS_STATUS} = shift;      $self->{GENERATE_EMAIL_DISCUSS_STATUS} = shift;
       $self->{GET_USER_DATA} = shift;
   
     # Resource cache stores navmap resources as we reference them. We generate      # Resource cache stores navmap resources as we reference them. We generate
     # them on-demand so we don't pay for creating resources unless we use them.      # them on-demand so we don't pay for creating resources unless we use them.
Line 1735  sub init { Line 1737  sub init {
         $self->{DISCUSSION_TIME} = \%discussiontime;          $self->{DISCUSSION_TIME} = \%discussiontime;
         $self->{EMAIL_STATUS} = \%emailstatus;          $self->{EMAIL_STATUS} = \%emailstatus;
                   
     }          }
   
       if ($self->{GET_USER_DATA}) {
    # Retreive performance data on problems
    my %student_data = Apache::lonnet::currentdump($ENV{'request.course.id'},
          $ENV{'user.domain'},
          $ENV{'user.name'});
    $self->{STUDENT_DATA} = \%student_data;
       }
   
     $self->{PARM_CACHE} = {};      $self->{PARM_CACHE} = {};
     $self->{INITED} = 1;      $self->{INITED} = 1;
Line 3088  Get the Client IP/Name Access Control in Line 3098  Get the Client IP/Name Access Control in
   
 Get the answer-reveal date for the problem.  Get the answer-reveal date for the problem.
   
   =item * B<awarded>: 
   
   Gets the awarded value for the problem part. Requires genUserData set to
   true when the navmap object was created.
   
 =item * B<duedate>:  =item * B<duedate>:
   
 Get the due date for the problem.  Get the due date for the problem.
Line 3141  sub answerdate { Line 3156  sub answerdate {
     }      }
     return $self->parmval("answerdate", $part);      return $self->parmval("answerdate", $part);
 }  }
 sub awarded { my $self = shift; return $self->queryRestoreHash('awarded', shift); }  sub awarded { 
       my $self = shift; my $part = shift;
       if (!defined($part)) { $part = '0'; }
       return $self->{NAV_MAP}->{STUDENT_DATA}->{$self->symb()}->{'resource.'.$part.'.awarded'};
   }
 sub duedate {  sub duedate {
     (my $self, my $part) = @_;      (my $self, my $part) = @_;
     return $self->parmval("duedate", $part);      return $self->parmval("duedate", $part);
Line 3182  sub type { Line 3201  sub type {
 }  }
 sub weight {   sub weight { 
     my $self = shift; my $part = shift;      my $self = shift; my $part = shift;
     return $self->parmval("weight", $part);      if (!defined($part)) { $part = '0'; }
       return &Apache::lonnet::EXT('resource.'.$part.'.weight',
    $self->symb(), $ENV{'user.domain'},
    $ENV{'user.name'}, 
    $ENV{'request.course.sec'});
   
 }  }
   
 # Multiple things need this  # Multiple things need this

Removed from v.1.210  
changed lines
  Added in v.1.211


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