Diff for /loncom/interface/lonnavmaps.pm between versions 1.196 and 1.202

version 1.196, 2003/06/10 18:42:18 version 1.202, 2003/06/12 20:56:19
Line 72  my %statusIconMap = Line 72  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.ellipsis.gif',
       $resObj->ANSWER_SUBMITTED   => '' );        $resObj->ANSWER_SUBMITTED   => '' );
   
 my %iconAltTags =   my %iconAltTags = 
Line 249  sub real_handler { Line 249  sub real_handler {
   
     my $suppressEmptySequences = 0;      my $suppressEmptySequences = 0;
     my $filterFunc = undef;      my $filterFunc = undef;
       my $resource_no_folder_link = 0;
   
     # Display only due homework.      # Display only due homework.
     my $showOnlyHomework = 0;      my $showOnlyHomework = 0;
     if ($ENV{QUERY_STRING} eq 'showOnlyHomework') {      if ($ENV{QUERY_STRING} eq 'showOnlyHomework') {
         $showOnlyHomework = 1;          $showOnlyHomework = 1;
         $suppressEmptySequences = 1;          $suppressEmptySequences = 1;
         $filterFunc = sub { my $res = shift;           $filterFunc = sub { my $res = shift; 
                             return $res->completable() || $res->is_sequence();                              return $res->completable() || $res->is_map();
                         };                          };
         $r->print("<p><font size='+2'>Uncompleted Homework</font></p>");          $r->print("<p><font size='+2'>Uncompleted Homework</font></p>");
         $ENV{'form.filter'} = '';          $ENV{'form.filter'} = '';
         $ENV{'form.condition'} = 1;          $ENV{'form.condition'} = 1;
    $resource_no_folder_link = 1;
     } else {      } else {
         $r->print("<a href='navmaps?showOnlyHomework'>" .          $r->print("<a href='navmaps?showOnlyHomework'>" .
                   "Show Only Uncompleted Homework</a><br />");                    "Show Only Uncompleted Homework</a><br />");
Line 272  sub real_handler { Line 275  sub real_handler {
                        'suppressNavmap' => 1,                         'suppressNavmap' => 1,
                        'suppressEmptySequences' => $suppressEmptySequences,                         'suppressEmptySequences' => $suppressEmptySequences,
                        'filterFunc' => $filterFunc,                         'filterFunc' => $filterFunc,
          'resource_no_folder_link' => $resource_no_folder_link,
                        'r' => $r};                         'r' => $r};
     my $render = render($renderArgs);      my $render = render($renderArgs);
     $navmap->untieHashes();      $navmap->untieHashes();
Line 378  sub getDescription { Line 382  sub getDescription {
         return "Excused by instructor";          return "Excused by instructor";
     }      }
     if ($status == $res->ATTEMPTED) {      if ($status == $res->ATTEMPTED) {
         return "Not yet graded.";          return "Answer submitted, not yet graded.";
     }      }
     if ($status == $res->TRIES_LEFT) {      if ($status == $res->TRIES_LEFT) {
         my $tries = $res->tries($part);          my $tries = $res->tries($part);
Line 919  sub render_resource { Line 923  sub render_resource {
         $nonLinkedText .= ' (' . $resource->countParts() . ' parts)';          $nonLinkedText .= ' (' . $resource->countParts() . ' parts)';
     }      }
   
     if (!$params->{'resource_nolink'}) {      if (!$params->{'resource_nolink'} && $src !~ /^\/uploaded\//) {
         $result .= "  $curMarkerBegin<a href='$link'>$title$partLabel</a>$curMarkerEnd $nonLinkedText</td>";          $result .= "  $curMarkerBegin<a href='$link'>$title$partLabel</a>$curMarkerEnd $nonLinkedText</td>";
     } else {      } else {
         $result .= "  $curMarkerBegin$title$partLabel$curMarkerEnd $nonLinkedText</td>";          $result .= "  $curMarkerBegin$title$partLabel$curMarkerEnd $nonLinkedText</td>";
Line 966  sub render_communication_status { Line 970  sub render_communication_status {
         }          }
     }      }
   
       if ($params->{'multipart'} && $part != '0') {
    $discussionHTML = $feedbackHTML = $errorHTML = '';
       }
   
     return "<td width=\"75\" align=\"left\" valign=\"center\">$discussionHTML$feedbackHTML$errorHTML&nbsp;</td>";      return "<td width=\"75\" align=\"left\" valign=\"center\">$discussionHTML$feedbackHTML$errorHTML&nbsp;</td>";
   
 }  }
Line 1289  sub render { Line 1297  sub render {
   
             if (ref($curRes)) {               if (ref($curRes)) { 
                 # Parallel pre-processing: Do sequences have non-filtered-out children?                  # Parallel pre-processing: Do sequences have non-filtered-out children?
                 if ($curRes->is_sequence()) {                  if ($curRes->is_map()) {
                     $curRes->{DATA}->{HAS_VISIBLE_CHILDREN} = 0;                      $curRes->{DATA}->{HAS_VISIBLE_CHILDREN} = 0;
                     # Sequences themselves do not count as visible children,                      # Sequences themselves do not count as visible children,
                     # unless those sequences also have visible children.                      # unless those sequences also have visible children.
Line 1352  sub render { Line 1360  sub render {
         }           } 
   
         # If this is an empty sequence and we're filtering them, continue on          # If this is an empty sequence and we're filtering them, continue on
         if ($curRes->is_sequence() && $args->{'suppressEmptySequences'} &&          if ($curRes->is_map() && $args->{'suppressEmptySequences'} &&
             !$curRes->{DATA}->{HAS_VISIBLE_CHILDREN}) {              !$curRes->{DATA}->{HAS_VISIBLE_CHILDREN}) {
             next;              next;
         }          }
Line 1411  sub render { Line 1419  sub render {
                         @parts = ($parts[0]);                          @parts = ($parts[0]);
                         $args->{'condensed'} = 1;                          $args->{'condensed'} = 1;
                     }                      }
                       
                 }                  }
    # Multipart problem with one part: always "condense" (happens
    #  to match the desirable behavior)
    if ($curRes->countParts() == 1) {
       @parts = ($parts[0]);
       $args->{'condensed'} = 1;
    }
             }              }
         }           } 
                           
Line 1586  sub new { Line 1599  sub new {
         return undef;          return undef;
     }      }
   
     # try copying into memory      $self->{NAV_HASH} = \%navmaphash;
     my %tmpnavhash;  
     while (my ($k, $v) = each(%navmaphash)) {  
  $tmpnavhash{$k} = $v;  
     }  
     untie %navmaphash;  
   
     $self->{NAV_HASH} = \%tmpnavhash;  
     $self->{PARM_HASH} = \%parmhash;      $self->{PARM_HASH} = \%parmhash;
     $self->{INITED} = 0;      $self->{INITED} = 0;
   

Removed from v.1.196  
changed lines
  Added in v.1.202


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