--- loncom/interface/statistics/lonproblemstatistics.pm 2002/11/01 22:09:39 1.35
+++ loncom/interface/statistics/lonproblemstatistics.pm 2003/02/25 20:47:47 1.40
@@ -1,7 +1,6 @@
# The LearningOnline Network with CAPA
-# (Publication Handler
#
-# $Id: lonproblemstatistics.pm,v 1.35 2002/11/01 22:09:39 minaeibi Exp $
+# $Id: lonproblemstatistics.pm,v 1.40 2003/02/25 20:47:47 matthew Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -35,7 +34,7 @@
#
###
-package Apache::lonproblemstatistics;
+package Apache::lonproblemstatistics;
use strict;
use Apache::lonnet();
@@ -185,9 +184,7 @@ sub BuildProblemStatisticsPage {
$Ptr .= '
'."\n";
my @sections = split(':',$cache{'sectionList'});
my @sectionsSelected = split(':',$cache{'sectionsSelected'});
- $Ptr .= &Apache::lonhtmlcommon::MultipleSectionSelect(\@sections,
- \@sectionsSelected,
- 'Statistics');
+ $Ptr .= &Apache::lonstatistics::SectionSelect('Section','multiple',5);
$Ptr .= ' | '."\n";
$Ptr .= &ProblemStatisticsButtons($cache{'DisplayFormat'},
$cache{'DisplayLegend'},
@@ -221,10 +218,7 @@ sub BuildProblemStatisticsPage {
sub BuildGraphicChart {
my ($graph,$cacheDB,$courseDescription,$students,$courseID,$r,$c)=@_;
my %cache;
- my $max = 0;
- unless(tie(%cache,'GDBM_File',$cacheDB,&GDBM_READER(),0640)) {
- return 'Unable to tie database.7';
- }
+ my $max;
my $title = '';
if($graph eq 'DoDiffGraph') {
@@ -244,6 +238,10 @@ sub BuildGraphicChart {
my @values = ();
+ unless(tie(%cache,'GDBM_File',$cacheDB,&GDBM_READER(),0640)) {
+ return 'Unable to tie database.7';
+ }
+
foreach(@$orderedProblems) {
my ($sequence,$problem,$part)=split(':', $_);
if($cache{'StatisticsMaps'} ne 'All Maps' &&
@@ -258,11 +256,12 @@ sub BuildGraphicChart {
&DrawGraph(\@values,$courseDescription,$title,$max,$r);
}
if($sortProblems eq 'Sort Within Sequence') {
- $r->print(''.$cache{$sequence.':title'}.'');
+ $r->print('
'.$cache{$sequence.':title'}.''."\n");
}
$currentSequence = $sequence;
@values = ();
+ $max=0;
}
my $data = 0;
if($graph eq 'DoDiffGraph') {
@@ -287,21 +286,25 @@ sub DrawGraph {
my ($values,$courseDescription,$title,$Max,$r)=@_;
my $sendValues = join(',', @$values);
my $sendCount = scalar(@$values);
-
+ $r->print("
The Maximum Value is: $Max");
if ( $Max > 1 ) {
if ($Max % 10) {
- $Max++;
+ if ( int($Max) < $Max ) {
+ $Max++;
+ $Max = int($Max);
+ }
}
- #(10 - $Max % 10);
- $Max = int($Max);
+ #(10 - $Max % 10);
} else { $Max = 1; }
- my @GData = ($courseDescription, 'Problem_number',
- $title, $Max, $sendCount, $sendValues);
- $r->print(''."\n");
- $r->print('print('
'."\n");
+ $r->print('');
- $r->print('