--- loncom/interface/statistics/lonstudentassessment.pm 2003/04/29 19:46:24 1.45
+++ loncom/interface/statistics/lonstudentassessment.pm 2005/03/14 20:28:22 1.119
@@ -1,6 +1,6 @@
# The LearningOnline Network with CAPA
#
-# $Id: lonstudentassessment.pm,v 1.45 2003/04/29 19:46:24 matthew Exp $
+# $Id: lonstudentassessment.pm,v 1.119 2005/03/14 20:28:22 matthew Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -52,9 +52,13 @@ package Apache::lonstudentassessment;
use strict;
use Apache::lonstatistics;
use Apache::lonhtmlcommon;
+use Apache::loncommon();
use Apache::loncoursedata;
use Apache::lonnet; # for logging porpoises
+use Apache::lonlocal;
+use Time::HiRes;
use Spreadsheet::WriteExcel;
+use Spreadsheet::WriteExcel::Utility();
#######################################################
#######################################################
@@ -85,13 +89,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 +134,48 @@ 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',
+ '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 .= 'Sequences and Folders | '; - $Str .= 'Output Format | '; + $Str .= ''.&mt('Sections').' | '; + $Str .= ''.&mt('Student Data').' | '; + $Str .= ''.&mt('Enrollment Status').' | '; + $Str .= ''.&mt('Sequences and Folders').' | '; + $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::StudentDataSelect('StudentData','multiple', 5,undef); $Str .= ' | '."\n"; - $Str .= &Apache::lonstatistics::MapSelect('Maps','multiple,all',5, - $only_seq_with_assessments); + $Str .= &Apache::lonhtmlcommon::StatusOptions(undef,undef,5); + $Str .= ' | '."\n"; + $Str .= &Apache::lonstatistics::map_select('Maps','multiple,all',5); $Str .= ' | '."\n"; $Str .= &CreateAndParseOutputSelector(); + $Str .= ' | '."\n"; + $Str .= &CreateAndParseOutputDataSelector(); $Str .= ' |