version 1.11, 2005/04/18 20:35:07
|
version 1.12, 2005/04/29 14:54:18
|
Line 525 sub getitems {
|
Line 525 sub getitems {
|
} |
} |
# Compile maxtries and degree of difficulty for problem parts |
# Compile maxtries and degree of difficulty for problem parts |
my @parts = @{$resource->parts()}; |
my @parts = @{$resource->parts()}; |
my %stats = (); |
my %stats; |
my $warning = 0; |
my $warning = 0; |
my $rowColor; |
my $rowColor; |
foreach (@parts) { |
foreach my $part (@parts) { |
%{$stats{$_}} = (); |
%{$stats{$part}} = (); |
my ($attempts,$users,$corrects,$degdiff,$av_attempts); |
my ($attempts,$users,$corrects,$degdiff,$av_attempts); |
if (exists($resourcetracker{$symb.'_'.$_.'_attempts'})) { |
if (exists($resourcetracker{$symb."\0".$part."\0attempts"})) { |
$attempts = $resourcetracker{$symb.'_'.$_.'_attempts'}; |
$attempts = $resourcetracker{$symb."\0".$part."\0attempts"}; |
} |
} |
if (exists($resourcetracker{$symb.'_'.$_.'_users'})) { |
if (exists($resourcetracker{$symb."\0".$part."\0users"})) { |
$users = $resourcetracker{$symb.'_'.$_.'_users'}; |
$users = $resourcetracker{$symb."\0".$part."\0users"}; |
} |
} |
if (exists($resourcetracker{$symb.'_'.$_.'_correct'})) { |
if (exists($resourcetracker{$symb."\0".$part."\0correct"})) { |
$corrects = $resourcetracker{$symb.'_'.$_.'_correct'}; |
$corrects = $resourcetracker{$symb."\0".$part."\0correct"}; |
} |
} |
if ($attempts > 0) { |
if ($attempts > 0) { |
$degdiff = 1 - ($corrects/$attempts); |
$degdiff = 1 - ($corrects/$attempts); |
Line 548 sub getitems {
|
Line 548 sub getitems {
|
$av_attempts = $attempts/$users; |
$av_attempts = $attempts/$users; |
} |
} |
if (($degdiff ne '' && $degdiff >= $diffcheck) || ($av_attempts ne '' && $av_attempts >= $triescheck)) { |
if (($degdiff ne '' && $degdiff >= $diffcheck) || ($av_attempts ne '' && $av_attempts >= $triescheck)) { |
$stats{$_}{degdiff} = $degdiff; |
$stats{$part}{degdiff} = $degdiff; |
$stats{$_}{attempts} = $av_attempts; |
$stats{$part}{attempts} = $av_attempts; |
$stats{$_}{users} = $users; |
$stats{$part}{users} = $users; |
$warning = 1; |
$warning = 1; |
} |
} |
} |
} |
Line 561 sub getitems {
|
Line 561 sub getitems {
|
$rowColor = $rowColor2; |
$rowColor = $rowColor2; |
} |
} |
$$triggered{$symb}{title} = $resource->title; |
$$triggered{$symb}{title} = $resource->title; |
foreach (@parts) { |
foreach my $part (@parts) { |
if (exists($stats{$_}{users})) { |
if (exists($stats{$part}{users})) { |
if ($$triggered{$symb}{numparts}) { |
if ($$triggered{$symb}{numparts}) { |
$$triggered{$symb}{text} .= '<tr bgcolor="'.$rowColor.'">'."\n"; |
$$triggered{$symb}{text} .= '<tr bgcolor="'.$rowColor.'">'."\n"; |
} |
} |
if (@parts > 1) { |
if (@parts > 1) { |
$$triggered{$symb}{text} .= ' |
$$triggered{$symb}{text} .= ' |
<td align="right"><small>part - '.$_.'<small></td>'; |
<td align="right"><small>part - '.$part.'<small></td>'; |
} else { |
} else { |
$$triggered{$symb}{text} .= ' |
$$triggered{$symb}{text} .= ' |
<td align="right"><small>single part</small></td>'; |
<td align="right"><small>single part</small></td>'; |
} |
} |
$$triggered{$symb}{text} .= ' |
$$triggered{$symb}{text} .= ' |
<td align="right"><small>'.$stats{$_}{users}.'</small></td> |
<td align="right"><small>'.$stats{$part}{users}.'</small></td> |
<td align="right"><small>'.$stats{$_}{attempts}.'</small></td> |
<td align="right"><small>'.$stats{$part}{attempts}.'</small></td> |
<td align="right"><small>'.$stats{$_}{degdiff}.'</small></td> |
<td align="right"><small>'.$stats{$part}{degdiff}.'</small></td> |
</tr>'; |
</tr>'; |
$$triggered{$symb}{numparts} ++; |
$$triggered{$symb}{numparts} ++; |
} |
} |