--- loncom/interface/lonnavmaps.pm 2011/09/15 03:06:52 1.444.2.5 +++ loncom/interface/lonnavmaps.pm 2010/03/29 17:55:55 1.447 @@ -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.447 2010/03/29 17:55:55 raeburn Exp $ # # Copyright Michigan State University Board of Trustees @@ -527,7 +527,6 @@ my %colormap = $resObj->INCORRECT => '', $resObj->OPEN => '', $resObj->NOTHING_SET => '', - $resObj->CREDIT_ATTEMPTED => '', $resObj->ATTEMPTED => '', $resObj->ANSWER_SUBMITTED => '', $resObj->PARTIALLY_CORRECT => '#006600' @@ -539,35 +538,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; @@ -707,11 +677,6 @@ sub getDescription { return &mt("Answer submitted, not yet graded"); } } - if ($status == $res->CREDIT_ATTEMPTED) { - if ($res->is_anonsurvey($part) || $res->is_survey($part)) { - return &mt("Credit for survey submission"); - } - } if ($status == $res->TRIES_LEFT) { my $tries = $res->tries($part); my $maxtries = $res->maxtries($part); @@ -1021,12 +986,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 +1000,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 +1013,7 @@ sub render_communication_status { my $feedback = $resource->getFeedback(); foreach my $msgid (split(/\,/, $feedback)) { if ($msgid) { - $feedbackHTML .= ' ' . ''.&mt('New E-mail').''; } @@ -1070,7 +1027,7 @@ sub render_communication_status { last if ($errorcount>=10); # Only output 10 bombs maximum if ($msgid) { $errorcount++; - $errorHTML .= ' ' . ''.&mt('New Error').''; } @@ -1090,11 +1047,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 +1085,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); @@ -1448,11 +1401,11 @@ sub render { my ($link,$text); if ($condition) { $link='navmaps?condition=0&filter=&'.$queryString. - '&here='.&escape($here); + '&here='.&escape($here); $text='Close all folders'; } else { $link='navmaps?condition=1&filter=&'.$queryString. - '&here='.&escape($here); + '&here='.&escape($here); $text='Open all folders'; } if ($env{'form.register'}) { @@ -1460,9 +1413,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 +1457,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'}) { @@ -1768,7 +1715,7 @@ END if (defined($anchor)) { $anchor='#'.$anchor; } my $srcHasQuestion = $src =~ /\?/; $args->{"resourceLink"} = $src. - ($srcHasQuestion?'&':'?') . + ($srcHasQuestion?'&':'?') . 'symb=' . &escape($symb).$anchor; } # Now, we've decided what parts to show. Loop through them and @@ -1830,11 +1777,12 @@ END # it's quite likely this might fix other browsers, too, and # certainly won't hurt anything. if ($displayedJumpMarker) { - $result .= &Apache::lonhtmlcommon::scripttag(" + $result .= " +"; } $result.=&Apache::loncommon::end_data_table(); @@ -1856,9 +1804,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) { @@ -2356,7 +2304,7 @@ resource object. Based on the symb of the resource, get a resource object for that resource. This is one of the proper ways to get a resource object. -=item * B(map_pc): +=item * B(map_pc): Based on the map_pc of the resource, get a resource object for the given map. This is one of the proper ways to get a resource object. @@ -3892,12 +3840,6 @@ resource of the map. Returns a string with the type of the map in it. -=item *B: - -Returns a string with a comma-separated ordered list of map_pc IDs -for the hierarchy of maps containing a map, with the top level -map first, then descending to deeper levels, with the enclosing map last. - =back =cut @@ -3928,12 +3870,6 @@ sub map_type { my $pc = $self->map_pc(); return $self->navHash("map_type_$pc", 0); } -sub map_hierarchy { - my $self = shift; - my $pc = $self->map_pc(); - return $self->navHash("map_hierarchy_$pc", 0); -} - ##### # Property queries @@ -4689,10 +4625,6 @@ Information not available due to network Attempted, and not yet graded. -=item * B: - -Attempted, and credit received for attempt (survey and anonymous survey only). - =back =cut @@ -4704,7 +4636,6 @@ sub CORRECT { return 13; } sub CORRECT_BY_OVERRIDE { return 14; } sub EXCUSED { return 15; } sub ATTEMPTED { return 16; } -sub CREDIT_ATTEMPTED { return 17; } sub getCompletionStatus { my $self = shift; @@ -4723,13 +4654,6 @@ sub getCompletionStatus { 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; } - if ($status eq 'credit_attempted') { - if ($self->is_anonsurvey($part) || $self->is_survey($part)) { - return $self->CREDIT_ATTEMPTED; - } else { - return $self->ATTEMPTED; - } - } return $self->NOT_ATTEMPTED; } @@ -4819,10 +4743,6 @@ The item is open and not yet tried. The problem has been attempted. -=item * B: - -The problem has been attempted, and credit given for the attempt (survey and anonymous survey only). - =item * B: An answer has been submitted, but the student should not see it. @@ -4896,10 +4816,6 @@ sub status { return ATTEMPTED; } - if ($completionStatus == CREDIT_ATTEMPTED) { - return CREDIT_ATTEMPTED; - } - # If it's EXCUSED, then return that no matter what if ($completionStatus == EXCUSED) { return EXCUSED; @@ -5002,7 +4918,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_/); @@ -5092,7 +5008,6 @@ my %compositeToSimple = INCORRECT() => INCORRECT, OPEN() => OPEN, ATTEMPTED() => ATTEMPTED, - CREDIT_ATTEMPTED() => CORRECT, ANSWER_SUBMITTED() => ATTEMPTED ); @@ -5166,9 +5081,8 @@ 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() || - $self->getCompletionStatus($part) == CREDIT_ATTEMPTED() || - $status == ANSWER_SUBMITTED() ) { + if ($self->getCompletionStatus($part) == ATTEMPTED() || + $status == ANSWER_SUBMITTED() ) { # did this part already, as well as we can next; }