--- loncom/interface/lonstatistics.pm 2003/05/27 14:51:24 1.71 +++ loncom/interface/lonstatistics.pm 2003/06/03 18:10:33 1.74 @@ -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.74 2003/06/03 18:10:33 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; } ####################################################### @@ -839,7 +830,8 @@ sub DisplayClasslist { if ($field eq 'fullname') { $Str .= ''; $Str .= $student->{$field}.' '; $Str .= ''; @@ -867,16 +859,14 @@ sub CreateMainMenu { # $Str .= '
'."\n"; - $Str .= ' | '."\n"; $Str .= ' | Select a Report | '."\n"; + $Str .= ''."\n"; + $Str .= ' | '."\n"; $Str .= ' |
'. ''. " | \n"; - $Str .= ''. - ''. - " | \n"; # $Str .= ''; $Str .= ' | '."\n"; # + $Str .= ''.(' 'x30).' | '; + $Str .= ''. + ''. + " | \n"; $Str .= '