--- loncom/interface/statistics/lonstathelpers.pm 2020/08/26 18:13:39 1.76 +++ loncom/interface/statistics/lonstathelpers.pm 2020/09/07 02:58:25 1.76.2.3 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: lonstathelpers.pm,v 1.76 2020/08/26 18:13:39 raeburn Exp $ +# $Id: lonstathelpers.pm,v 1.76.2.3 2020/09/07 02:58:25 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -108,17 +108,10 @@ sub render_resource { #################################################### #################################################### sub get_resources { - 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); - } + my ($navmap,$sequence) = @_; + my @resources = $navmap->retrieveResources($sequence, + sub { shift->is_problem(); }, + 0,0,0); return @resources; } @@ -165,7 +158,10 @@ sub problem_selector { return $navmap if (! ref($navmap)); # error foreach my $seq (@sequences) { my $seq_str = ''; - foreach my $res (&get_resources($navmap,$seq,$include_tools)) { + foreach my $res (&get_resources($navmap,$seq)) { + if ($res->src() eq '/res/lib/templates/simpleproblem.problem') { + next if (grep(/^placeholder$/,@{$res->parts})); + } my $title = $res->compTitle; if (! defined($title) || $title eq '') { ($title) = ($res->src =~ m:/([^/]*)$:); @@ -180,8 +176,12 @@ sub problem_selector { if ($env{'form.problemchoice'} eq $res->symb()) { $checked = ' checked="checked"'; } + my $rowspan; + if ($totalresps > 1) { + $rowspan = ' rowspan="'.$totalresps.'"'; + } $seq_str .= &Apache::loncommon::start_data_table_row(). - ''. + ''. ''; my $link = $res->link.'?symb='.&escape($res->shown_symb); @@ -190,20 +190,16 @@ sub problem_selector { } my %partsseen; foreach my $part (@{$res->parts}) { - my (@response_ids,@response_types); - if ($res->is_tool) { - @response_ids = (); - @response_types = ('tool'); - } else { - @response_ids = $res->responseIds($part); - @response_types = $res->responseType($part); - } + my @response_ids = $res->responseIds($part); + my @response_types = $res->responseType($part); for (my $i=0;$i'. + my $resprowspan; + if (scalar(@response_ids) > 1) { + $resprowspan = ' rowspan="'.scalar(@response_ids).'"'; + } + $seq_str .= ''. $parttitle.''; $partsseen{$part} = scalar(@response_ids); }