--- loncom/interface/lonnavmaps.pm 2010/08/15 00:03:25 1.444.2.2 +++ loncom/interface/lonnavmaps.pm 2010/03/16 19:55:49 1.445 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Navigate Maps Handler # -# $Id: lonnavmaps.pm,v 1.444.2.2 2010/08/15 00:03:25 raeburn Exp $ +# $Id: lonnavmaps.pm,v 1.445 2010/03/16 19:55:49 droeschl 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 .= ''; @@ -1447,22 +1400,19 @@ sub render { if ($printCloseAll && !$args->{'resource_no_folder_link'}) { my ($link,$text); if ($condition) { - $link='navmaps?condition=0&filter=&'.$queryString. - '&here='.&escape($here); + $link='"navmaps?condition=0&filter=&'.$queryString. + '&here='.&escape($here).'"'; $text='Close all folders'; } else { - $link='navmaps?condition=1&filter=&'.$queryString. - '&here='.&escape($here); + $link='"navmaps?condition=1&filter=&'.$queryString. + '&here='.&escape($here).'"'; $text='Open all folders'; } - if ($env{'form.register'}) { - $link .= '&register='.$env{'form.register'}; - } 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"; } @@ -1478,9 +1428,6 @@ sub render { END - if ($env{'form.register'}) { - $result .= ''; - } if ($args->{'sort'} eq 'discussion') { my $totdisc = 0; my $haveDisc = ''; @@ -1502,25 +1449,17 @@ END $result.=''; } + if ($args->{'caller'} eq 'navmapsdisplay') { $result .= ''; - if ($env{'environment.remotenavmap'} ne 'on') { $result .= ''; - } else { - $result .= ''; - } - $result.=''; + $result.=""; $result.=&show_linkitems_toolbar($args->{'linkitems'}); if ($args->{'sort_html'}) { - if ($env{'environment.remotenavmap'} ne 'on') { - $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'}) { $result.=$args->{'sort_html'}; @@ -1771,7 +1710,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 @@ -1833,11 +1772,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(); @@ -1857,38 +1797,71 @@ sub add_linkitem { $$linkitems{$name}{'text'}=&mt($text); } +sub show_linkitems { + my ($linkitems)=@_; + my @linkorder = ("blank","launchnav","closenav","firsthomework", + "everything","uncompleted","changefolder","clearbubbles"); + + my $result .= (< + +
+   +
'."\n"; + + return $result; +} + sub show_linkitems_toolbar { my ($linkitems,$condition)=@_; - my @linkorder = ("launchnav","closenav","firsthomework", + my @linkorder = ("blank","launchnav","closenav","firsthomework", "everything","uncompleted","changefolder","clearbubbles"); - my $result .=''."\n". - ''."\n". - '
    '; - foreach my $link (@linkorder) { - my $link_id = 'LC_content_toolbar_'.$link; - if (defined($linkitems->{$link})) { - if ($linkitems->{$link}{'text'} ne '') { - $linkitems->{$link}{'cmd'}=~s/"/'/g; - if ($linkitems->{$link}{'cmd'}) { - if ($link eq 'changefolder') { - if ($condition) { - $link_id='LC_content_toolbar_changefolder_toggled'; - } else { - $link_id='LC_content_toolbar_changefolder'; - } - } - $result .= '
  • '. - '
  • '."\n"; - } - } - } + + my $result .=' + + '."\n
      "; + foreach my $link (@linkorder) { + my $link_id = "LC_content_toolbar_".$link; + if (defined($linkitems->{$link})) { + if ($linkitems->{$link}{'text'} ne '') { + $linkitems->{$link}{'cmd'}=~s/"/'/g; + if($linkitems->{$link}{'cmd'}){ + if($link eq 'changefolder'){ + if($condition){$link_id='LC_content_toolbar_changefolder_toggled'} + else{$link_id='LC_content_toolbar_changefolder'} + } + $result .= '
    • '."\n"; + } + + } + } } - $result .= '
    '. - '
    '."\n"; + $result .= '
'; + $result .= '
'."\n"; + return $result; } @@ -2359,7 +2332,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. @@ -3895,12 +3868,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 @@ -3931,12 +3898,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 @@ -4692,10 +4653,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 @@ -4707,7 +4664,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; @@ -4726,13 +4682,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; } @@ -4822,10 +4771,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. @@ -4899,10 +4844,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; @@ -5095,7 +5036,6 @@ my %compositeToSimple = INCORRECT() => INCORRECT, OPEN() => OPEN, ATTEMPTED() => ATTEMPTED, - CREDIT_ATTEMPTED() => CORRECT, ANSWER_SUBMITTED() => ATTEMPTED ); @@ -5169,9 +5109,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; }