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

raeburn raeburn@source.lon-capa.org
Thu, 24 Sep 2009 22:15:27 -0000


raeburn		Thu Sep 24 22:15:27 2009 EDT

  Modified files:              (Branch: GCI_2)
    /loncom/interface	londocs.pm 
  Log:
  - Customization 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.325.4.1 loncom/interface/londocs.pm:1.325.4.2
--- loncom/interface/londocs.pm:1.325.4.1	Thu Sep 24 22:04:40 2009
+++ loncom/interface/londocs.pm	Thu Sep 24 22:15:27 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Documents
 #
-# $Id: londocs.pm,v 1.325.4.1 2009/09/24 22:04:40 raeburn Exp $
+# $Id: londocs.pm,v 1.325.4.2 2009/09/24 22:15:27 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -44,6 +44,7 @@
 use GDBM_File;
 use Apache::lonlocal;
 use Cwd;
+use Apache::londocsgci();
 use LONCAPA qw(:DEFAULT :match);
 
 my $iconpath;
@@ -2523,6 +2524,15 @@
     return OK if $r->header_only;
     my $type = &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',
 	               'Adding_External_Resource','Navigate_Content',
@@ -3214,8 +3224,21 @@
  }
  $r->print(&Apache::loncommon::end_page());
  return OK;
-} 
+}
 
+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) = @_;