--- loncom/interface/statistics/lonproblemstatistics.pm 2002/07/26 21:50:12 1.3 +++ loncom/interface/statistics/lonproblemstatistics.pm 2003/03/25 23:00:40 1.41 @@ -1,7 +1,6 @@ # The LearningOnline Network with CAPA -# (Publication Handler # -# $Id: lonproblemstatistics.pm,v 1.3 2002/07/26 21:50:12 minaeibi Exp $ +# $Id: lonproblemstatistics.pm,v 1.41 2003/03/25 23:00:40 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -26,945 +25,630 @@ # http://www.lon-capa.org/ # # (Navigate problems for statistical reports -# YEAR=2001 -# 5/5,7/9,7/25/1,8/11,9/13,9/26,10/5,10/9,10/22,10/26 Behrouz Minaei -# 11/1,11/4,11/16,12/14,12/16,12/18,12/20,12/31 Behrouz Minaei -# YEAR=2002 -# 1/22,2/1,2/6,2/25,3/2,3/6,3/17,3/21,3/22,3/26,4/7,5/6 Behrouz Minaei -# 5/12,5/14,5/15,5/19,5/26,7/16,7/25 Behrouz Minaei # ### -package Apache::lonproblemstatistics; +package Apache::lonproblemstatistics; use strict; use Apache::lonnet(); use Apache::lonhtmlcommon; use Apache::loncoursedata; -use GDBM_File; +use Apache::lonstatistics; -#my %mapsort; +####################################################### +####################################################### -sub BuildProblemStatisticsPage { - my ($cacheDB, $students, $courseID, $c, $r,%color)=@_; - my %cache; - #my %DoDiff; - unless(tie(%cache,'GDBM_File',$cacheDB,&GDBM_READER,0640)) { - return '
Unable to tie database.'; - } - - my $Ptr = ''; - $Ptr .= 'Select Map | '."\n"; - $Ptr .= ''; - $Ptr .= &Apache::lonhtmlcommon::MapOptions(\%cache, 'ProblemStatistics'); - $Ptr .= ' |
Sections | '; + $Str .= 'Sequences and Folders | '; + $Str .= 'Output | '; + $Str .= '
'."\n"; + $Str .= &Apache::lonstatistics::SectionSelect('Section','multiple',5); + $Str .= ' | ';
+ #
+ my $only_seq_with_assessments = sub {
+ my $s=shift;
+ if ($s->{'num_assess'} < 1) {
+ return 0;
+ } else {
+ return 1;
}
- }
- if($c->aborted()) { return $Ptr; }
-
- unless(tie(%cache,'GDBM_File',$cacheDB,&GDBM_READER,0640)) {
- return 'Unable to tie database.';
- }
- my $discriminantFactor;
- my @list=();
- my %Discuss=&Apache::loncoursedata::LoadDiscussion($courseID);
- my $index=0;
- foreach (@$students) {
- $index++;
- #&Apache::lonstatistics::Update_PrgWin(++$index,$r);
- $discriminantFactor = &ExtractStudentData(\%cache, $_, \@list,
- \%Discuss, $r);
- }
- #&Apache::lonstatistics::Close_PrgWin($r);
-
- my ($upper, $lower) = &Discriminant($discriminantFactor);
- my %Header = (0,"Homework Sets Order",1,"#Stdnts",2,"Tries",3,"Mod",
- 4,"Mean",5,"#YES",6,"#yes",7,"%Wrng",8,"DoDiff",
- 9,"S.D.",10,"Skew.",11,"D.F.1st",12,"D.F.2nd", 13, "Disc.");
-
- my %GraphDat= &BuildStatisticsTable(\%cache, $discriminantFactor, \@list,
- \%Header, $students, $r, \%color);
-
- untie(%cache);
-
- return $Ptr;
-}
-
-sub BuildDiffGraph {
- my ($r)=@_;
-
- my $graphData = &GetGraphData('DiffGraph', $r);
- return '![]() | '."\n"; + $Str .= &CreateAndParseOutputSelector(); + $Str .= ' |
'."\n");
+ $r->print('
|
P# | '."\n"; - for(my $nIndex=0; $nIndex < (scalar (keys %$headings)); $nIndex++) { - $Result .= ''.''.' | '."\n"; +############################################### +############################################### + +############################################### +############################################### +sub output_html_ungrouped { + my ($r) = @_; + # + my $sortby = $ENV{'form.sortby'}; + if (! defined($sortby) || $sortby eq '') { + $sortby = 'sequence'; + } + # + my $show_container = 0; + #$r->print(&ProblemStatisticsLegend()); + my @Header = ("Title","Part","#Stdnts","Tries","Mod", + "Mean","#YES","#yes","%Wrng","DoDiff", + "S.D.","Skew.");#,"D.F.1st","D.F.2nd"); + # #FFFFE6 #EEFFCC #DDFFFF FFDDDD #DDFFDD #FFDDFF + my @Sequences = &Apache::lonstatistics::Sequences_with_Assess(); + if (@Sequences > 1) { + unshift(@Header,"Container"); + $show_container = 1; + } + # + $r->print('
---|
'."\n");
+ $r->print('
| |
'.$sequence->{'title'}. + ' | '. + &statistics_html_table_data + ($resource,$part,$num,$tries,$mod,$mean,$Solved, + $solved,$wrongpercent,$DegOfDiff,$STD,$SKEW). + "|