--- loncom/interface/lonstatistics.pm 2004/06/24 19:36:16 1.107 +++ loncom/interface/lonstatistics.pm 2005/02/17 08:29:43 1.114 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: lonstatistics.pm,v 1.107 2004/06/24 19:36:16 matthew Exp $ +# $Id: lonstatistics.pm,v 1.114 2005/02/17 08:29:43 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -229,10 +229,10 @@ sub PrepareClasslist { } # # Set up %StudentData - @StudentDataOrder = qw/fullname username domain id section status/; + @StudentDataOrder = qw/fullname username domain id section status comments/; foreach my $field (@StudentDataOrder) { - $StudentData{$field}->{'title'} = $field; - $StudentData{$field}->{'base_width'} = length($field); + $StudentData{$field}->{'title'} = &mt($field); + $StudentData{$field}->{'base_width'} = length(&mt($field)); $StudentData{$field}->{'width'} = $StudentData{$field}->{'base_width'}; } @@ -786,157 +786,6 @@ sub SectionSelect { return $Str; } -####################################################### -####################################################### - -=pod - -=item &CreateAndParseOutputSelector() - -Construct a selection list of options for output and parse output selections. - -=cut - -####################################################### -####################################################### -sub OutputDescriptions { - my (@OutputOptions) = @_; - my $Str = ''; - $Str .= "

Output Modes

\n"; - $Str .= "
\n"; - foreach my $outputmode (@OutputOptions) { - $Str .="
".$outputmode->{'name'}."
\n"; - $Str .="
".$outputmode->{'description'}."
\n"; - } - $Str .= "
\n"; - return $Str; -} - -sub CreateAndParseOutputSelector { - my ($elementname,$default,@OutputOptions) = @_; - my $output_mode; - my $show; - my $Str = ''; - # - # Format for output options is 'mode, restrictions'; - my $selected = $default; - if (exists($ENV{'form.'.$elementname})) { - if (ref($ENV{'form.'.$elementname} eq 'ARRAY')) { - $selected = $ENV{'form.'.$elementname}->[0]; - } else { - $selected = $ENV{'form.'.$elementname}; - } - } - # - # Set package variables describing output mode - $output_mode = 'html'; - $show = 'all'; - foreach my $option (@OutputOptions) { - next if ($option->{'value'} ne $selected); - $output_mode = $option->{'mode'}; - $show = $option->{'show'}; - } - # - # Build the form element - $Str = qq/"; - return ($Str,$output_mode,$show); -} - -############################################### -############################################### - -=pod - -=item &Gather_Student_Data() - -Ensures all student data is up to date. - -=cut - -############################################### -############################################### -sub Gather_Student_Data { - my ($r) = @_; - my $c = $r->connection(); - # - &Apache::loncoursedata::clear_internal_caches(); - # - 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, - &mt('last student')); - } - &Apache::lonhtmlcommon::Close_PrgWin($r,\%prog_state); - $r->rflush(); -} - -############################################### -############################################### - -=pod - -=item &Gather_Full_Student_Data() - -Ensures all student data is up to date. - -=cut - -############################################### -############################################### -sub Gather_Full_Student_Data { - my ($r,$formname,$inputname) = @_; - my $status_type; - if (defined($formname)) { - $status_type = 'inline'; - } else { - $status_type = 'popup'; - } - my $c = $r->connection(); - # - &Apache::loncoursedata::clear_internal_caches(); - # - my @Students = @Apache::lonstatistics::Students; - # - # Open the progress window - my %prog_state=&Apache::lonhtmlcommon::Create_PrgWin - ($r,&mt('Student Data Compilation Status'), - &mt('Student Data Compilation Progress'), scalar(@Students), - $status_type,undef,$formname,$inputname); - # - while (my $student = shift @Students) { - return if ($c->aborted()); - my ($status,undef) = &Apache::loncoursedata::ensure_current_full_data - ($student->{'username'},$student->{'domain'}, - $ENV{'request.course.id'}); - &Apache::lonhtmlcommon::Increment_PrgWin($r,\%prog_state, - &mt('last student')); - } - &Apache::lonhtmlcommon::Close_PrgWin($r,\%prog_state); - $r->rflush(); -} - ################################################## ################################################## sub DisplayClasslist { @@ -1081,7 +930,7 @@ sub CreateMainMenu { { internal_name => 'student_submission_reports', name => &mt('Student Submission Reports'), short_description => - &mt('Prepare Excel spreadsheets of student submissions.'), + &mt('Prepare reports of student submissions.'), }, { internal_name => 'survey_reports', name => &mt('Survey Reports'), @@ -1155,9 +1004,19 @@ sub handler { 'SelectedStudent']); # # Give the LON-CAPA page header - $r->print(''. + my $style = <<ENDSTYLE; +<style type="text/css"> + ul.sub_studentans { list-style-type: none } + ul.sub_correctans { list-style-type: none } + tr.even { background-color: \#CCCCCC } + td.essay { border: 1px solid gray; } +</style> +ENDSTYLE + my $html=&Apache::lonxml::xmlbegin(); + $r->print($html.'<head><title>'. &mt('Course Statistics and Charts'). - "\n". + ''.$style. + "\n". &Apache::loncommon::bodytag('Course Statistics and Charts')); $r->rflush(); #