Diff for /loncom/interface/lonnavmaps.pm between versions 1.505 and 1.507

version 1.505, 2015/04/13 16:30:28 version 1.507, 2015/04/15 18:56:15
Line 3014  sub retrieveResources { Line 3014  sub retrieveResources {
     my $bailout = shift;      my $bailout = shift;
     if (!defined($bailout)) { $bailout = 0; }      if (!defined($bailout)) { $bailout = 0; }
     my $showall = shift;      my $showall = shift;
     my $noblockcheck = shift      my $noblockcheck = shift;
     # Create the necessary iterator.      # Create the necessary iterator.
     if (!ref($map)) { # assume it's a url of a map.      if (!ref($map)) { # assume it's a url of a map.
         $map = $self->getResourceByUrl($map);          $map = $self->getResourceByUrl($map);
Line 3202  call to lonnet::allowed. This needs to b Line 3202  call to lonnet::allowed. This needs to b
 was already called from another routine called within lonnet::allowed,   was already called from another routine called within lonnet::allowed, 
 so as to prevent recursion.  so as to prevent recursion.
   
 Also note there is some old code floating around that triess to track  Also note there is some old code floating around that tries to track
 the depth of the iterator to see when it's done; do not copy that   the depth of the iterator to see when it's done; do not copy that 
 code. It is difficult to get right and harder to understand than  code. It is difficult to get right and harder to understand than
 this. They should be migrated to this new style.  this. They should be migrated to this new style.
Line 5622  sub completable { Line 5622  sub completable {
     return 0;      return 0;
 }  }
   
   =pod
   
   B<Answerable>
   
   The answerable method differs from the completable method in its handling of problem parts
   for which feedback on correctness is suppressed, but the student still has tries left, and
   the problem part is not past due, (i.e., the student could submit a different answer if
   he/she so chose). For that case completable will return 0, whereas answerable will return 1.
   
   =cut
   
   sub answerable {
       my $self = shift;
       if (!$self->is_problem()) { return 0; }
       my $partCount = $self->countParts();
       foreach my $part (@{$self->parts()}) {
           if ($part eq '0' && $partCount != 1) { next; }
           my $status = $self->status($part);
           if ($self->getCompletionStatus($part) == ATTEMPTED() ||
               $self->getCompletionStatus($part) == CREDIT_ATTEMPTED() ||
               $status == ANSWER_SUBMITTED() ) {
               if ($self->tries($part) < $self->maxtries($part) || !$self->maxtries($part)) {
                   return 1;
               }
           }
           if ($status == OPEN() || $status == TRIES_LEFT() || $status == NETWORK_FAILURE()) {
               return 1;
           }
       }
       # None of the parts were answerable, so neither is this problem.
       return 0;
   }
   
 =pod  =pod
   
 =head2 Resource/Nav Map Navigation  =head2 Resource/Nav Map Navigation

Removed from v.1.505  
changed lines
  Added in v.1.507


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