[LON-CAPA-cvs] cvs: loncom /interface lonstatistics.pm mydesk.tab /localize/localize newphrases.txt

matthew lon-capa-cvs@mail.lon-capa.org
Wed, 08 Oct 2003 15:32:00 -0000


This is a MIME encoded message

--matthew1065627120
Content-Type: text/plain

matthew		Wed Oct  8 11:32:00 2003 EDT

  Modified files:              
    /loncom/localize/localize	newphrases.txt 
    /loncom/interface	lonstatistics.pm mydesk.tab 
  Log:
  Futher internationalization of lonstatistics.pm.
  Added menu in lonstatistics to allow choice of statistical analyses or chart.
  Added same menu text and some error messages to newphrases.txt to be localized.
  Modified mydesk.tab to make [STAT] button take you to the statistics menu
  and not the problem_statistics page.
  
  
--matthew1065627120
Content-Type: text/plain
Content-Disposition: attachment; filename="matthew-20031008113200.txt"

Index: loncom/localize/localize/newphrases.txt
diff -u loncom/localize/localize/newphrases.txt:1.7 loncom/localize/localize/newphrases.txt:1.8
--- loncom/localize/localize/newphrases.txt:1.7	Mon Sep 29 12:20:18 2003
+++ loncom/localize/localize/newphrases.txt	Wed Oct  8 11:32:00 2003
@@ -26,4 +26,13 @@
 Preparing Excel Spreadsheet
 Your Excel Spreadsheet
 Problems creating new Excel file.  This error has been logged.  Please alert your LON-CAPA administrator.
-
+Statistics and Problem Analysis
+Please select a report to generate.
+Overall Problem Statistics
+Student performance statistics on all problems.
+Detailed statistics and graphs of student performance on problems.
+Problem Status Chart
+Brief view of each students performance in course.
+Unable to connect to database!
+Please notify the server administrator 
+Course Statistics and Charts cannot be retrieved until the database is restarted.  Your data is intact but cannot be displayed at this time.
Index: loncom/interface/lonstatistics.pm
diff -u loncom/interface/lonstatistics.pm:1.84 loncom/interface/lonstatistics.pm:1.85
--- loncom/interface/lonstatistics.pm:1.84	Thu Oct  2 13:08:53 2003
+++ loncom/interface/lonstatistics.pm	Wed Oct  8 11:32:00 2003
@@ -1,6 +1,6 @@
 # The LearningOnline Network with CAPA
 #
-# $Id: lonstatistics.pm,v 1.84 2003/10/02 17:08:53 matthew Exp $
+# $Id: lonstatistics.pm,v 1.85 2003/10/08 15:32:00 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1036,31 +1036,41 @@
 ##############################################
 ##############################################
 sub CreateMainMenu {
-    my ($status,$reports,$current)=@_;
     #
-    my $Str = '';
+    # Define menu data
+    my @reports = ({ internal_name => 'problem_statistics',
+                     name => &mt('Overall Problem Statistics'),
+                     short_description => 
+    &mt('Student performance statistics on all problems.'),
+                 },
+                   { internal_name => 'problem_analysis',
+                     name => &mt('Detailed Problem Analysis'),
+                     short_description => 
+    &mt('Detailed statistics and graphs of student performance on problems.'),
+                 },
+                   { internal_name => 'student_assessment',
+                     name => &mt('Problem Status Chart'),
+                     short_description => 
+    &mt('Brief view of each students performance in course.'),
+                 },
+                   # 'percentage'  => 'Correct-problems Plot',
+                   # 'activitylog' => 'Activity Log',
+                   );
+
     #
-    $Str  = '<input type="hidden" name="reportSelected" value="'.$current.'">';
-#    $Str .= '<table border="0"><tbody><tr>'."\n";
-#    $Str .= '<td align="center"><b>Report:</b></td>'."\n";
-#    $Str .= '<td align="center">';
-#    $Str .= '<select name="reportSelected" '.
-#        'onchange="document.Statistics.submit()">'."\n";
-#    foreach (sort(keys(%$reports))) {
-#        $Str .= '<option value="'.$_.'"';
-#        if($current eq $_) {
-#            $Str .= ' selected';
-#        }
-#        $Str .= '>'.$reports->{$_}.'</option>'."\n";
-#    }
-#    $Str .= '</select></td>'."\n";
-#    #
-#    $Str .= '<td>'.('&nbsp;'x30).'</td>';
-#    $Str .= '<td align="center">'.
-#        '<input type="submit" name="ClearCache" value="Clear Caches" />'.
-#            "</td>\n";
-#    $Str .= '</tr></tbody></table>'."\n";
-#    $Str .= '<hr>'."\n";
+    # Create the menu
+    my $Str;
+    $Str =  "<h2>".&mt('Statistics and Problem Analysis')."</h2>\n";
+    $Str .= &mt('Please select a report to generate.');
+    $Str .= "<dl>\n";
+    foreach my $reportdata (@reports) {
+        $Str .='    <dt><a href="/adm/statistics?reportSelected='.
+            $reportdata->{'internal_name'}.'" >'.
+            $reportdata->{'name'}."</a></dt>\n";
+        $Str .= '        <dd>'.$reportdata->{'short_description'}.
+            "</dd>\n";
+    }
+    $Str .="</dl>\n";
     #
     return $Str;
 }
