version 1.10, 2001/11/17 20:30:47
|
version 1.11, 2001/11/22 17:05:07
|
Line 18
|
Line 18
|
# 7/10/01 Behrouz Minaei |
# 7/10/01 Behrouz Minaei |
# 9/8 Gerd Kortemeyer |
# 9/8 Gerd Kortemeyer |
# 10/18/01, 10/19/01 Behrouz Minaei |
# 10/18/01, 10/19/01 Behrouz Minaei |
# 11/17/01 Behrouz Minaei |
# 11/17/01, 11/22/01 Behrouz Minaei |
|
|
package Apache::lonchart; |
package Apache::lonchart; |
|
|
Line 33 my %hash;
|
Line 33 my %hash;
|
my @cols; |
my @cols; |
my @rowlabels; |
my @rowlabels; |
my @students; |
my @students; |
|
my $r; |
|
|
# ------------------------------------------------------------- Find out status |
# ------------------------------------------------------------- Find out status |
|
|
Line 74 sub ExtractStudentData {
|
Line 75 sub ExtractStudentData {
|
next; |
next; |
} |
} |
$ResId=~/(\d+)\.(\d+)/; |
$ResId=~/(\d+)\.(\d+)/; |
|
my $meta=$hash{'src_'.$ResId}; |
|
# $r->print($m.'<br>'); |
|
# $r->rflush(); |
|
my $PartNo = 0; |
|
undef %TempHash; |
|
map { |
|
if ($_=~/^stores\_(\d+)\_tries$/) { |
|
my $Part=&Apache::lonnet::metadata($meta,$_.'.part'); |
|
if ( $TempHash{"$Part"} eq '' ) { |
|
$TempHash{"$Part"} = $Part; |
|
$TempHash{$PartNo}=$Part; |
|
$TempHash{"$Part.Code"} = ' '; |
|
$PartNo++; |
|
} |
|
} |
|
} split(/\,/,&Apache::lonnet::metadata($meta,'keys')); |
|
|
|
# foreach my $Key (%TempHash) { |
|
# $r->print($Key.' = '.$TempHash{$Key}.'<br>'); |
|
# $r->rflush(); |
|
# } |
|
|
|
$r->print($PartNo.'<br>');$r->rflush(); |
|
|
my $Prob = &Apache::lonnet::declutter( $hash{'map_id_'.$1} ). |
my $Prob = &Apache::lonnet::declutter( $hash{'map_id_'.$1} ). |
'___'.$2.'___'. |
'___'.$2.'___'. |
&Apache::lonnet::declutter( $hash{'src_'.$ResId} ); |
&Apache::lonnet::declutter( $hash{'src_'.$ResId} ); |
Line 81 sub ExtractStudentData {
|
Line 106 sub ExtractStudentData {
|
$Tries = 0; |
$Tries = 0; |
$LatestVersion = $result{"version:$Prob"}; |
$LatestVersion = $result{"version:$Prob"}; |
|
|
undef %TempHash; |
#undef %TempHash; |
my $PartNo = 0; |
#my $PartNo = 0; |
|
|
if ( $LatestVersion ) { |
if ( $LatestVersion ) { |
for ( my $Version=1; $Version<=$LatestVersion; $Version++ ) { |
for ( my $Version=1; $Version<=$LatestVersion; $Version++ ) { |
Line 91 sub ExtractStudentData {
|
Line 116 sub ExtractStudentData {
|
foreach my $Key (@keys) { |
foreach my $Key (@keys) { |
if (($Key=~/\.(\w+)\.solved$/) && ($Key!~/^\d+\:/)) { |
if (($Key=~/\.(\w+)\.solved$/) && ($Key!~/^\d+\:/)) { |
my $Part = $1; |
my $Part = $1; |
if ( $TempHash{"$Part"} eq '' ) { |
#if ( $TempHash{"$Part"} eq '' ) { |
$TempHash{"$Part"} = $Part; |
# $TempHash{"$Part"} = $Part; |
$TempHash{$PartNo}=$Part; |
#$TempHash{$PartNo}=$Part; |
$TempHash{"$Part.Code"} = ' '; |
#$TempHash{"$Part.Code"} = ' '; |
$PartNo++; |
#$PartNo++; |
} |
#} |
$TempHash{"$Part.Tries"} = $result{"$Version:$Prob:resource.$Part.tries"}; |
$TempHash{"$Part.Tries"} = $result{"$Version:$Prob:resource.$Part.tries"}; |
$Tries = $result{"$Version:$Prob:resource.$Part.tries"}; |
$Tries = $result{"$Version:$Prob:resource.$Part.tries"}; |
my $Val = $result{"$Version:$Prob:$Key"}; |
my $Val = $result{"$Version:$Prob:$Key"}; |
Line 121 sub ExtractStudentData {
|
Line 146 sub ExtractStudentData {
|
$Str .= $TempHash{$part.'.Code'}; |
$Str .= $TempHash{$part.'.Code'}; |
} |
} |
} |
} |
else { $Str .= ' '; } |
else {for(my $n=0; $n<$PartNo; $n++) {$Str.=' ';}} |
} |
} |
} |
} |
my $PrTot = sprintf( "%5d", $PrTotal ); |
my $PrTot = sprintf( "%5d", $PrTotal ); |
$Str .= ' '.'<font color="#000077">'.$PrTot.'</font> '; |
$Str .= ' '.'<font color="#000088">'.$PrTot.'</font> '; |
|
|
return $Str ; |
return $Str ; |
} |
} |
|
|
Line 176 sub tracetable {
|
Line 202 sub tracetable {
|
# ================================================================ Main Handler |
# ================================================================ Main Handler |
|
|
sub handler { |
sub handler { |
my $r=shift; |
$r=shift; |
|
|
if (&Apache::lonnet::allowed('vgr',$ENV{'request.course.id'})) { |
if (&Apache::lonnet::allowed('vgr',$ENV{'request.course.id'})) { |
# ------------------------------------------- Set document type for header only |
# ------------------------------------------- Set document type for header only |