Diff for /loncom/interface/lonnavmaps.pm between versions 1.376 and 1.377

version 1.376, 2006/04/10 21:40:08 version 1.377, 2006/04/10 21:55:48
Line 318  MENU Line 318  MENU
       "Close navigation window");        "Close navigation window");
     }       } 
   
     my $jumpToFirstHomework = 0;  
     # Check to see if the student is jumping to next open, do-able problem      # Check to see if the student is jumping to next open, do-able problem
     if ($ENV{QUERY_STRING} =~ /^jumpToFirstHomework/) {      if ($ENV{QUERY_STRING} =~ /^jumpToFirstHomework/) {
         $jumpToFirstHomework = 1;  
         # Find the next homework problem that they can do.          # Find the next homework problem that they can do.
         my $iterator = $navmap->getIterator(undef, undef, undef, 1);          my $iterator = $navmap->getIterator(undef, undef, undef, 1);
         my $curRes;          my $curRes;
         my $foundDoableProblem = 0;          my $foundDoableProblem = 0;
         my $problemRes;          my $minimumduedate;
                   
         while (($curRes = $iterator->next()) && !$foundDoableProblem) {          while ($curRes = $iterator->next()) {
             if (ref($curRes) && $curRes->is_problem()) {              if (ref($curRes) && $curRes->is_problem()) {
                 my $status = $curRes->status();                  my $status = $curRes->status();
                 if ($curRes->completable()) {                  if ($curRes->completable()) {
                     $problemRes = $curRes;                      my $thisduedate=$curRes->duedate();
                       unless ($foundDoableProblem) {
                           $minimumduedate=$thisduedate;
       }
                           
                     $foundDoableProblem = 1;                      $foundDoableProblem = 1;
   
                     # Pop open all previous maps                      if ($thisduedate<=$minimumduedate) {
                     my $stack = $iterator->getStack();   # Pop open all previous maps
                     pop @$stack; # last resource in the stack is the problem   my $stack = $iterator->getStack();
                                  # itself, which we don't need in the map stack   pop @$stack; # last resource in the stack is the problem
                     my @mapPcs = map {$_->map_pc()} @$stack;   # itself, which we don't need in the map stack
                     $env{'form.filter'} = join(',', @mapPcs);   my @mapPcs = map {$_->map_pc()} @$stack;
    $env{'form.filter'} = join(',', @mapPcs);
                     # Mark as both "here" and "jump"  
                     $env{'form.postsymb'} = $curRes->symb();   # Mark as both "here" and "jump"
    $env{'form.postsymb'} = $curRes->symb();
                           $minimumduedate=$thisduedate;
       }
                 }                  }
             }              }
         }          }
Line 355  MENU Line 361  MENU
     } else {      } else {
  &add_linkitem(\%toplinkitems,'firsthomework',   &add_linkitem(\%toplinkitems,'firsthomework',
       'location.href="navmaps?jumpToFirstHomework"',        'location.href="navmaps?jumpToFirstHomework"',
       "Show Me My First Homework Problem");        "Show my first due problem");
     }      }
   
     my $suppressEmptySequences = 0;      my $suppressEmptySequences = 0;
Line 372  MENU Line 378  MENU
                         };                          };
  &add_linkitem(\%toplinkitems,'everything',   &add_linkitem(\%toplinkitems,'everything',
      'location.href="navmaps?sort='.$env{'form.sort'}.'"',       'location.href="navmaps?sort='.$env{'form.sort'}.'"',
       "Show Everything");        "Show everything");
         $r->print("<p><font size='+2'>".&mt("Uncompleted Homework")."</font></p>");          $r->print("<p><font size='+2'>".&mt("Uncompleted Problems")."</font></p>");
         $env{'form.filter'} = '';          $env{'form.filter'} = '';
         $env{'form.condition'} = 1;          $env{'form.condition'} = 1;
  $resource_no_folder_link = 1;   $resource_no_folder_link = 1;
Line 381  MENU Line 387  MENU
  &add_linkitem(\%toplinkitems,'uncompleted',   &add_linkitem(\%toplinkitems,'uncompleted',
       'location.href="navmaps?sort='.$env{'form.sort'}.        'location.href="navmaps?sort='.$env{'form.sort'}.
           '&showOnlyHomework=1"',            '&showOnlyHomework=1"',
       "Show Only Uncompleted Homework");        "Show only uncompleted problems");
     }      }
   
     my %selected=($env{'form.sort'} => 'selected=on');      my %selected=($env{'form.sort'} => 'selected=on');
Line 1603  sub render { Line 1609  sub render {
         if ($condition) {          if ($condition) {
     $link='"navmaps?condition=0&filter=&'.$queryString.      $link='"navmaps?condition=0&filter=&'.$queryString.
  '&here='.&Apache::lonnet::escape($here).'"';   '&here='.&Apache::lonnet::escape($here).'"';
     $text='Close All Folders';      $text='Close all folders';
         } else {          } else {
     $link='"navmaps?condition=1&filter=&'.$queryString.      $link='"navmaps?condition=1&filter=&'.$queryString.
  '&here='.&Apache::lonnet::escape($here).'"';   '&here='.&Apache::lonnet::escape($here).'"';
     $text='Open All Folders';      $text='Open all folders';
         }          }
  if ($args->{'caller'} eq 'navmapsdisplay') {   if ($args->{'caller'} eq 'navmapsdisplay') {
     &add_linkitem($args->{'linkitems'},'changefolder',      &add_linkitem($args->{'linkitems'},'changefolder',

Removed from v.1.376  
changed lines
  Added in v.1.377


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