--- loncom/interface/lonnavmaps.pm 2011/09/15 03:06:52 1.444.2.5 +++ loncom/interface/lonnavmaps.pm 2010/11/17 22:46:27 1.451 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Navigate Maps Handler # -# $Id: lonnavmaps.pm,v 1.444.2.5 2011/09/15 03:06:52 raeburn Exp $ +# $Id: lonnavmaps.pm,v 1.451 2010/11/17 22:46:27 raeburn Exp $ # # Copyright Michigan State University Board of Trustees @@ -527,8 +527,8 @@ my %colormap = $resObj->INCORRECT => '', $resObj->OPEN => '', $resObj->NOTHING_SET => '', - $resObj->CREDIT_ATTEMPTED => '', $resObj->ATTEMPTED => '', + $resObj->CREDIT_ATTEMPTED => '', $resObj->ANSWER_SUBMITTED => '', $resObj->PARTIALLY_CORRECT => '#006600' ); @@ -539,35 +539,6 @@ my $hurryUpColor = "#FF0000"; my $future_slots_checked = 0; my $future_slots = 0; -sub close { - if ($env{'environment.remotenavmap'} ne 'on') { return ''; } - return(< -window.status='Accessing Nav Control'; -menu=window.open("/adm/rat/empty.html","loncapanav", - "height=600,width=400,scrollbars=1"); -window.status='Closing Nav Control'; -menu.close(); -window.status='Done.'; - -ENDCLOSE -} - -sub update { - if ($env{'environment.remotenavmap'} ne 'on') { return ''; } - if (!$env{'request.course.id'}) { return ''; } - if ($ENV{'REQUEST_URI'}=~m|^/adm/navmaps|) { return ''; } - return(< - -ENDUPDATE -} - - sub addToFilter { my $hashIn = shift; my $addition = shift; @@ -1021,12 +992,8 @@ sub render_resource { $nonLinkedText .= ' ('.&mt('[_1] parts', $resource->countParts()).')'; } - my $target; - if ($env{'environment.remotenavmap'} eq 'on') { - $target=' target="loncapaclient" '; - } if (!$params->{'resource_nolink'} && !$resource->is_sequence() && !$resource->is_empty_sequence) { - $result .= "$curMarkerBegin$title$partLabel$curMarkerEnd$nonLinkedText"; + $result .= "$curMarkerBegin$title$partLabel$curMarkerEnd$nonLinkedText"; } else { $result .= "$curMarkerBegin$linkopen$title$partLabel$curMarkerEnd$nonLinkedText"; } @@ -1039,11 +1006,7 @@ sub render_communication_status { my $discussionHTML = ""; my $feedbackHTML = ""; my $errorHTML = ""; my $link = $params->{"resourceLink"}; - my $target; - if ($env{'environment.remotenavmap'} eq 'on') { - $target=' target="loncapaclient" '; - } - my $linkopen = ""; + my $linkopen = ""; my $linkclose = ""; my $location=&Apache::loncommon::lonhttpdurl("/adm/lonMisc"); if ($resource->hasDiscussion()) { @@ -1056,7 +1019,7 @@ sub render_communication_status { my $feedback = $resource->getFeedback(); foreach my $msgid (split(/\,/, $feedback)) { if ($msgid) { - $feedbackHTML .= ' ' . ''.&mt('New E-mail').''; } @@ -1070,7 +1033,7 @@ sub render_communication_status { last if ($errorcount>=10); # Only output 10 bombs maximum if ($msgid) { $errorcount++; - $errorHTML .= ' ' . ''.&mt('New Error').''; } @@ -1090,11 +1053,7 @@ sub render_quick_status { $params->{'multipart'} && $part eq "0"; my $link = $params->{"resourceLink"}; - my $target; - if ($env{'environment.remotenavmap'} eq 'on') { - $target=' target="loncapaclient" '; - } - my $linkopen = ""; + my $linkopen = ""; my $linkclose = ""; $result .= ''; @@ -1132,7 +1091,7 @@ sub render_long_status { } if ($resource->kind() eq "res" && - $resource->is_raw_problem() && + ($resource->is_problem() || $resource->is_practice()) && !$firstDisplayed) { if ($color) {$result .= ""; } $result .= getDescription($resource, $part); @@ -1460,9 +1419,9 @@ sub render { } if ($args->{'caller'} eq 'navmapsdisplay') { &add_linkitem($args->{'linkitems'},'changefolder', - "location.href='$link'",$text); + "location.href='$link'",$text); } else { - $result.= ''.&mt($text).''; + $result.= ''.&mt($text).''; } $result .= "\n"; } @@ -1504,19 +1463,13 @@ END if ($args->{'caller'} eq 'navmapsdisplay') { $result .= ''. - ''. - &show_linkitems_toolbar($args->{'linkitems'}); + &Apache::loncommon::help_open_menu('Navigation Screen','Navigation_Screen',undef,'RAT').''; + $result .= ''; + $result.=''; + $result.=&show_linkitems_toolbar($args->{'linkitems'}); if ($args->{'sort_html'}) { - if ($env{'environment.remotenavmap'} ne 'on') { - $result .= ''. - ''; - } else { - $result .= ''; - } - } else { - $result .= ''; + $result.=''. + ''; } $result .= '
'. - &Apache::loncommon::help_open_menu('Navigation Screen','Navigation_Screen',undef,'RAT').' '.&mt('Tools:').' '.&mt('Tools:').'   '.$args->{'sort_html'}.'

