--- loncom/interface/statistics/lonstudentassessment.pm 2003/05/12 22:07:17 1.46
+++ loncom/interface/statistics/lonstudentassessment.pm 2009/05/17 23:13:49 1.155
@@ -1,6 +1,6 @@
# The LearningOnline Network with CAPA
#
-# $Id: lonstudentassessment.pm,v 1.46 2003/05/12 22:07:17 matthew Exp $
+# $Id: lonstudentassessment.pm,v 1.155 2009/05/17 23:13:49 bisitz Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -50,11 +50,20 @@ Presents assessment data about a student
package Apache::lonstudentassessment;
use strict;
-use Apache::lonstatistics;
-use Apache::lonhtmlcommon;
+use Apache::lonstatistics();
+use Apache::lonhtmlcommon();
+use Apache::loncommon();
use Apache::loncoursedata;
use Apache::lonnet; # for logging porpoises
+use Apache::lonlocal;
+use Apache::grades();
+use Apache::lonmsgdisplay();
+use Time::HiRes;
use Spreadsheet::WriteExcel;
+use Spreadsheet::WriteExcel::Utility();
+use lib '/home/httpd/lib/perl/';
+use LONCAPA;
+
#######################################################
#######################################################
@@ -85,13 +94,17 @@ my $Statistics;
=item $show 'all', 'totals', or 'scores' determines how much data is output
+=item $single_student_mode evaluates to true if we are showing only one
+student.
+
=cut
#######################################################
#######################################################
my $show_links;
my $output_mode;
-my $show;
+my $chosen_output;
+my $single_student_mode;
#######################################################
#######################################################
@@ -126,27 +139,49 @@ Inputs:
#######################################################
sub BuildStudentAssessmentPage {
my ($r,$c)=@_;
+ #
undef($Statistics);
+ undef($show_links);
+ undef($output_mode);
+ undef($chosen_output);
+ undef($single_student_mode);
+ #
+ my %Saveable_Parameters = ('Status' => 'scalar',
+ 'chartoutputmode' => 'scalar',
+ 'chartoutputdata' => 'scalar',
+ 'Section' => 'array',
+ 'Groups' => 'array',
+ 'StudentData' => 'array',
+ 'Maps' => 'array');
+ &Apache::loncommon::store_course_settings('chart',\%Saveable_Parameters);
+ &Apache::loncommon::restore_course_settings('chart',\%Saveable_Parameters);
+ #
+ &Apache::lonstatistics::PrepareClasslist();
+ #
+ $single_student_mode = 0;
+ $single_student_mode = 1 if ($env{'form.SelectedStudent'});
+ &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
+ ['selectstudent']);
+ if ($env{'form.selectstudent'}) {
+ &Apache::lonstatistics::DisplayClasslist($r);
+ return;
+ }
#
# Print out the HTML headers for the interface
# This also parses the output mode selector
- # This step must always be done.
+ # This step must *always* be done.
$r->print(&CreateInterface());
$r->print('');
+ $r->print('');
$r->rflush();
- if (! exists($ENV{'form.notfirstrun'})) {
- $r->print(<
Sections | '; - $Str .= 'Student Data | '; - $Str .= 'Enrollment Status | '; - $Str .= 'Sequences and Folders | '; - $Str .= 'Output Format | '; + $Str .= ''.&mt('Sections').''. + &Apache::loncommon::help_open_topic("Chart_Sections"). + ' | '; + $Str .= ''.&mt('Groups').''. + ' | '; + $Str .= ''.&mt('Student Data'). + &Apache::loncommon::help_open_topic("Chart_Student_Data"). + ' | '; + $Str .= ''.&mt('Access Status').''. + &Apache::loncommon::help_open_topic("Chart_Enrollment_Status"). + ' | '; + $Str .= ''.&mt('Sequences and Folders').''. + &Apache::loncommon::help_open_topic("Chart_Sequences"). + ' | '; + $Str .= ''.&mt('Output Format').''. + &Apache::loncommon::help_open_topic("Chart_Output_Formats"). + ' | '; + $Str .= ''.&mt('Output Data').''. + &Apache::loncommon::help_open_topic("Chart_Output_Data"). + ' | '; $Str .= '
'."\n"; $Str .= &Apache::lonstatistics::SectionSelect('Section','multiple',5); $Str .= ' | '; - my $only_seq_with_assessments = sub { - my $s=shift; - if ($s->{'num_assess'} < 1) { - return 0; - } else { - return 1; - } - }; + $Str .= &Apache::lonstatistics::GroupSelect('Group','multiple',5); + $Str .= ' | '; $Str .= &Apache::lonstatistics::StudentDataSelect('StudentData','multiple', 5,undef); $Str .= ' | '."\n"; $Str .= &Apache::lonhtmlcommon::StatusOptions(undef,undef,5); $Str .= ' | '."\n"; - $Str .= &Apache::lonstatistics::MapSelect('Maps','multiple,all',5, - $only_seq_with_assessments); + $Str .= &Apache::lonstatistics::map_select('Maps','multiple,all',5); $Str .= ' | '."\n"; $Str .= &CreateAndParseOutputSelector(); + $Str .= ' | '."\n"; + $Str .= &CreateAndParseOutputDataSelector(); $Str .= ' |
'; + $Str .= + &mt('Status [_1]', + ''); + $Str .= '
'; return $Str; } @@ -271,108 +394,44 @@ my @OutputOptions = description => 'Output HTML with each symbol linked to the problem '. 'which generated it.', mode => 'html', - show => 'all', show_links => 'yes', }, + { name => 'HTML, with all links', + value => 'html, with all links', + description => 'Output HTML with each symbol linked to the problem '. + 'which generated it. '. + 'This includes links for unattempted problems.', + mode => 'html', + show_links => 'all', + }, { name => 'HTML, without links', value => 'html, without links', description => 'Output HTML. By not including links, the size of the'. ' web page is greatly reduced. If your browser crashes on the '. 'full display, try this.', mode => 'html', - show => 'all', - show_links => 'no', - }, - { name => 'HTML, scores only', - value => 'html, scores only', - description => 'Output HTML, only showing the total number of correct'. - ' problems (or problem parts) and not the maximum possible for '. - 'each student', - mode => 'html', - show => 'scores', - show_links => 'no', - }, - { name => 'HTML, totals', - value => 'html, totals', - description => 'Output HTML, but only the summary statistics for each'. - ' sequence selected for each student.', - mode => 'html', - show => 'totals', - show_links => 'no', - }, - { name => 'HTML, summary table only', - value => 'html summary table only', - description => 'Output HTML, but only the final summary table for '. - 'all students across all sequences.', - mode => 'html', - show => 'final table', - show_links => 'no', - }, - { name => 'Excel, scores only', - value => 'excel, scores only', - description => 'Output an Excel file (compatable with Excel 95), '. - 'with a single column for each sequence showing the students '. - 'score.', - mode => 'excel', - show => 'scores', show_links => 'no', }, - { name => 'Excel, totals', - value => 'excel, totals', - description => 'Output an Excel file (compatable with Excel 95), '. - 'with two columns for each sequence, the students score on the '. - 'sequence and the students maximum possible on the sequence', + { name => 'Excel', + value => 'excel', + description => 'Output an Excel file (compatable with Excel 95).', mode => 'excel', - show => 'totals', - show_links => 'no', - }, - { name => 'multi-sheet Excel', - value => 'multi-sheet excel', - description => 'Output an Excel file (compatable with Excel 95), '. - 'with a seperate worksheet for each sequence you have selected '. - 'the data for each problem part '. - '(number of tries, status, points awarded) will be listed.', - mode => 'multi-sheet excel', - show => 'totals', show_links => 'no', - }, - { name => 'multi-sheet Excel, by section', - value => 'multi-sheet excel, by section', - description => 'Output an Excel file (compatable with Excel 95), '. - 'with a seperate worksheet for each sequence you have selected '. - 'the data for each problem part '. - '(number of tries, status, points awarded) will be listed. '. - 'There will be one Excel workbook for each section selected.', - mode => 'multi-sheet excel', - show => 'by section', - show_links => 'no', - }, - { name => 'CSV, everything', - value => 'csv, everything', - description => '', - mode => 'csv', - show => 'all', - show_links => 'no', - }, - { name => 'CSV, scores only', - value => 'csv, scores only', - description => '', + }, + { name => 'CSV', + value => 'csv', + description => 'Output a comma separated values file suitable for '. + 'import into a spreadsheet program. Using this method as opposed '. + 'to Excel output allows you to organize your data before importing'. + ' it into a spreadsheet program.', mode => 'csv', - show => 'scores', - show_links => 'no', - }, - { name => 'CSV, totals', - value => 'csv, totals', - description => '', - mode => 'csv', - show => 'totals', show_links => 'no', }, ); sub OutputDescriptions { my $Str = ''; - $Str .= "