[LON-CAPA-cvs] cvs: loncom(version_2_11_X) /interface lonstatistics.pm

raeburn raeburn at source.lon-capa.org
Wed Nov 11 17:27:41 EST 2020


raeburn		Wed Nov 11 22:27:41 2020 EDT

  Modified files:              (Branch: version_2_11_X)
    /loncom/interface	lonstatistics.pm 
  Log:
  - For 2.11
    Backport 1.165
  
  
Index: loncom/interface/lonstatistics.pm
diff -u loncom/interface/lonstatistics.pm:1.156.2.7 loncom/interface/lonstatistics.pm:1.156.2.8
--- loncom/interface/lonstatistics.pm:1.156.2.7	Sun Aug 14 16:38:05 2016
+++ loncom/interface/lonstatistics.pm	Wed Nov 11 22:27:41 2020
@@ -1,6 +1,6 @@
 # The LearningOnline Network with CAPA
 #
-# $Id: lonstatistics.pm,v 1.156.2.7 2016/08/14 16:38:05 raeburn Exp $
+# $Id: lonstatistics.pm,v 1.156.2.8 2020/11/11 22:27:41 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -832,6 +832,8 @@
     &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;
@@ -842,9 +844,39 @@
     td.essay          { border: 1px solid gray; }
 </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',
-					     $style));
+					     $head_extra));
     $r->rflush();
     # 
     # Either print out a menu for them or send them to a report
@@ -854,8 +886,7 @@
                                             text =>'Statistics',
                                             faq=>139,
                                             bug=>'Statistics and Charts'});
-    if (! exists($env{'form.reportSelected'}) || 
-        $env{'form.reportSelected'} eq '') {
+    if ($GoToPage eq '') {
         $r->print(&Apache::lonhtmlcommon::breadcrumbs('Statistics Main Page').
                   &CreateMainMenu());
     } else {
@@ -883,8 +914,6 @@
             &Apache::loncoursedata::delete_caches($env{'request.course.id'});
         }
         #
-        my $GoToPage = $env{'form.reportSelected'};
-        #
         # Begin form output
         $r->print('<form name="Statistics" ');
         if ($GoToPage eq 'student_submission_reports') {




More information about the LON-CAPA-cvs mailing list