'. - $args->{'sort_html'}.'
   '.$args->{'sort_html'}.'
'; } elsif ($args->{'sort_html'}) { @@ -1856,9 +1809,9 @@ sub add_linkitem { sub show_linkitems_toolbar { my ($linkitems,$condition)=@_; - my @linkorder = ("launchnav","closenav","firsthomework", - "everything","uncompleted","changefolder","clearbubbles"); - my $result .=''."\n". + my @linkorder = ('firsthomework','everything','uncompleted', + 'changefolder','clearbubbles'); + my $result .=''."\n". ''."\n". '
    '; foreach my $link (@linkorder) { @@ -2626,7 +2579,7 @@ in the filter function. Retrieves version infomation for a url. Returns the version (a number, or the string "mostrecent") for resources which have version information in the big hash. - + =cut @@ -3512,7 +3465,7 @@ sub navHash { my $param = shift; my $id = shift; my $arg = $param . ($id?$self->{ID}:""); - if (defined($arg)) { + if (ref($self) && ref($self->{NAV_MAP}) && defined($arg)) { return $self->{NAV_MAP}->navhash($arg); } return; @@ -3934,7 +3887,6 @@ sub map_hierarchy { return $self->navHash("map_hierarchy_$pc", 0); } - ##### # Property queries ##### @@ -5002,7 +4954,7 @@ sub check_for_slot { my $taskstatus = $self->taskstatus(); $is_correct = (($taskstatus eq 'pass') || ($self->solved() =~ /^correct_/)); - $got_grade = ($taskstatus =~ /^(?:pass|fail)$/); + $got_grade = ($self->solved() =~ /^(?:pass|fail)$/); } else { $got_grade = 1; $is_correct = ($self->solved() =~ /^correct_/); @@ -5166,9 +5118,9 @@ sub completable { # "If any of the parts are open, or have tries left (implies open), # and it is not "attempted" (manually graded problem), it is # not "complete" - if ($self->getCompletionStatus($part) == ATTEMPTED() || + if ($self->getCompletionStatus($part) == ATTEMPTED() || $self->getCompletionStatus($part) == CREDIT_ATTEMPTED() || - $status == ANSWER_SUBMITTED() ) { + $status == ANSWER_SUBMITTED() ) { # did this part already, as well as we can next; }