version 1.53, 2003/06/13 20:27:17
|
version 1.56, 2003/08/27 21:33:33
|
Line 75 my @Fields = (
|
Line 75 my @Fields = (
|
{ name => 'part', |
{ name => 'part', |
title => 'Part', |
title => 'Part', |
align => 'left', |
align => 'left', |
color => '#FFFFE6' }, |
color => '#FFFFE6', |
|
}, |
{ name => 'num_students', |
{ name => 'num_students', |
title => '#Stdnts', |
title => '#Stdnts', |
align => 'right', |
align => 'right', |
Line 131 my @Fields = (
|
Line 132 my @Fields = (
|
format => '%5.2f', |
format => '%5.2f', |
sortable => 'yes', |
sortable => 'yes', |
graphable => 'yes', |
graphable => 'yes', |
long_title => 'Degree of Difficulty' }, |
long_title => 'Degree of Difficulty'. |
|
'[ 1 - ((#YES+#yes) / Tries) ]'}, |
{ name => 'num_solved', |
{ name => 'num_solved', |
title => '#YES', |
title => '#YES', |
align => 'right', |
align => 'right', |
Line 155 my @Fields = (
|
Line 157 my @Fields = (
|
format => '%4.1f', |
format => '%4.1f', |
sortable => 'yes', |
sortable => 'yes', |
graphable => 'yes', |
graphable => 'yes', |
long_title => 'Percent Wrong' }, |
long_title => 'Percent of students whose final answer is wrong' }, |
); |
); |
|
|
############################################### |
############################################### |
Line 203 sub CreateInterface {
|
Line 205 sub CreateInterface {
|
$Str .= '</td></tr>'."\n"; |
$Str .= '</td></tr>'."\n"; |
$Str .= '</table>'."\n"; |
$Str .= '</table>'."\n"; |
$Str .= '<input type="submit" value="Generate Statistics" />'; |
$Str .= '<input type="submit" value="Generate Statistics" />'; |
|
$Str .= ' 'x5; |
|
$Str .= '<input type="submit" name="ClearCache" value="Clear Caches" />'; |
|
$Str .= ' 'x5; |
return $Str; |
return $Str; |
} |
} |
|
|
Line 305 sub CreateAndParseOutputSelector {
|
Line 310 sub CreateAndParseOutputSelector {
|
|
|
=pod |
=pod |
|
|
=item &Gather_Student_Data() |
|
|
|
Ensures all student data is up to date. |
|
|
|
=cut |
|
|
|
############################################### |
|
############################################### |
|
sub Gather_Student_Data { |
|
my ($r) = @_; |
|
my $c = $r->connection(); |
|
# |
|
my @Sequences = &Apache::lonstatistics::Sequences_with_Assess(); |
|
# |
|
my @Students = @Apache::lonstatistics::Students; |
|
# |
|
# Open the progress window |
|
my %prog_state=&Apache::lonhtmlcommon::Create_PrgWin |
|
($r,'Statistics Compilation Status', |
|
'Statistics Compilation Progress', scalar(@Students)); |
|
# |
|
while (my $student = shift @Students) { |
|
return if ($c->aborted()); |
|
my ($status,undef) = &Apache::loncoursedata::ensure_current_data |
|
($student->{'username'},$student->{'domain'}, |
|
$ENV{'request.course.id'}); |
|
&Apache::lonhtmlcommon::Increment_PrgWin($r,\%prog_state, |
|
'last student'); |
|
} |
|
&Apache::lonhtmlcommon::Close_PrgWin($r,\%prog_state); |
|
$r->rflush(); |
|
} |
|
|
|
############################################### |
|
############################################### |
|
|
|
=pod |
|
|
|
=item &BuildProblemStatisticsPage() |
=item &BuildProblemStatisticsPage() |
|
|
Main interface to problem statistics. |
Main interface to problem statistics. |
Line 366 sub BuildProblemStatisticsPage {
|
Line 333 sub BuildProblemStatisticsPage {
|
return; |
return; |
} |
} |
# |
# |
&Gather_Student_Data($r); |
&Apache::lonstatistics::Gather_Student_Data($r); |
# |
# |
# |
# |
if ($output_mode eq 'html') { |
if ($output_mode eq 'html') { |
Line 642 sub output_excel {
|
Line 609 sub output_excel {
|
$rows_output++; |
$rows_output++; |
$cols_output=0; |
$cols_output=0; |
# |
# |
# Add the headers |
# Long Headersheaders |
|
foreach my $field (@Fields) { |
|
next if ($field->{'name'} eq 'problem_num'); |
|
if (exists($field->{'long_title'})) { |
|
$excel_sheet->write($rows_output,$cols_output++, |
|
$field->{'long_title'}); |
|
} else { |
|
$excel_sheet->write($rows_output,$cols_output++,''); |
|
} |
|
} |
|
$rows_output++; |
|
$cols_output=0; |
|
# Brief headers |
foreach my $field (@Fields) { |
foreach my $field (@Fields) { |
next if ($field->{'name'} eq 'problem_num'); |
next if ($field->{'name'} eq 'problem_num'); |
$excel_sheet->write($rows_output,$cols_output++,$field->{'title'}); |
$excel_sheet->write($rows_output,$cols_output++,$field->{'title'}); |