@@ -1111,71 +1121,67 @@
     &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
                                             ['sort','reportSelected',
                                              'SelectedStudent']);
-    if (! exists($ENV{'form.reportSelected'})) {
-        $ENV{'form.reportSelected'} = 'student_assessment';
-    }
     #
     # Give the LON-CAPA page header
     $r->print(&Apache::lonhtmlcommon::Title('Course Statistics and Charts'));
     $r->rflush();
+    # 
+    # Either print out a menu for them or send them to a report
+    if (! exists($ENV{'form.reportSelected'}) || 
+        $ENV{'form.reportSelected'} eq '') {
+        $r->print(&CreateMainMenu());
+    } else {
     #
-    if (! &Apache::lonmysql::verify_sql_connection()) {
-        my $serveradmin = $r->dir_config('lonAdmEMail');
-        $r->print(<<END);
-<h2><font color="Red">Unable to connect to database!</font></h2>
-<p>
-Please notify the server administrator <b>$serveradmin</b>.
-</p><p>
-Course Statistics and Charts cannot be retrieved until the database is
-restarted.  Your data is intact but cannot be displayed at this time.
-</p>
-</body>
-</html>
-END
-        return;
-    }
-    #
-    # Clean out the caches
-    if (exists($ENV{'form.ClearCache'})) {
-        &Apache::loncoursedata::delete_caches($ENV{'requres.course.id'});
-    }
-    #
-    # Set up the statistics and chart environment
-    &PrepareClasslist();
-    &PrepareCourseData($r);
-    #
-    # Begin form output
-    $r->print('<form name="Statistics" ');
-    $r->print('method="post" action="/adm/statistics">');
-    #
-    # Print main menu
-    my %reports = ('classlist'          => 'Class list',
-                   'problem_statistics' => 'Problem Statistics',
-                   'student_assessment' => 'Problem Status Chart',
-#                   'percentage'         => 'Correct-problems Plot',
-#                   'option_response'    => 'Option Response Analysis',
-#                   'activitylog'        => 'Activity Log',
-                   );
-    $r->print(&CreateMainMenu($ENV{'form.status'},
-                              \%reports,$ENV{'form.reportSelected'}));
-    $r->rflush();
-    #
-    my $GoToPage = $ENV{'form.reportSelected'};
-    if($GoToPage eq 'activitylog') {
+        if (! &Apache::lonmysql::verify_sql_connection()) {
+            my $serveradmin = $r->dir_config('lonAdmEMail');
+            $r->print('<h2><font color="Red">'.
+                      &mt('Unable to connect to database!').
+                      '</font></h2>');
+            $r->print('<p>'.
+                      &mt('Please notify the server administrator ').
+                      '<b>'.$serveradmin.'</b></p>');
+            $r->print('<p>'.
+                      &mt('Course Statistics and Charts cannot be '.
+                          'retrieved until the database is restarted.  '.
+                          'Your data is intact but cannot be displayed '.
+                          'at this time.').'</p>');
+            $r->print('</body></html>');
+            return;
+        }
+        #
+        # Clean out the caches
+        if (exists($ENV{'form.ClearCache'})) {
+            &Apache::loncoursedata::delete_caches($ENV{'requres.course.id'});
+        }
+        #
+        # Set up the statistics and chart environment
+        &PrepareClasslist();
+        &PrepareCourseData($r);
+        #
+        # Begin form output
+        $r->print('<form name="Statistics" ');
+        $r->print('method="post" action="/adm/statistics">');
+        $r->rflush();
+        #
+        my $GoToPage = $ENV{'form.reportSelected'};
+        $r->print('<input type="hidden" name="reportSelected" value="'.
+                  $GoToPage.'">');
+        if($GoToPage eq 'activitylog') {
 #        &Apache::lonproblemstatistics::Activity();
-    } elsif($GoToPage eq 'problem_statistics') {
-        &Apache::lonproblemstatistics::BuildProblemStatisticsPage($r,$c);
-    } elsif($GoToPage eq 'problem_analysis') {
-        &Apache::lonproblemanalysis::BuildProblemAnalysisPage($r,$c);
-    } elsif($GoToPage eq 'student_assessment') {
-        &Apache::lonstudentassessment::BuildStudentAssessmentPage($r,$c);
-    } elsif($GoToPage eq 'DoDiffGraph' || $GoToPage eq 'PercentWrongGraph') {
+        } elsif($GoToPage eq 'problem_statistics') {
+            &Apache::lonproblemstatistics::BuildProblemStatisticsPage($r,$c);
+        } elsif($GoToPage eq 'problem_analysis') {
+            &Apache::lonproblemanalysis::BuildProblemAnalysisPage($r,$c);
+        } elsif($GoToPage eq 'student_assessment') {
+            &Apache::lonstudentassessment::BuildStudentAssessmentPage($r,$c);
+        } elsif($GoToPage eq 'DoDiffGraph' || $GoToPage eq 'PercentWrongGraph') {
 #        &Apache::lonproblemstatistics::BuildGraphicChart($r,$c);
-    } elsif($GoToPage eq 'Correct-problems Plot') {
-#	&Apache::lonpercentage::BuildPercentageGraph($r,$c);
+        } elsif($GoToPage eq 'Correct-problems Plot') {
+            #	&Apache::lonpercentage::BuildPercentageGraph($r,$c);
+        }
+        #
+        $r->print("</form>\n");
     }
-    #
-    $r->print("</form>\n");
     $r->print("</body>\n</html>\n");
     $r->rflush();
     #
Index: loncom/interface/mydesk.tab
diff -u loncom/interface/mydesk.tab:1.49 loncom/interface/mydesk.tab:1.50
--- loncom/interface/mydesk.tab:1.49	Thu Sep 25 13:26:31 2003
+++ loncom/interface/mydesk.tab	Wed Oct  8 11:32:00 2003
@@ -30,7 +30,7 @@
 4:2:clear
 4:2:pvgr:$crs:chrt.gif:course:chart:gopost('/adm/statistics?reportSelected=student_assessment','Student Assessment');:View the course assessment progress chart
 4:3:clear
-4:3:pvgr:$crs:stat.gif:course:stats:gopost('/adm/statistics?reportSelected=problem_statistics','Problem Statistics');:View course assessment statistics
+4:3:pvgr:$crs:stat.gif:course:stats:gopost('/adm/statistics','Problem Statistics');:View course assessment statistics
 5:1:clear
 5:1:pcst:$crs:enrl.gif:course:enroll:go('/adm/dropadd');:Drop/Add students in this course
 5:1:pmky:$requested_domain:keys.gif:manage:acc keys:go('/adm/managekeys');:Manage Access Keys

--matthew1065627120--