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

raeburn raeburn@source.lon-capa.org
Sun, 12 Sep 2010 17:40:33 -0000


raeburn		Sun Sep 12 17:40:33 2010 EDT

  Modified files:              (Branch: GCI_3)
    /loncom/interface	lonstatistics.pm 
  Log:
  - Customization for GCI_3.
    - "Questionnaire" folder containing GCI question + pilot questions
       is the only folder for which statistics reports are available to
       GCI users.
  
  
Index: loncom/interface/lonstatistics.pm
diff -u loncom/interface/lonstatistics.pm:1.148.2.4 loncom/interface/lonstatistics.pm:1.148.2.5
--- loncom/interface/lonstatistics.pm:1.148.2.4	Sat Sep 11 19:08:19 2010
+++ loncom/interface/lonstatistics.pm	Sun Sep 12 17:40:33 2010
@@ -1,6 +1,6 @@
 # The LearningOnline Network with CAPA
 #
-# $Id: lonstatistics.pm,v 1.148.2.4 2010/09/11 19:08:19 raeburn Exp $
+# $Id: lonstatistics.pm,v 1.148.2.5 2010/09/12 17:40:33 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -456,11 +456,20 @@
         return ('Can not open Coursemap');
     }
     #
-    my @sequences = $navmap->retrieveResources(undef,
+    my $mapurl;
+    if (&Apache::loncommon::needs_gci_custom()) {
+        my $cid = $env{'request.course.id'};
+        if ($cid) {
+            $mapurl = '/uploaded/'.$env{'course.'.$cid.'.domain'}.'/'.$env{'course.'.$cid.'.num'}.'/default_1261144274.sequence';
+        }
+    }
+    my @sequences = $navmap->retrieveResources($mapurl,
                                                sub { shift->is_map(); },1,0,1);
-    my $toplevelseq = $navmap->getById('0.0');
-    if (!grep(/^\Q$toplevelseq\E$/,@sequences)) {
-        unshift(@sequences,$toplevelseq);
+    unless (&Apache::loncommon::needs_gci_custom()) {
+        my $toplevelseq = $navmap->getById('0.0');
+        if (!grep(/^\Q$toplevelseq\E$/,@sequences)) {
+            unshift(@sequences,$toplevelseq);
+        }
     }
 
     my @sequences_with_assessments;
@@ -504,13 +513,15 @@
         $form .= 'multiple="multiple" ';
     }
     $form .= 'size="'.$numvisible.'" >'."\n";
-    #
-    # Put in option for 'all'
-    $form .= '    <option value="all" ';
-    if ($selected_maps[0] eq 'all') {
-        $form .= 'selected ';
+    unless (&Apache::loncommon::needs_gci_custom()) {
+        #
+        # Put in option for 'all'
+        $form .= '    <option value="all" ';
+        if ($selected_maps[0] eq 'all') {
+            $form .= 'selected ';
+        }
+        $form .= ">all</option>\n";
     }
-    $form .= ">all</option>\n";
     #
     # Loop through the sequences
     my @sequences = &selected_sequences_with_assessments('all');
@@ -522,10 +533,14 @@
     }
     foreach my $seq (@sequences){
         $form .= '    <option value="'.$seq->symb.'" ';
-        foreach (@selected_maps) {
-            if ($seq->symb eq $_) {
-                $form .= 'selected ';
-                last;
+        if ((&Apache::loncommon::needs_gci_custom()) && (@selected_maps == 1)) {
+            $form .= 'selected ';
+        } else {
+            foreach (@selected_maps) {
+                if ($seq->symb eq $_) {
+                    $form .= 'selected ';
+                    last;
+                }
             }
         }
         $form .= '>'.$seq->compTitle."</option>\n";