--- loncom/interface/lonnavmaps.pm 2002/10/07 21:07:47 1.68 +++ loncom/interface/lonnavmaps.pm 2002/10/08 18:54:39 1.69 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Navigate Maps Handler # -# $Id: lonnavmaps.pm,v 1.68 2002/10/07 21:07:47 bowersj2 Exp $ +# $Id: lonnavmaps.pm,v 1.69 2002/10/08 18:54:39 bowersj2 Exp $ # # Copyright Michigan State University Board of Trustees # @@ -892,7 +892,13 @@ sub new_handle { $res->OPEN_LATER => '', $res->TRIES_LEFT => 'navmap.open.gif', $res->INCORRECT => 'navmap.wrong.gif', - $res->OPEN => 'navmap.open.gif' ); + $res->OPEN => 'navmap.open.gif', + $res->ATTEMPTED => '' ); + + my %iconAltTags = + ( 'navmap.correct.gif' => 'Correct', + 'navmap.wrong.gif' => 'Incorrect', + 'navmap.open.gif' => 'Open' ); my %condenseStatuses = ( $res->NETWORK_FAILURE => 1, @@ -1108,7 +1114,7 @@ sub new_handle { $r->print(" ${newBranchText}${linkopen}$icon${linkclose}\n"); - if ($curRes->is_problem() && $part != "0" && !$condensed) { + if ($curRes->is_problem() && $part ne "0" && !$condensed) { $partLabel = " (Part $part)"; $title = ""; } @@ -1151,12 +1157,13 @@ sub new_handle { # columns? my $firstDisplayed = !$condensed && $multipart && $part eq "0"; - # THIRD ROW: Problem status icon + # 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"); + $r->print("$linkopen\"$alt\"$linkclose\n"); } else { $r->print("\n"); } @@ -1164,7 +1171,7 @@ sub new_handle { $r->print("\n"); } - # FOURTH ROW: Text description + # FOURTH COL: Text description $r->print("\n"); if ($curRes->kind() eq "res" && @@ -1244,7 +1251,7 @@ sub getLinkForResource { sub getDescription { my $res = shift; my $part = shift; - my $status = $res->getDateStatus(); + my $status = $res->status($part); if ($status == $res->NETWORK_FAILURE) { return ""; } if ($status == $res->NOTHING_SET) { @@ -1272,6 +1279,9 @@ sub getDescription { if ($status == $res->EXCUSED) { return "Excused by instructor"; } + if ($status == $res->ATTEMPTED) { + return "Not yet graded."; + } if ($status == $res->TRIES_LEFT) { my $tries = $res->tries(); my $maxtries = $res->maxtries(); @@ -2489,6 +2499,8 @@ B =item * B: Information not available due to network failure. +=item * B: Attempted, and not yet graded. + =back =cut @@ -2499,6 +2511,7 @@ sub INCORRECT_BY_OVERRIDE { return 12; } sub CORRECT { return 13; } sub CORRECT_BY_OVERRIDE { return 14; } sub EXCUSED { return 15; } +sub ATTEMPTED { return 16; } sub getCompletionStatus { my $self = shift; @@ -2517,6 +2530,7 @@ sub getCompletionStatus { if ($status eq 'incorrect_attempted') {return $self->INCORRECT; } if ($status eq 'incorrect_by_override') {return $self->INCORRECT_BY_OVERRIDE; } if ($status eq 'excused') {return $self->EXCUSED; } + if ($status eq 'ungraded_attempted') {return $self->ATTEMPTED; } return $self->NOT_ATTEMPTED; } @@ -2550,6 +2564,8 @@ Along with directly returning the date o =item * OPEN: The item is open and not yet tried. +=item * ATTEMPTED: The problem has been attempted. + =back =cut @@ -2572,7 +2588,11 @@ sub status { # There are a few whole rows we can dispose of: if ($completionStatus == CORRECT || $completionStatus == CORRECT_BY_OVERRIDE ) { - return CORRECT(); + return CORRECT; + } + + if ($completionStatus == ATTEMPTED) { + return ATTEMPTED; } # If it's EXCUSED, then return that no matter what @@ -2584,8 +2604,8 @@ sub status { return NOTHING_SET; } - # Now we're down to a 3 (incorrect, incorrect_override, not_attempted) - # by 4 matrix (date status). + # Now we're down to a 4 (incorrect, incorrect_override, not_attempted) + # by 4 matrix (date statuses). if ($dateStatus == PAST_DUE_ANSWER_LATER || $dateStatus == PAST_DUE_NO_ANSWER ) {