--- loncom/interface/Attic/lonchart.pm 2001/11/24 17:31:42 1.13
+++ loncom/interface/Attic/lonchart.pm 2001/11/28 18:18:17 1.20
@@ -11,10 +11,7 @@
# 08/30,08/31,09/06,09/14,09/15,09/16,09/19,09/20,09/21,09/23,
# 10/02,10/10,10/14,10/16,10/18,10/19,10/31,11/6,11/14,11/16 Gerd Kortemeyer)
#
-# 3/1/1,6/1,17/1,29/1,30/1 Gerd Kortemeyer)
-#
-# 1/31 Gerd Kortemeyer
-#
+# 3/1/1,6/1,17/1,29/1,30/1,31/1 Gerd Kortemeyer)
# 7/10/01 Behrouz Minaei
# 9/8 Gerd Kortemeyer
# 10/18/01, 10/19/01 Behrouz Minaei
@@ -52,7 +49,10 @@ sub ExtractStudentData {
my $ProbNo;
my $PrTotal;
my $LatestVersion;
-
+
+ my $test = $ENV{'request.course.fn'};
+ my $comp = '/home/httpd/perl/tmp/minaeibi_msu_12679c3ed543a25msul1';
+
my $Str=substr($students[$index].
' ',0,14).' ! '.
substr($rowlabels[$index].
@@ -96,17 +96,18 @@ sub ExtractStudentData {
$Code=' ';
$Tries = 0;
$LatestVersion = $result{"version:$Prob"};
-
+
if ( $LatestVersion ) {
for ( my $Version=1; $Version<=$LatestVersion; $Version++ ) {
my $vkeys = $result{"$Version:keys:$Prob"};
my @keys = split(/\:/,$vkeys);
+
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 = '.';}
@@ -114,19 +115,24 @@ sub ExtractStudentData {
elsif ($Val eq 'excused'){$Code = 'x';}
else {$Code = ' ';}
$TempHash{"$Part.Code"} = $Code;
+# if ($test=~/*minaeibi*/) {
+ $r->print($Key." PartNo =$PartNo "." Tries=$Tries!
$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"};
+ $r->print($n.") Part=".$part." code=$TempHash{$part.'.Code'}
");
}
}
else {for(my $n=0; $n<$PartNo; $n++) {$Str.=' ';}}