From:['.localtime($ConceptData{'Int.$k'}).
-# '] To: ['.localtime($ConceptData{'Int.'.($k+1)}).
-# "]
$Correct
$Wrong
";#
- $Str .= "\n".'';
+sub DrawGraph {
+ my ($k,$Src)=@_;
+ my $Max=0;
+ my @data1;
+ my @data2;
-# $r->print($Str);
+ # Adjust Data and find the Max
+ for (my $n=0; $n<=$#Concepts; $n++ ) {
+ my $tmp=$Concepts[$n];
+ $data1[$n]=$ConceptData{"$tmp.$k.true"};
+ $data2[$n]=$ConceptData{"$tmp.$k.false"};
+ my $Sum=$data1[$n]+$data2[$n];
+ if ( $Max<$Sum ) {$Max=$Sum;}
+ }
+ for (my $n=0; $n<=$#Concepts; $n++ ) {
+ if ($data1[$n]+$data2[$n]<$Max) {
+ $data2[$n]+=$Max-($data1[$n]+$data2[$n]);
+ }
+ }
+ my $P_No = $#data1+1;
if ( $Max > 1 ) {
$Max += (10 - $Max % 10);
@@ -547,7 +571,7 @@ sub StudentReport {
sub CreateTable {
my ($Hd, $Hid)=@_;
- if ($ENV{'form.showcsv'}) {
+ if ($ENV{'form.showcsv'}) {
if ( $Hd == 1 ) {
$r->print(' "'.$hash{'title_'.$Hid}.'","'.$hash{'src_'.$Hid}.'"');
}
@@ -1144,9 +1168,8 @@ sub Cache_Statistics {
my @list = ();
my $Useful;
my $UnUseful;
+# $r->print(''."\n");
my %myHeader = reverse( %Header );
- #&Apache::lonnet::delenv('form_');
- #&Apache::lonnet::delenv('test');
$Pos = $myHeader{$ENV{'form.sort'}};
if ($Pos > 0) {$Pos++;}
$p_count = 0;
@@ -1347,7 +1370,10 @@ sub ClassList {
# my ($temp)=keys(%students);
# unless ($temp=~/^error\:/) {
# foreach my $KeyPoint(sort keys(%students)) {
+
+
my $classlst=&Apache::lonnet::reply('dump:'.$cdom.':'.$cnum.':classlist',$chome);
+
my $StudNo = 0;
my $now=time;
unless ($classlst=~/^error\:/) {
@@ -1408,74 +1434,6 @@ sub ClassList {
}
-sub ClassListnew {
-
- &GetStatus();
-
- $cid=$ENV{'request.course.id'};
- my $chome=$ENV{'course.'.$cid.'.home'};
- my ($cdom,$cnum)=split(/\_/,$cid);
-# ----------------------- Get first and last resource, see if there is anything
- $firstres=$hash{'map_start_/res/'.$ENV{'request.course.uri'}};
- $lastres=$hash{'map_finish_/res/'.$ENV{'request.course.uri'}};
- if (($firstres) && ($lastres)) {
-
- my %students = &Apache::lonnet::dump('classlist',$cdom,$cnum);
- my $StudNo = 0;
- my $now=time;
- my ($temp)=keys(%students);
- unless ($temp=~/^error\:/) {
- foreach (sort keys(%students)) {
- my ($name,$value)=split(/\=/,$_);
- my ($end,$start)=split(/\:/,&Apache::lonnet::unescape($value));
- $name=&Apache::lonnet::unescape($name);
- my ($sname,$sdom)=split(/\:/,$name);
- my $active=1;
- my $Status=$ENV{'form.status'};
- $Status = ($Status) ? $Status : 'Active';
- if ( ( ($end) && $now > $end ) &&
- ( ($Status eq 'Active') ) ) { $active=0; }
- if ( ($Status eq 'Expired') &&
- ($end == 0 || $now < $end) ) { $active=0; }
- if ($active) {
- my $thisindex=$#students+1;
- $name=&Apache::lonnet::unescape($name);
- $students[$thisindex]=$name;
- my ($sname,$sdom)=split(/\:/,$name);
- #my %reply=&Apache::lonnet::idrget($sdom,$sname);
- #my $reply=&Apache::lonnet::reply('get:'.$sdom.':'.$sname.
- # ':environment:lastname&generation&firstname&middlename',
- # &Apache::lonnet::homeserver($sname,$sdom));
- my $ssec=&usection($sdom,$sname,$cid,$Status);
-# if ($ssec==-1 ) {next;}
- if ($ssec==-1 || $ssec eq 'adm' ) {next;}
- $ssec=($ssec) ? $ssec : '(none)';
- #$ssec=(int($ssec)) ? int($ssec) : $ssec;
- $section{$ssec}=$ssec;
- if ($CurSec eq 'All Sections' || $ssec eq $CurSec) {
- $students[$StudNo]=$name;
- $StuBox{$sname}=$sdom;
- }
- $StudNo++;
- }
- }
- }
- else {
- $r->print('
Could not access course data
');
- }
- $r->print("Total number of students : ".($#students+1));
- $r->rflush();
-# --------------- Find all assessments and put them into some linear-like order
- &tracetable($firstres,'&'.$lastres.'&');
- }
-
-# ------------------------------------------------------------- End render page
- else {
- $r->print('
Undefined course sequence
');
- }
-}
-
-
sub Title {
$r->print('LON-CAPA Statistics');
$r->print(''.
@@ -1493,8 +1451,8 @@ sub Title {
sub CreateForm {
$r->print("\n".'