Diff for /loncom/interface/lonnavmaps.pm between versions 1.184 and 1.185

version 1.184, 2003/05/05 17:44:03 version 1.185, 2003/05/12 18:22:38
Line 71  my %statusIconMap = Line 71  my %statusIconMap =
       $resObj->TRIES_LEFT         => 'navmap.open.gif',        $resObj->TRIES_LEFT         => 'navmap.open.gif',
       $resObj->INCORRECT          => 'navmap.wrong.gif',        $resObj->INCORRECT          => 'navmap.wrong.gif',
       $resObj->OPEN               => 'navmap.open.gif',        $resObj->OPEN               => 'navmap.open.gif',
       $resObj->ATTEMPTED          => 'navmap.open.gif' );        $resObj->ATTEMPTED          => 'navmap.open.gif',
         $resObj->ANSWER_SUBMITTED   => '' );
   
 my %iconAltTags =   my %iconAltTags = 
     ( 'navmap.correct.gif' => 'Correct',      ( 'navmap.correct.gif' => 'Correct',
Line 365  sub getDescription { Line 366  sub getDescription {
             return "No due date $triesString";              return "No due date $triesString";
         }          }
     }      }
       if ($status == $res->ANSWER_SUBMITTED) {
           return 'Answer submitted';
       }
 }  }
   
 # Convenience function, so others can use it: Is the problem due in less then  # Convenience function, so others can use it: Is the problem due in less then
Line 2799  sub is_sequence { Line 2803  sub is_sequence {
 sub parmval {  sub parmval {
     my $self = shift;      my $self = shift;
     my $what = shift;      my $what = shift;
     my $part = shift || "0";      my $part = shift;
       if (!defined($part)) { 
           $part = '0'; 
       }
     return $self->{NAV_MAP}->parmval($part.'.'.$what, $self->symb());      return $self->{NAV_MAP}->parmval($part.'.'.$what, $self->symb());
 }  }
   
Line 2973  sub opendate { Line 2980  sub opendate {
     }      }
     return $self->parmval("opendate");      return $self->parmval("opendate");
 }  }
   sub problemstatus {
       (my $self, my $part) = @_;
       return $self->parmval("problemstatus", $part);
   }
 sub sig {  sub sig {
     (my $self, my $part) = @_;      (my $self, my $part) = @_;
     return $self->parmval("sig", $part);      return $self->parmval("sig", $part);
Line 3366  sub queryRestoreHash { Line 3377  sub queryRestoreHash {
     my $self = shift;      my $self = shift;
     my $hashentry = shift;      my $hashentry = shift;
     my $part = shift;      my $part = shift;
     $part = "0" if (!defined($part));      $part = "0" if (!defined($part) || $part eq '');
     return $self->NETWORK_FAILURE if ($self->{NAV_MAP}->{NETWORK_FAILURE});      return $self->NETWORK_FAILURE if ($self->{NAV_MAP}->{NETWORK_FAILURE});
   
     $self->getReturnHash();      $self->getReturnHash();
Line 3384  combine the two status tidbits into one Line 3395  combine the two status tidbits into one
 represent the status of the resource as a whole. The precise logic is  represent the status of the resource as a whole. The precise logic is
 documented in the comments of the status method. The following results  documented in the comments of the status method. The following results
 may be returned, all available as methods on the resource object  may be returned, all available as methods on the resource object
 ($res->NETWORK_FAILURE):  ($res->NETWORK_FAILURE): In addition to the return values that match
   the date or completion status, this function can return "ANSWER_SUBMITTED"
   if that problemstatus parameter value is set to No, suppressing the
   incorrect/correct feedback.
   
 =over 4  =over 4
   
Line 3443  The item is open and not yet tried. Line 3457  The item is open and not yet tried.
   
 The problem has been attempted.  The problem has been attempted.
   
   =item * B<ANSWER_SUBMITTED>:
   
   An answer has been submitted, but the student should not see it.
   
 =back  =back
   
 =cut  =cut
   
 sub TRIES_LEFT { return 10; }  sub TRIES_LEFT       { return 20; }
   sub ANSWER_SUBMITTED { return 21; }
   
 sub status {  sub status {
     my $self = shift;      my $self = shift;
Line 3462  sub status { Line 3481  sub status {
   
     if ($completionStatus == NETWORK_FAILURE) { return NETWORK_FAILURE; }      if ($completionStatus == NETWORK_FAILURE) { return NETWORK_FAILURE; }
   
       my $suppressFeedback = $self->parmval("problemstatus", $part) eq 'No';
   
     # There are a few whole rows we can dispose of:      # There are a few whole rows we can dispose of:
     if ($completionStatus == CORRECT ||      if ($completionStatus == CORRECT ||
         $completionStatus == CORRECT_BY_OVERRIDE ) {          $completionStatus == CORRECT_BY_OVERRIDE ) {
         return CORRECT;           return $suppressFeedback? ANSWER_SUBMITTED : CORRECT; 
     }      }
   
     if ($completionStatus == ATTEMPTED) {      if ($completionStatus == ATTEMPTED) {
Line 3506  sub status { Line 3527  sub status {
         if ($self->tries($part) < $self->maxtries($part) || !$self->maxtries($part)) {          if ($self->tries($part) < $self->maxtries($part) || !$self->maxtries($part)) {
             return TRIES_LEFT;              return TRIES_LEFT;
         }          }
         return INCORRECT; # otherwise, return orange; student can't fix this          return $suppressFeedback ? ANSWER_SUBMITTED : INCORRECT; # otherwise, return orange; student can't fix this
     }      }
   
     # Otherwise, it's untried and open      # Otherwise, it's untried and open

Removed from v.1.184  
changed lines
  Added in v.1.185


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