--- loncom/interface/statistics/lonstathelpers.pm 2005/02/28 20:16:03 1.40 +++ loncom/interface/statistics/lonstathelpers.pm 2005/03/21 19:47:54 1.45 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: lonstathelpers.pm,v 1.40 2005/02/28 20:16:03 matthew Exp $ +# $Id: lonstathelpers.pm,v 1.45 2005/03/21 19:47:54 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -68,8 +68,7 @@ use Storable qw(freeze thaw); =item &render_resource($resource) -Input: a resource generated from -&Apache::loncoursedata::get_sequence_assessment_data(). +Input: a navmaps resource Retunrs: a scalar containing html for a rendering of the problem within a table. @@ -82,9 +81,8 @@ sub render_resource { my ($resource) = @_; ## ## Render the problem - my $base; - ($base,undef) = ($resource->{'src'} =~ m|(.*/)[^/]*$|); - $base = "http://".$ENV{'SERVER_NAME'}.$base; + my ($base) = ($resource->src =~ m|^(.*/)[^/]*$|); + $base="http://".$ENV{'SERVER_NAME'}.$base; my ($src,$symb)=($resource->src,&Apache::lonnet::escape($resource->symb)); my $rendered_problem = &Apache::lonnet::ssi_body($src.'?symb='.$symb); $rendered_problem =~ s/<\s*form\s*/ 1) { $seq_str .= &mt('response').' '.$respid; } - my $link = $res->{'src'}.'?symb='. + my $link = $res->src.'?symb='. &Apache::lonnet::escape($res->symb); $seq_str .= (' 'x2). qq{view}; @@ -1283,43 +1281,6 @@ sub get_time_limits { return ($starttime,$endtime); } - - -#################################################### -#################################################### - -=pod - -=item sections_description - -Inputs: @Sections, an array of sections - -Returns: A text description of the sections selected. - -=cut - -#################################################### -#################################################### -sub sections_description { - my @Sections = @_; - my $sectionstring = ''; - if (scalar(@Sections) > 1) { - if (scalar(@Sections) > 2) { - my $last = pop(@Sections); - $sectionstring = "Sections ".join(', ',@Sections).', and '.$last; - } else { - $sectionstring = "Sections ".join(' and ',@Sections); - } - } else { - if ($Sections[0] eq 'all') { - $sectionstring = "All sections"; - } else { - $sectionstring = "Section ".$Sections[0]; - } - } - return $sectionstring; -} - #################################################### #################################################### @@ -1342,7 +1303,7 @@ sub manage_caches { join(',', map { &Apache::lonnet::escape($_); - } sort(@Apache::lonstatistics::SelectedSections) + } sort(&Apache::lonstatistics::get_selected_sections()) ); my $statuskey = $Apache::lonstatistics::enrollment_status; if (exists($ENV{'form.ClearCache'}) ||