[LON-CAPA-cvs] cvs: loncom /interface/statistics lonstudentsubmissions.pm

raeburn raeburn@source.lon-capa.org
Tue, 24 Aug 2010 14:05:19 -0000


raeburn		Tue Aug 24 14:05:19 2010 EDT

  Modified files:              
    /loncom/interface/statistics	lonstudentsubmissions.pm 
  Log:
  - Bug 6119.
   Must exceed threshold for number of responders to anonymous survey items 
   before displaying anonymized submission data.
  - Fix typo.
  - Missing &mt(). 
  
  
Index: loncom/interface/statistics/lonstudentsubmissions.pm
diff -u loncom/interface/statistics/lonstudentsubmissions.pm:1.60 loncom/interface/statistics/lonstudentsubmissions.pm:1.61
--- loncom/interface/statistics/lonstudentsubmissions.pm:1.60	Wed Aug  4 01:56:07 2010
+++ loncom/interface/statistics/lonstudentsubmissions.pm	Tue Aug 24 14:05:19 2010
@@ -1,6 +1,6 @@
 # The LearningOnline Network with CAPA
 #
-# $Id: lonstudentsubmissions.pm,v 1.60 2010/08/04 01:56:07 raeburn Exp $
+# $Id: lonstudentsubmissions.pm,v 1.61 2010/08/24 14:05:19 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -177,11 +177,28 @@
             &array_shuffle(\@Students);
         }
         #
+
+        my $threshold = $env{'course.'.$env{'request.course.id'}.'.internal.anonsurvey_threshold'};
+        if ($threshold eq '') {
+            my %domconfig =
+                &Apache::lonnet::get_dom('configuration',['coursedefaults'],
+                                        $env{'course.'.$env{'request.course.id'}.'.domain'});
+            if (ref($domconfig{'coursedefaults'}) eq 'HASH') {
+                $threshold = $domconfig{'coursedefaults'}{'anonsurvey_threshold'};
+                if ($threshold eq '') {
+                    $threshold = 10;
+                }
+            } else {
+                $threshold = 10;
+            }
+        }
         $r->print('<h4>'.
                   &Apache::lonstatistics::section_and_enrollment_description().
                   '</h4>');
         if (! scalar(@Problems) || ! defined($Problems[0])) {
-            $r->print('resource is undefined');
+            $r->print(&mt('resource is undefined'));
+        } elsif (!$show_named && @Students < $threshold) {
+            $r->print(&mt('The number of students matching the selection criteria is too few for display of submission data for anonymous surveys.').'<br />'.&mt('There must be at least [quant,_1,student].',$threshold).' '.&mt('Contact a Domain Coordinator if you need the threshold to be changed for this course.'));
         } else {
             if (scalar(@Problems) == 1) {
                 my $resource = $Problems[0];
@@ -206,7 +223,7 @@
                   &mt('Prepare Report').'" />');
         $r->print('&nbsp;'x5);
         $r->print('<p>'.
-                  &mt('Computing correct answers greatly increasese the amount of time required to prepare a report.').
+                  &mt('Computing correct answers greatly increases the amount of time required to prepare a report.').
                   '</p>');
         $r->print('<p>'.
                   &mt('Please select problems and use the [_1]Prepare Report[_2] button to continue.','<b>','</b>').