Diff for /loncom/interface/lonnavmaps.pm between versions 1.219.2.1 and 1.220

version 1.219.2.1, 2003/08/21 18:29:54 version 1.220, 2003/08/07 14:29:43
Line 129  sub real_handler { Line 129  sub real_handler {
     $r->send_http_header;      $r->send_http_header;
   
     # Create the nav map      # Create the nav map
     my $navmap = Apache::lonnavmaps::navmap->new(      my $navmap = Apache::lonnavmaps::navmap->new(1, 1);
                         $ENV{"request.course.fn"}.".db",  
                         $ENV{"request.course.fn"}."_parms.db", 1, 1);  
   
   
     if (!defined($navmap)) {      if (!defined($navmap)) {
Line 1172  sub render { Line 1170  sub render {
     if (!$ENV{'form.folderManip'} && !defined($args->{'iterator'})) {      if (!$ENV{'form.folderManip'} && !defined($args->{'iterator'})) {
         # Step 1: Check to see if we have a navmap          # Step 1: Check to see if we have a navmap
         if (!defined($navmap)) {          if (!defined($navmap)) {
             $navmap = Apache::lonnavmaps::navmap->new(              $navmap = Apache::lonnavmaps::navmap->new(1, 1);
                         $ENV{"request.course.fn"}.".db",  
                         $ENV{"request.course.fn"}."_parms.db", 1, 1);  
             $mustCloseNavMap = 1;              $mustCloseNavMap = 1;
         }          }
         $navmap->init();          $navmap->init();
Line 1238  sub render { Line 1234  sub render {
                   
         # Step 1: Check to see if we have a navmap          # Step 1: Check to see if we have a navmap
         if (!defined($navmap)) {          if (!defined($navmap)) {
             $navmap = Apache::lonnavmaps::navmap->new($r,               $navmap = Apache::lonnavmaps::navmap->new(1, 1);
                         $ENV{"request.course.fn"}.".db",  
                         $ENV{"request.course.fn"}."_parms.db", 1, 1);  
             $mustCloseNavMap = 1;              $mustCloseNavMap = 1;
         }          }
         # Paranoia: Make sure it's ready          # Paranoia: Make sure it's ready
Line 1646  To create a navmap object, use the follo Line 1640  To create a navmap object, use the follo
   
 =over 4  =over 4
   
 =item * B<Apache::lonnavmaps::navmap-E<gt>new>(navHashFile, parmHashFile,   =item * B<Apache::lonnavmaps::navmap-E<gt>new>(
   genCourseAndUserOptions, genMailDiscussStatus, getUserData):    genCourseAndUserOptions, genMailDiscussStatus, getUserData):
   
 Binds a new navmap object to the compiled nav map hash and parm hash  Creates a new navmap object. genCourseAndUserOptions is a flag saying whether
 given as filenames. genCourseAndUserOptions is a flag saying whether  
 the course options and user options hash should be generated. This is  the course options and user options hash should be generated. This is
 for when you are using the parameters of the resources that require  for when you are using the parameters of the resources that require
 them; see documentation in resource object  them; see documentation in resource object
Line 1692  sub new { Line 1685  sub new {
     my $class = ref($proto) || $proto;      my $class = ref($proto) || $proto;
     my $self = {};      my $self = {};
   
     $self->{NAV_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;      $self->{GET_USER_DATA} = shift;
Line 1710  sub new { Line 1701  sub new {
   
     my %navmaphash;      my %navmaphash;
     my %parmhash;      my %parmhash;
     if (!(tie(%navmaphash, 'GDBM_File', $self->{NAV_HASH_FILE},      my $courseFn = $ENV{"request.course.fn"};
       if (!(tie(%navmaphash, 'GDBM_File', "${courseFn}.db",
               &GDBM_READER(), 0640))) {                &GDBM_READER(), 0640))) {
         return undef;          return undef;
     }      }
           
     if (!(tie(%parmhash, 'GDBM_File', $self->{PARM_HASH_FILE},      if (!(tie(%parmhash, 'GDBM_File', "${courseFn}_parms.db",
               &GDBM_READER(), 0640)))                &GDBM_READER(), 0640)))
     {      {
         untie %{$self->{PARM_HASH}};          untie %{$self->{PARM_HASH}};
Line 3945  sub status { Line 3937  sub status {
     if ($completionStatus == INCORRECT || $completionStatus == INCORRECT_BY_OVERRIDE) {      if ($completionStatus == INCORRECT || $completionStatus == INCORRECT_BY_OVERRIDE) {
         # and there are TRIES LEFT:          # and there are TRIES LEFT:
         if ($self->tries($part) < $self->maxtries($part) || !$self->maxtries($part)) {          if ($self->tries($part) < $self->maxtries($part) || !$self->maxtries($part)) {
     return $suppressFeedback ? ANSWER_SUBMITTED : TRIES_LEFT;              return TRIES_LEFT;
  }          }
         return $suppressFeedback ? ANSWER_SUBMITTED : INCORRECT; # otherwise, return orange; student can't fix this          return $suppressFeedback ? ANSWER_SUBMITTED : INCORRECT; # otherwise, return orange; student can't fix this
     }      }
   

Removed from v.1.219.2.1  
changed lines
  Added in v.1.220


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