\n");
-
- # Print the anchor if necessary
- if ($counter == $currentUrlIndex - $currentUrlDelta) {
- $r->print('');
- }
-
- # 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 ($curRes->src() eq $currenturl && !$displayedHereMarker) {
- $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 = "";
-
- if ($curRes->hasDiscussion()) {
- $discussionHTML = $linkopen .
- '' .
- $linkclose;
- }
-
- if ($curRes->getFeedback()) {
- my $feedback = $curRes->getFeedback();
- foreach (split(/\,/, $feedback)) {
- if ($_) {
- $feedbackHTML .= ' '
- . '';
- }
- }
- }
-
- $r->print("$discussionHTML$feedbackHTML | ");
-
- # 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");
- }
-
- # 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);
- }
- 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(); }
- }
+ } else {
+ &add_linkitem(\%toplinkitems,'firsthomework',
+ 'location.href="navmaps?jumpToFirstHomework"',
+ "Show my first due problem");
+ }
+
+ my $suppressEmptySequences = 0;
+ my $filterFunc = undef;
+ my $resource_no_folder_link = 0;
+
+ # Display only due homework.
+ my $showOnlyHomework = 0;
+ if ($env{'form.showOnlyHomework'} eq "1") {
+ $showOnlyHomework = 1;
+ $suppressEmptySequences = 1;
+ $filterFunc = sub { my $res = shift;
+ return $res->completable() || $res->is_map();
+ };
+ &add_linkitem(\%toplinkitems,'everything',
+ 'location.href="navmaps?sort='.$env{'form.sort'}.'"',
+ "Show everything");
+ $r->print("