--- loncom/interface/lonstatistics.pm 2003/05/29 21:38:32 1.72 +++ loncom/interface/lonstatistics.pm 2003/10/03 15:34:58 1.78.2.1 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: lonstatistics.pm,v 1.72 2003/05/29 21:38:32 matthew Exp $ +# $Id: lonstatistics.pm,v 1.78.2.1 2003/10/03 15:34:58 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -519,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; } @@ -807,6 +805,46 @@ sub DisplayClasslist { my @Fields = ('fullname','username','domain','id','section'); # my $Str=''; + if (! @Students) { + if ($SelectedSections[0] eq 'all') { + if (lc($ENV{'form.Status'}) eq 'any') { + $Str .= '

There are no students in the course.

'; + } elsif (lc($ENV{'form.Status'}) eq 'active') { + $Str .= '

There are no currently enrolled students in '. + 'the course.

'; + } elsif (lc($ENV{'form.Status'}) eq 'expired') { + $Str .= '

There are no previously enrolled '. + 'students in the course.

'; + } + } else { + my $sections; + if (@SelectedSections == 1) { + $sections = 'section '.$SelectedSections[0]; + } elsif (@SelectedSections > 2) { + $sections = 'sections '.join(', ',@SelectedSections); + $sections =~ s/, ([^,])*$/, and $1/; + } else { + $sections = 'sections '.join(' and ',@SelectedSections); + } + if (lc($ENV{'form.Status'}) eq 'any') { + $Str .= '

There are no students in '.$sections.'.

'; + } elsif (lc($ENV{'form.Status'}) eq 'active') { + $Str .= '

There are no currently enrolled students '. + 'in '.$sections.'.

'; + } elsif (lc($ENV{'form.Status'}) eq 'expired') { + $Str .= '

There are no previously enrolled students '. + 'in '.$sections.'.

'; + } + } + $Str.= ''. + 'Return to the chart.'; + $r->print($Str); + $r->rflush(); + return; + } + + # "Click" is asinine but it is probably not my place to change the world. + $Str .= '

Click on a students name or username to view their chart

'; $Str .= '
'."\n"; $Str .= ''."\n"; foreach my $field (@Fields) { @@ -827,7 +865,7 @@ sub DisplayClasslist { # foreach my $field (@Fields) { $Str .= ''."\n"; - $Str .= ''."\n"; - $Str .= ''."\n"; - $Str .= ''."\n"; - $Str .= ''."\n"; - # - $Str .= '\n"; - $Str .= '\n"; - # - $Str .= ''."\n"; - # - $Str .= '
'; - if ($field eq 'fullname') { + if ($field eq 'fullname' || $field eq 'username') { $Str .= '
Select a Report
'. - ''. - "'. - ''. - "'; - $Str .= '
'."\n"; - $Str .= '
'."\n"; + $Str = ''; +# $Str .= ''."\n"; +# $Str .= ''."\n"; +# $Str .= ''."\n"; +# # +# $Str .= ''; +# $Str .= '\n"; +# $Str .= '
Report:'; +# $Str .= ''.(' 'x30).''. +# ''. +# "
'."\n"; +# $Str .= '
'."\n"; # return $Str; } @@ -893,6 +926,8 @@ sub handler { my $r=shift; my $c = $r->connection(); # + &Apache::loncoursedata::clear_internal_caches(); + # # Check for overloading my $loaderror=&Apache::lonnet::overloaderror($r); if ($loaderror) { return $loaderror; } @@ -974,8 +1009,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'}, @@ -993,8 +1028,6 @@ END &Apache::lonstudentassessment::BuildStudentAssessmentPage($r,$c); } elsif($GoToPage eq 'DoDiffGraph' || $GoToPage eq 'PercentWrongGraph') { # &Apache::lonproblemstatistics::BuildGraphicChart($r,$c); - } elsif($GoToPage eq 'classlist') { - &DisplayClasslist($r); } elsif($GoToPage eq 'Correct-problems Plot') { # &Apache::lonpercentage::BuildPercentageGraph($r,$c); }