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

raeburn raeburn@source.lon-capa.org
Mon, 07 Dec 2009 02:22:24 -0000


raeburn		Mon Dec  7 02:22:24 2009 EDT

  Modified files:              (Branch: GCI_3)
    /loncom/interface	londocs.pm 
  Log:
  - Customization for GCI_3. (same change as in 1.325.4.2 for GCI_2).
     - If course domain is gcitest and user has mdc priv in course use Concept Test
       Building interface in place of standard course editor.
  
  
Index: loncom/interface/londocs.pm
diff -u loncom/interface/londocs.pm:1.411 loncom/interface/londocs.pm:1.411.2.1
--- loncom/interface/londocs.pm:1.411	Wed Dec  2 18:33:27 2009
+++ loncom/interface/londocs.pm	Mon Dec  7 02:22:24 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Documents
 #
-# $Id: londocs.pm,v 1.411 2009/12/02 18:33:27 bisitz Exp $
+# $Id: londocs.pm,v 1.411.2.1 2009/12/07 02:22:24 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2618,6 +2618,14 @@
     return OK if $r->header_only;
     my $crstype = &Apache::loncommon::course_type();
 
+    my $coursedom=$env{'course.'.$env{'request.course.id'}.'.domain'};
+    if ($coursedom eq 'gcitest') {
+        my $allowed=&Apache::lonnet::allowed('mdc',$env{'request.course.id'});
+        if ($allowed) {
+            &concept_test_builder($r);
+            return OK;
+        }
+    }
 
 # --------------------------------------------- Initialize help topics for this
     foreach my $topic ('Adding_Course_Doc','Main_Course_Documents',
@@ -3532,6 +3540,20 @@
     return $form;
 }
 
+sub concept_test_builder {
+    my ($r) = @_;
+    $r->print(&Apache::loncommon::start_page('Assemble Test'));
+    &Apache::londocsgci::setdefaults();
+    if ($env{'form.phase'} eq 'storemap') {
+          &Apache::londocsgci::evaluate();
+          &Apache::londocsgci::store($r);
+    }
+    &Apache::londocsgci::load();
+    &Apache::londocsgci::listresources($r);
+    $r->print(&Apache::loncommon::end_page());
+    return;
+}
+
 sub editing_js {
     my ($udom,$uname) = @_;
     my $now = time();