--- loncom/interface/statistics/lonstathelpers.pm 2020/09/01 15:11:02 1.76.2.2 +++ loncom/interface/statistics/lonstathelpers.pm 2020/09/12 20:21:30 1.79 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: lonstathelpers.pm,v 1.76.2.2 2020/09/01 15:11:02 raeburn Exp $ +# $Id: lonstathelpers.pm,v 1.79 2020/09/12 20:21:30 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -108,10 +108,17 @@ sub render_resource { #################################################### #################################################### sub get_resources { - my ($navmap,$sequence) = @_; - my @resources = $navmap->retrieveResources($sequence, - sub { shift->is_problem(); }, - 0,0,0); + my ($navmap,$sequence,$include_tools) = @_; + my @resources; + if ($include_tools) { + @resources = $navmap->retrieveResources($sequence, + sub { shift->is_gradable(); }, + 0,0,0); + } else { + @resources = $navmap->retrieveResources($sequence, + sub { shift->is_problem(); }, + 0,0,0); + } return @resources; } @@ -158,7 +165,7 @@ sub problem_selector { return $navmap if (! ref($navmap)); # error foreach my $seq (@sequences) { my $seq_str = ''; - foreach my $res (&get_resources($navmap,$seq)) { + foreach my $res (&get_resources($navmap,$seq,$include_tools)) { if ($res->src() eq '/res/lib/templates/simpleproblem.problem') { next if (grep(/^placeholder$/,@{$res->parts})); } @@ -181,7 +188,7 @@ sub problem_selector { $rowspan = ' rowspan="'.$totalresps.'"'; } $seq_str .= &Apache::loncommon::start_data_table_row(). - '
'.&mt('No gradable problems found').'
'; + } elsif ($AcceptedResponseTypes eq '.') { + $Str = ''.&mt('No problems found').'
'; + } else { + $Str = ''.&mt('No analyzable problems found').'
'; + } + } return $Str; }