--- loncom/interface/lonstatistics.pm 2023/09/07 23:58:32 1.156.2.8.2.1 +++ loncom/interface/lonstatistics.pm 2013/03/06 11:39:00 1.157 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: lonstatistics.pm,v 1.156.2.8.2.1 2023/09/07 23:58:32 raeburn Exp $ +# $Id: lonstatistics.pm,v 1.157 2013/03/06 11:39:00 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -366,7 +366,7 @@ sub section_or_group_text { sub get_students { if (! @Students) { - &PrepareClasslist(); + &PrepareClasslist() } return @Students; } @@ -466,7 +466,7 @@ sub selected_sequences_with_assessments my @sequences_with_assessments; foreach my $sequence (@sequences) { - if ($navmap->hasResource($sequence,sub { shift->is_gradable(); },0,1)){ + if ($navmap->hasResource($sequence,sub { shift->is_problem(); },0,1)){ push(@sequences_with_assessments,$sequence); } } @@ -511,7 +511,7 @@ sub map_select { if ($selected_maps[0] eq 'all') { $form .= ' selected="selected"'; } - $form .= '>'.&mt('all').''."\n"; + $form .= ">all\n"; # # Loop through the sequences my @sequences = &selected_sequences_with_assessments('all'); @@ -547,11 +547,6 @@ sub SectionSelect { &PrepareClasslist() } # - # Make sure course's student table is up to date - if (@Sections) { - &Apache::loncoursedata::ensure_current_sections(); - } - # # Build the form element my $Str = "\n"; $Str .= ''; $r->print($Str); @@ -709,8 +696,8 @@ sub DisplayClasslist { .&Apache::loncommon::start_data_table_header_row(); foreach my $field (@Fields) { $Str .= ''.&mt($field). ''; } @@ -725,8 +712,8 @@ sub DisplayClasslist { if ($field eq 'fullname' || $field eq 'username') { $Str .= ''; $Str .= $student->{$field}; $Str .= ''; @@ -832,8 +819,6 @@ sub handler { &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, ['sort','reportSelected', 'SelectedStudent']); - my $GoToPage = $env{'form.reportSelected'}; - # # Give the LON-CAPA page header my $style = < ENDSTYLE - - my $head_extra = $style; - if (($env{'form.reportSelected'} eq 'student_submission_reports') && - ($env{'form.renderprob'})) { - my @Symbs = &Apache::lonstathelpers::get_selected_symbs('problemchoice'); - if (scalar(@Symbs) == 1) { - $head_extra .= &Apache::loncommon::css_links($Symbs[0]); - } - } elsif ($env{'form.reportSelected'} eq 'submissiontime_analysis') { - my ($navmap,$current_problem) = - &Apache::lonsubmissiontimeanalysis::get_current_problem(); - if (ref($current_problem) eq 'HASH') { - my $symb = $current_problem->{'symb'}; - if ($symb) { - $head_extra .= &Apache::loncommon::css_links($symb); - } - } - } elsif (($env{'form.reportSelected'} eq 'problem_analysis') && - ($env{'form.show_prob'})) { - my $problem_types = &Apache::lonproblemanalysis::analyzable_types(); - my ($navmap,$current_problem) = - &Apache::lonproblemanalysis::get_current_problem($problem_types); - if (ref($current_problem) eq 'HASH') { - my $symb = $current_problem->{'symb'}; - my $res = $current_problem->{'resource'}; - if ($symb) { - $head_extra .= &Apache::loncommon::css_links($symb); - } - } - } $r->print(&Apache::loncommon::start_page('Course Statistics and Charts', - $head_extra)); + $style)); $r->rflush(); # # Either print out a menu for them or send them to a report @@ -886,9 +841,11 @@ ENDSTYLE text =>'Statistics', faq=>139, bug=>'Statistics and Charts'}); - if ($GoToPage eq '') { - $r->print(&Apache::lonhtmlcommon::breadcrumbs('Statistics Main Page'). - &CreateMainMenu()); + if (! exists($env{'form.reportSelected'}) || + $env{'form.reportSelected'} eq '') { + $r->print(&Apache::lonhtmlcommon::breadcrumbs('Statistics Main Page')); + &Apache::lonquickgrades::startGradeScreen($r,'statistics'); + $r->print(&CreateMainMenu()); } else { # if (! &Apache::lonmysql::verify_sql_connection()) { @@ -911,9 +868,11 @@ ENDSTYLE # # Clean out the caches if (exists($env{'form.ClearCache'})) { - &Apache::loncoursedata::delete_caches($env{'request.course.id'}); + &Apache::loncoursedata::delete_caches($env{'requres.course.id'}); } # + my $GoToPage = $env{'form.reportSelected'}; + # # Begin form output $r->print('
print("
\n"); } + &Apache::lonquickgrades::endGradeScreen($r); $r->print(&Apache::loncommon::end_page()); $r->rflush(); #