--- loncom/interface/Attic/lonchart.pm 2001/11/28 16:36:08 1.16
+++ loncom/interface/Attic/lonchart.pm 2001/11/28 18:18:17 1.20
@@ -106,8 +106,7 @@ sub ExtractStudentData {
if (($Key=~/\.(\w+)\.solved$/) && ($Key!~/^\d+\:/)) {
my $Part = $1;
$Tries = $result{"$Version:$Prob:resource.$Part.tries"};
- if ($Tries) {$TempHash{"$Part.Tries"}=$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 = '+';}
@@ -117,7 +116,7 @@ sub ExtractStudentData {
else {$Code = ' ';}
$TempHash{"$Part.Code"} = $Code;
# if ($test=~/*minaeibi*/) {
-# $r->print($Key." ,,, ".$Val."
$Version:$Prob:resource.$Part.tries".' = '.$result{"$Version:$Prob:resource.$Part.tries"}." $Val "."($Code)".'
');
+ $r->print($Key." PartNo =$PartNo "." Tries=$Tries!
$Version:$Prob:resource.$Part.tries".' = '.$result{"$Version:$Prob:resource.$Part.tries"}." $Val "."($Code)".'
');
# }
}
}
@@ -125,13 +124,15 @@ sub ExtractStudentData {
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.=' ';}}