--- loncom/interface/statistics/lonproblemstatistics.pm 2003/03/26 17:03:41 1.44 +++ loncom/interface/statistics/lonproblemstatistics.pm 2003/03/26 21:47:47 1.45 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: lonproblemstatistics.pm,v 1.44 2003/03/26 17:03:41 matthew Exp $ +# $Id: lonproblemstatistics.pm,v 1.45 2003/03/26 21:47:47 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -233,6 +233,12 @@ sub BuildProblemStatisticsPage { } elsif ($output_mode eq 'excel') { $r->print("
'."\n"); $r->rflush(); @@ -330,6 +347,7 @@ sub output_html_ungrouped { foreach my $resource (@{$sequence->{'contents'}}) { next if ($resource->{'type'} ne 'assessment'); foreach my $part (@{$resource->{'parts'}}) { + $problem_num++; my ($num,$tries,$mod,$mean,$Solved,$solved,$DegOfDiff,$STD, $SKEW) = &Apache::loncoursedata::get_problem_statistics (undef,$resource->{'symb'},$part, @@ -357,6 +375,7 @@ sub output_html_ungrouped { 'DoDiff' => $DegOfDiff, 'S.D.' => $STD, 'Skew' => $SKEW, + 'problem_num' => $problem_num, }); } } @@ -368,7 +387,7 @@ sub output_html_ungrouped { foreach (@Header) { next if ($_ eq 'Part' && !$show_part); # Do not allow sorting on some fields - if ($_ eq $sortby || /^(Part)$/) { + if ($_ eq $sortby || /^(Part|P\#)$/) { $Str .= ' | '.$_.' | '; } else { $Str .= ''. @@ -417,13 +436,23 @@ sub output_html_ungrouped { } @Statsarray; } } + $option .= ',no part' if (! $show_part); foreach my $row (@OutputOrder) { $r->print(' |
---|---|---|
'.$row->{'problem_num'}.' | '); + } if ($show_container) { $r->print('' .$row->{'sequence'}->{'title'}.' | '); } - $r->print(&stats_row_from_hash($row,$show_part)); + $r->print(&statistics_html_table_data + ($row->{'resource'},$row->{'Part'},$row->{'#Stdnts'}, + $row->{'Tries'},$row->{'Mod'},$row->{'Mean'}, + $row->{'#YES'},$row->{'#yes'},$row->{"\%Wrng"}, + $row->{'DoDiff'},$row->{'S.D.'},$row->{'Skew'}, + $option)); + $r->print("
".&DrawGraph(\@Data,$title,'Problem Number',$yaxis, + $Max)."
\n"); + # + # Print out the data + $ENV{'form.sortby'} = 'Contents'; + &output_html_ungrouped($r,'show probnum'); return; } +############################################### +############################################### + +############################################### +############################################### sub DrawGraph { - my ($values,$courseDescription,$title,$Max,$r)=@_; + my ($values,$title,$xaxis,$yaxis,$Max)=@_; + $title = '' if (! defined($title)); + $xaxis = '' if (! defined($xaxis)); + $yaxis = '' if (! defined($yaxis)); + # my $sendValues = join(',', @$values); my $sendCount = scalar(@$values); - $r->print("