--- loncom/interface/Attic/lonchart.pm 2001/11/27 21:16:11 1.14
+++ loncom/interface/Attic/lonchart.pm 2001/12/06 21:57:23 1.23
@@ -15,7 +15,7 @@
# 7/10/01 Behrouz Minaei
# 9/8 Gerd Kortemeyer
# 10/18/01, 10/19/01 Behrouz Minaei
-# 11/17/01, 11/22/01, 11/24/01 Behrouz Minaei
+# 11/17/01, 11/22/01, 11/24/01, 11/28/01 Behrouz Minaei
package Apache::lonchart;
@@ -30,7 +30,6 @@ my %hash;
my @cols;
my @rowlabels;
my @students;
-my $r;
# ------------------------------------------------------------- Find out status
@@ -48,11 +47,7 @@ sub ExtractStudentData {
my $Version;
my $ProbNo;
my $PrTotal;
- my $LatestVersion;
-
- my $test = $ENV{'request.course.fn'};
- my $comp = '/home/httpd/perl/tmp/minaeibi_msu_12679c3ed543a25msul1';
-
+ my $LatestVersion;
my $Str=substr($students[$index].
' ',0,14).' ! '.
substr($rowlabels[$index].
@@ -105,32 +100,30 @@ sub ExtractStudentData {
foreach my $Key (@keys) {
if (($Key=~/\.(\w+)\.solved$/) && ($Key!~/^\d+\:/)) {
my $Part = $1;
- $TempHash{"$Part.Tries"} = $result{"$Version:$Prob:resource.$Part.tries"};
$Tries = $result{"$Version:$Prob:resource.$Part.tries"};
- my $Val = $result{"$Version:$Prob:$Key"};
+ $TempHash{"$Part.Tries"}=($Tries) ? $Tries : 0;
+ my $Val = $result{"$Version:$Prob:resource.$Part.solved"};
if ($Val eq 'correct_by_student'){$Code='*';}
elsif ($Val eq 'correct_by_override'){$Code = '+';}
elsif ($Val eq 'incorrect_attempted'){$Code = '.';}
elsif ($Val eq 'incorrect_by_override'){$Code = '-';}
elsif ($Val eq 'excused'){$Code = 'x';}
+ elsif ($Val eq 'ungraded_attempted'){$Code = '#';}
else {$Code = ' ';}
$TempHash{"$Part.Code"} = $Code;
- if ($test eq $comp) {
- $r->print("$Version:$Prob:resource.$Part.tries".' = '.$result{"$Version:$Prob:resource.$Part.tries"}." $Val "."($Code)".'
');
- }
}
}
}
-
for ( my $n = 0; $n < $PartNo; $n++ ) {
my $part = $TempHash{$n};
- if ($TempHash{$part.'.Code'} eq '*') {
+ if ($TempHash{"$part.Code"} eq '*') {
$ProbNo++;
- if ($TempHash{$part.'.Tries'}<10) {
- $TempHash{$part.'.Code'}=$Tries;
+ if (($TempHash{"$part.Tries"}<10) ||
+ ($TempHash{"$part.Tries"} eq '')) {
+ $TempHash{"$part.Code"}=$TempHash{"$part.Tries"};
}
}
- $Str .= $TempHash{$part.'.Code'};
+ $Str .= $TempHash{"$part.Code"};
}
}
else {for(my $n=0; $n<$PartNo; $n++) {$Str.=' ';}}
@@ -189,7 +182,7 @@ sub tracetable {
# ================================================================ Main Handler
sub handler {
- $r=shift;
+ my $r=shift;
if (&Apache::lonnet::allowed('vgr',$ENV{'request.course.id'})) {
# ------------------------------------------- Set document type for header only
@@ -236,6 +229,7 @@ sub handler {
" +: correct by override\n".
" -: incorrect by override\n".
" .: incorrect attempted\n".
+ " #: ungraded attempted\n".
" : not attempted\n".
" x: excused
");