--- loncom/interface/lonstatistics.pm 2003/05/27 14:51:24 1.71 +++ loncom/interface/lonstatistics.pm 2003/06/10 19:19:57 1.76 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: lonstatistics.pm,v 1.71 2003/05/27 14:51:24 matthew Exp $ +# $Id: lonstatistics.pm,v 1.76 2003/06/10 19:19:57 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -300,9 +300,10 @@ sub PrepareClasslist { @Students = @TmpStudents; # # Now deal with that current student thing.... - if (exists($ENV{'form.StudentAssessmentStudent'})) { + $curr_student = undef; + if (exists($ENV{'form.SelectedStudent'})) { my ($current_uname,$current_dom) = - split(':',$ENV{'form.StudentAssessmentStudent'}); + split(':',$ENV{'form.SelectedStudent'}); my $i; for ($i = 0; $i<=$#Students; $i++) { next if (($Students[$i]->{'username'} ne $current_uname) || @@ -310,15 +311,17 @@ sub PrepareClasslist { $curr_student = $Students[$i]; last; # If we get here, we have our student. } - if ($i == 0) { - $prev_student = 'none'; - } else { - $prev_student = $Students[$i-1]; - } - if ($i == $#Students) { - $next_student = 'none'; - } else { - $next_student = $Students[$i+1]; + if (defined($curr_student)) { + if ($i == 0) { + $prev_student = undef; + } else { + $prev_student = $Students[$i-1]; + } + if ($i == $#Students) { + $next_student = undef; + } else { + $next_student = $Students[$i+1]; + } } } # @@ -329,7 +332,7 @@ sub PrepareClasslist { @SelectedStudentData = ($ENV{'form.StudentData'}); } } else { - @SelectedStudentData = ('fullname'); + @SelectedStudentData = ('username'); } foreach (@SelectedStudentData) { if ($_ eq 'all') { @@ -377,11 +380,7 @@ selected student. ####################################################### ####################################################### sub current_student { - if (defined($curr_student)) { - return $curr_student; - } else { - return 'All Students'; - } + return $curr_student; } ####################################################### @@ -399,11 +398,7 @@ in the list of students. Or something. ####################################################### ####################################################### sub previous_student { - if (defined($prev_student)) { - return $prev_student; - } else { - return 'No Student Selected'; - } + return $prev_student; } ####################################################### @@ -421,11 +416,7 @@ to be viewed. ####################################################### ####################################################### sub next_student { - if (defined($next_student)) { - return $next_student; - } else { - return 'No Student Selected'; - } + return $next_student; } ####################################################### @@ -528,10 +519,8 @@ sub PrepareCourseData { my $name_length = length($seq->{'title'}); my $num_parts = $seq->{'num_assess_parts'}; # - # The number of columns needed for the summation text: - # " 1/5" = 1+3 columns, " 10/99" = 1+5 columns - my $sum_length = 1+1+2*(length($num_parts)); - my $num_col = $num_parts+$sum_length; + # Use 3 digits for each the sum and total, which means 7 total... + my $num_col = $num_parts+7; if ($num_col < $name_length) { $num_col = $name_length; } @@ -816,6 +805,8 @@ sub DisplayClasslist { my @Fields = ('fullname','username','domain','id','section'); # my $Str=''; + # "Click" is asinine but it is probably not my place to change the world. + $Str .= '

Click on a users name to view their chart

'; $Str .= '
'."\n"; $Str .= ''."\n"; foreach my $field (@Fields) { @@ -839,7 +830,8 @@ sub DisplayClasslist { if ($field eq 'fullname') { $Str .= ''; $Str .= $student->{$field}.' '; $Str .= ''; @@ -866,20 +858,10 @@ sub CreateMainMenu { my $Str = ''; # $Str .= '
'."\n"; - $Str .= ''."\n"; - $Str .= ''."\n"; - $Str .= ''."\n"; - $Str .= ''."\n"; - # - $Str .= '\n"; - $Str .= '\n"; - # + $Str .= ''."\n"; $Str .= '\n"; $Str .= '
Select a Report
'. - ''. - "'. - ''. - "Report:'; - $Str .= ''."\n"; foreach (sort(keys(%$reports))) { $Str .= ''. + ''. + "
'."\n"; $Str .= '
'."\n"; # @@ -940,7 +926,7 @@ sub handler { # Extract form elements from query string &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, ['sort','reportSelected', - 'StudentAssessmentStudent']); + 'SelectedStudent']); if (! exists($ENV{'form.reportSelected'})) { $ENV{'form.reportSelected'} = 'student_assessment'; } @@ -982,8 +968,8 @@ END my %reports = ('classlist' => 'Class list', 'problem_statistics' => 'Problem Statistics', 'student_assessment' => 'Problem Status Chart', - 'percentage' => 'Correct-problems Plot', - 'option_response' => 'Option Response Analysis', +# 'percentage' => 'Correct-problems Plot', +# 'option_response' => 'Option Response Analysis', # 'activitylog' => 'Activity Log', ); $r->print(&CreateMainMenu($ENV{'form.status'},