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

raeburn raeburn@source.lon-capa.org
Sun, 20 Dec 2009 02:09:00 -0000


raeburn		Sun Dec 20 02:09:00 2009 EDT

  Modified files:              (Branch: GCI_3)
    /loncom/interface	londocs.pm 
  Log:
  - Customization for GCI_3.
    - Additional args for &concept_test_builder().
    - Breadcrumbs for concept test editor.
    - Additional screens: (a) modify open date and due date parameters.
                          (b) result of parameter modification.
  
  
Index: loncom/interface/londocs.pm
diff -u loncom/interface/londocs.pm:1.411.2.2 loncom/interface/londocs.pm:1.411.2.3
--- loncom/interface/londocs.pm:1.411.2.2	Tue Dec  8 04:30:41 2009
+++ loncom/interface/londocs.pm	Sun Dec 20 02:09:00 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Documents
 #
-# $Id: londocs.pm,v 1.411.2.2 2009/12/08 04:30:41 raeburn Exp $
+# $Id: londocs.pm,v 1.411.2.3 2009/12/20 02:09:00 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2621,9 +2621,10 @@
 
     my $coursedom=$env{'course.'.$env{'request.course.id'}.'.domain'};
     if ($coursedom eq 'gcitest') {
+        my $coursenum = $env{'course.'.$env{'request.course.id'}.'.num'};
         my $allowed=&Apache::lonnet::allowed('mdc',$env{'request.course.id'});
         if ($allowed) {
-            &concept_test_builder($r);
+            &concept_test_builder($r,$coursedom,$coursenum);
             return OK;
         }
     }
@@ -3542,15 +3543,49 @@
 }
 
 sub concept_test_builder {
-    my ($r) = @_;
-    $r->print(&Apache::loncommon::start_page('Assemble Test'));
+    my ($r,$cdom,$cnum) = @_;
+    my $js = '
+<script type="text/javascript">
+// <![CDATA[
+'.
+&Apache::londocsgci::builder_javascript().
+'
+// ]]>
+</script>
+';
+    my $starthash = {
+           add_entries => {'onload' => "javascript:setInitialVisibility();"},
+                     };
+
+    $r->print(&Apache::loncommon::start_page('Assemble Test',$js,$starthash));
+    &Apache::lonhtmlcommon::clear_breadcrumbs();
+    &Apache::lonhtmlcommon::add_breadcrumb
+            ({href=>'/adm/coursedocs',
+              text=>"Assemble Test"});
     &Apache::londocsgci::setdefaults();
     if ($env{'form.phase'} eq 'storemap') {
-          &Apache::londocsgci::evaluate();
-          &Apache::londocsgci::store($r);
+        &Apache::lonhtmlcommon::add_breadcrumb
+            ({href=>'/adm/coursedocs?phase=storemap',
+              text=>"Validate Test"});
+        &Apache::londocsgci::evaluate();
+        $r->print(&Apache::lonhtmlcommon::breadcrumbs
+                  ('Build Concept Test','Concept_Test_Assembly'));
+        $r->print(&Apache::londocsgci::store('edit',$cdom,$cnum));
+    } elsif ($env{'form.phase'} eq 'storeparms') {
+        &Apache::lonhtmlcommon::add_breadcrumb
+            ({href=>'/adm/coursedocs?phase=storeparms',
+              text=>"Set Availability"});
+        $r->print(&Apache::lonhtmlcommon::breadcrumbs
+                  ('Build Concept Test','Concept_Test_Assembly'));
+        $r->print(&Apache::londocsgci::store_dates_parms($cdom,$cnum));
+        $r->print(&Apache::loncommon::end_page());
+        return;
+    } else {
+        $r->print(&Apache::lonhtmlcommon::breadcrumbs
+                  ('Build Concept Test','Concept_Test_Assembly'));
     }
     &Apache::londocsgci::load();
-    &Apache::londocsgci::listresources($r);
+    &Apache::londocsgci::listresources($r,'edit',$cdom,$cnum);
     $r->print(&Apache::loncommon::end_page());
     return;
 }