\n");
-
- # Print the anchor if necessary
- if ($counter == $currentJumpIndex - $currentJumpDelta ) {
- $r->print('');
- $displayedJumpMarker = 1;
- }
-
- # print indentation
- for (my $i = 0; $i < $indentLevel - $deltalevel; $i++) {
- $r->print($indentString);
- }
-
- $r->print(" ${newBranchText}${linkopen}$icon${linkclose}\n");
- my $curMarkerBegin = "";
- my $curMarkerEnd = "";
-
- # Is this the current resource?
- if (!$displayedHereMarker &&
- (($hereType == SYMB() && $curRes->symb eq $here) ||
- ($hereType == URL() && $curRes->src eq $here))) {
- $curMarkerBegin = '> ';
- $curMarkerEnd = ' <';
- $displayedHereMarker = 1;
- }
-
- if ($curRes->is_problem() && $part ne "0" && !$condensed) {
- $partLabel = " (Part $part)";
- $title = "";
- }
- if ($multipart && $condensed) {
- $nonLinkedText .= ' (' . $curRes->countParts() . ' parts)';
- }
-
- $r->print(" $curMarkerBegin$title$partLabel $curMarkerEnd $nonLinkedText");
-
- #if ($curRes->{RESOURCE_ERROR}) {
- # $r->print(&Apache::loncommon::help_open_topic ("Navmap_Host_Down",
- # 'Host down'));
- # }
-
- $r->print(" | \n");
-
- # SECOND COL: Is there text, feedback, errors??
- my $discussionHTML = ""; my $feedbackHTML = ""; my $errorHTML = "";
-
- if ($curRes->hasDiscussion()) {
- $discussionHTML = $linkopen .
- '' .
- $linkclose;
- }
-
- if ($curRes->getFeedback()) {
- my $feedback = $curRes->getFeedback();
- foreach (split(/\,/, $feedback)) {
- if ($_) {
- $feedbackHTML .= ' '
- . '';
- }
- }
- }
-
- if ($curRes->getErrors()) {
- my $errors = $curRes->getErrors();
- foreach (split(/,/, $errors)) {
- if ($_) {
- $errorHTML .= ' '
- . '';
- }
- }
- }
-
- $r->print("$discussionHTML$feedbackHTML$errorHTML | ");
-
- # Is this the first displayed part of a multi-part problem
- # that has not been condensed, so we should suppress these two
- # columns so we don't display useless status info about part
- # "0"?
- my $firstDisplayed = !$condensed && $multipart && $part eq "0";
-
- # THIRD COL: Problem status icon
- if ($curRes->is_problem() &&
- !$firstDisplayed) {
- my $icon = $statusIconMap{$curRes->status($part)};
- my $alt = $iconAltTags{$icon};
- if ($icon) {
- $r->print("$linkopen$linkclose | \n");
- } else {
- $r->print(" | \n");
- }
- } else { # not problem, no icon
- $r->print(" | \n");
- }
+ if ($ENV{QUERY_STRING} eq 'launchExternal') {
+ $r->print('
+ ');
+ $r->print('
+ ');
+ }
+
+ if ($env{'environment.remotenavmap'} ne 'on') {
+ $r->print(&launch_win('link','yes',\%toplinkitems));
+ }
+ if ($env{'environment.remotenavmap'} eq 'on') {
+ &add_linkitem(\%toplinkitems,'closenav','collapse()',
+ "Close navigation window");
+ }
+
+ my $jumpToFirstHomework = 0;
+ # Check to see if the student is jumping to next open, do-able problem
+ if ($ENV{QUERY_STRING} =~ /^jumpToFirstHomework/) {
+ $jumpToFirstHomework = 1;
+ # Find the next homework problem that they can do.
+ my $iterator = $navmap->getIterator(undef, undef, undef, 1);
+ my $curRes;
+ my $foundDoableProblem = 0;
+ my $problemRes;
+
+ while (($curRes = $iterator->next()) && !$foundDoableProblem) {
+ if (ref($curRes) && $curRes->is_problem()) {
+ my $status = $curRes->status();
+ if ($curRes->completable()) {
+ $problemRes = $curRes;
+ $foundDoableProblem = 1;
+
+ # Pop open all previous maps
+ my $stack = $iterator->getStack();
+ pop @$stack; # last resource in the stack is the problem
+ # itself, which we don't need in the map stack
+ my @mapPcs = map {$_->map_pc()} @$stack;
+ $env{'form.filter'} = join(',', @mapPcs);
- # FOURTH COL: Text description
- $r->print("\n");
-
- if ($curRes->kind() eq "res" &&
- $curRes->is_problem() &&
- !$firstDisplayed) {
- $r->print ("") if ($color);
- $r->print (getDescription($curRes, $part));
- $r->print ("") if ($color);
+ # Mark as both "here" and "jump"
+ $env{'form.postsymb'} = $curRes->symb();
}
- if ($curRes->is_map() && advancedUser() && $curRes->randompick()) {
- $r->print('(randomly select ' . $curRes->randompick() .')');
- }
-
- $r->print(" |
\n");
-
- if (!($counter % 20)) { $r->rflush(); }
- if ($counter == 2) { $r->rflush(); }
}
}
- $curRes = $mapIterator->next();
- }
-
- $r->print("