--- loncom/interface/Attic/lonchart.pm 2001/11/27 21:16:11 1.14 +++ loncom/interface/Attic/lonchart.pm 2001/11/28 18:15:14 1.19 @@ -105,9 +105,9 @@ 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 = '.';} @@ -115,22 +115,24 @@ sub ExtractStudentData { elsif ($Val eq 'excused'){$Code = 'x';} 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)".'
'); - } +# 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.=' ';}}