From: Gavin L. v. a. <we...@ma...> - 2005-02-01 21:50:22
|
Log Message: ----------- StudentProgress.pm: clean up from previous commit to clear warning messages. Tags: ---- rel-2-1-a1 Modified Files: -------------- webwork2/lib/WeBWorK/ContentGenerator/Instructor: StudentProgress.pm Revision Data ------------- Index: StudentProgress.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator/Instructor/StudentProgress.pm,v retrieving revision 1.4.2.4 retrieving revision 1.4.2.5 diff -Llib/WeBWorK/ContentGenerator/Instructor/StudentProgress.pm -Llib/WeBWorK/ContentGenerator/Instructor/StudentProgress.pm -u -r1.4.2.4 -r1.4.2.5 --- lib/WeBWorK/ContentGenerator/Instructor/StudentProgress.pm +++ lib/WeBWorK/ContentGenerator/Instructor/StudentProgress.pm @@ -351,10 +351,6 @@ } else {@myUsers = @userRecords;} - # for versioned sets, if we're keeping track of only the high score - # then we need to know when we change student records - my $prevStuName = 'none'; - foreach my $studentRecord (@myUsers) { next unless ref($studentRecord); my $student = $studentRecord->user_id; @@ -603,22 +599,28 @@ # for versioned set viewing my @columnHdrs = (); # define this for use on all of the sorts - my @paramList = ( 'returning', $r->param('returning'), 'show_best_only', - $showBestOnly, 'show_index', $showColumns{'index'}, - 'show_date', $showColumns{'date'}, - 'show_problems', $showColumns{'problems'}, - 'show_section', $showColumns{'section'}, - 'show_recitation', $showColumns{'recit'}, - 'show_login', $showColumns{'login'} ); - push(@columnHdrs, ($sort_method_name ne 'name' && $sort_method_name ne '') ? CGI::a({'href'=>$self->systemLink($setStatsPage,params=>{sort=>'name', @paramList})},'Name') : 'Name') if ( $showColumns{'name'} ); - push(@columnHdrs, $sort_method_name ne 'score' ? CGI::a({"href"=>$self->systemLink($setStatsPage,params=>{sort=>'score', @paramList})},'Score') : 'Score') if ( $showColumns{'score'} ); + my %paramList = (); + if ( $setIsVersioned ) { + my $rtng = (defined( $r->param('returning') )) ? + $r->param('returning') : 0; + %paramList = ( 'returning' => $rtng, + 'show_best_only' => $showBestOnly, + 'show_index' => $showColumns{'index'}, + 'show_date' => $showColumns{'date'}, + 'show_problems' => $showColumns{'problems'}, + 'show_section' => $showColumns{'section'}, + 'show_recitation' => $showColumns{'recit'}, + 'show_login' => $showColumns{'login'} ); + } + push(@columnHdrs, (! defined($sort_method_name) || ($sort_method_name ne 'name' && $sort_method_name ne '')) ? CGI::a({'href'=>$self->systemLink($setStatsPage,params=>{'sort'=>'name', %paramList})},'Name') : 'Name') if ( $showColumns{'name'} ); + push(@columnHdrs, (! defined($sort_method_name) || $sort_method_name ne 'score') ? CGI::a({"href"=>$self->systemLink($setStatsPage,params=>{'sort'=>'score', %paramList})},'Score') : 'Score') if ( $showColumns{'score'} ); push(@columnHdrs, 'Out'.CGI::br().'Of') if ( $showColumns{'outof'} ); push(@columnHdrs, 'Date') if ( $showColumns{'date'} ); - push(@columnHdrs, $sort_method_name ne 'index' ? CGI::a({"href"=>$self->systemLink($setStatsPage,params=>{sort=>'index', @paramList})},'Ind') : 'Ind') if ( $showColumns{'index'} ); + push(@columnHdrs, (! defined($sort_method_name) || $sort_method_name ne 'index') ? CGI::a({"href"=>$self->systemLink($setStatsPage,params=>{'sort'=>'index', %paramList})},'Ind') : 'Ind') if ( $showColumns{'index'} ); push(@columnHdrs, 'Problems'.CGI::br().$problem_header) if ( $showColumns{'problems'} ); - push(@columnHdrs, $sort_method_name ne 'section' ? CGI::a({"href"=>$self->systemLink($setStatsPage,params=>{sort=>'section', @paramList})},'Section') : 'Section') if ( $showColumns{'section'} ); - push(@columnHdrs, $sort_method_name ne 'recitation' ? CGI::a({"href"=>$self->systemLink($setStatsPage,params=>{sort=>'recitation', @paramList})},'Recitation'):'Recitation') if ( $showColumns{'recit'} ); - push(@columnHdrs, $sort_method_name ne 'user_id' ? CGI::a({"href"=>$self->systemLink($setStatsPage,params=>{sort=>'user_id', @paramList})},'Login Name'):'Login Name') if ( $showColumns{'login'} ); + push(@columnHdrs, (! defined($sort_method_name) || $sort_method_name ne 'section') ? CGI::a({"href"=>$self->systemLink($setStatsPage,params=>{'sort'=>'section', %paramList})},'Section') : 'Section') if ( $showColumns{'section'} ); + push(@columnHdrs, (! defined($sort_method_name) || $sort_method_name ne 'recitation') ? CGI::a({"href"=>$self->systemLink($setStatsPage,params=>{'sort'=>'recitation', %paramList})},'Recitation'):'Recitation') if ( $showColumns{'recit'} ); + push(@columnHdrs, (! defined($sort_method_name) || $sort_method_name ne 'user_id') ? CGI::a({"href"=>$self->systemLink($setStatsPage,params=>{'sort'=>'user_id', %paramList})},'Login Name'):'Login Name') if ( $showColumns{'login'} ); print CGI::br(), |