[LON-CAPA-cvs] cvs: loncom(GCI_3) /auth lonroles.pm /interface loncoursequeueadmin.pm lonmenu.pm /lonnet/perl lonnet.pm

raeburn raeburn@source.lon-capa.org
Fri, 03 Sep 2010 19:20:55 -0000


raeburn		Fri Sep  3 19:20:55 2010 EDT

  Modified files:              (Branch: GCI_3)
    /loncom/interface	loncoursequeueadmin.pm lonmenu.pm 
    /loncom/auth	lonroles.pm 
    /loncom/lonnet/perl	lonnet.pm 
  Log:
  - Customization for GCI_3.
    - Add a new "Tutorials" tab to provide access to a GCI "course" containing video tutorials.
  
  
Index: loncom/interface/loncoursequeueadmin.pm
diff -u loncom/interface/loncoursequeueadmin.pm:1.12.2.8 loncom/interface/loncoursequeueadmin.pm:1.12.2.9
--- loncom/interface/loncoursequeueadmin.pm:1.12.2.8	Fri Feb 26 23:39:01 2010
+++ loncom/interface/loncoursequeueadmin.pm	Fri Sep  3 19:20:47 2010
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Utilities to administer domain course requests and course self-enroll requests 
 #
-# $Id: loncoursequeueadmin.pm,v 1.12.2.8 2010/02/26 23:39:01 raeburn Exp $
+# $Id: loncoursequeueadmin.pm,v 1.12.2.9 2010/09/03 19:20:47 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -466,8 +466,10 @@
             if ($uhome ne 'no_host') {
                 if (exists($requesthash{$uname.':'.$udom})) {
                     if ($cdom eq 'gci' && $cnum eq '9615072b469884921gcil1') {
-                        my $enresult = &enable_gci_submission($udom,$uname,
-                                                   $access_end,$access_start);
+                        foreach my $crs ('1H96711d710194bfegcil1','5422913620b814c90gcil1') {
+                            my $enresult = &enable_additional_roles($cdom,$crs,$udom,$uname,
+                                                                    $access_end,$access_start);
+                        }
                     }
                     if (exists($classlist->{$uname.':'.$udom})) {
                         if (ref($classlist->{$uname.':'.$udom}) eq 'ARRAY') {
@@ -917,10 +919,8 @@
     return $output;
 }
 
-sub enable_gci_submission {
-    my ($udom,$uname,$access_end,$access_start) = @_;
-    my $cdom = 'gci';
-    my $cnum = '1H96711d710194bfegcil1';
+sub enable_additional_roles {
+    my ($cdom,$cnum,$udom,$uname,$access_end,$access_start) = @_;
     my ($stucounts,$idx,$classlist) = &get_student_counts($cdom,$cnum);
     if (exists($classlist->{$uname.':'.$udom})) {
         if (ref($classlist->{$uname.':'.$udom}) eq 'ARRAY') {
Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.309.2.14 loncom/interface/lonmenu.pm:1.309.2.15
--- loncom/interface/lonmenu.pm:1.309.2.14	Mon Aug  9 23:39:43 2010
+++ loncom/interface/lonmenu.pm	Fri Sep  3 19:20:47 2010
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines to control the menu
 #
-# $Id: lonmenu.pm,v 1.309.2.14 2010/08/09 23:39:43 raeburn Exp $
+# $Id: lonmenu.pm,v 1.309.2.15 2010/09/03 19:20:47 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -287,11 +287,13 @@
     my %courses = (
         'review' => 'gci_9615072b469884921gcil1',
         'submit' => 'gci_1H96711d710194bfegcil1',
+        'tutorial' => 'gci_5422913620b814c90gcil1',
     );
     my %linktext = (
         'review'      => 'Review Questions',
         'submit'      => 'Submit Questions',
         'managetest'  => 'Manage Tests',
+        'tutorial'    => 'Tutorials',
     );
     my %links = (
                   'managetest' => '/adm/menu',
@@ -308,7 +310,7 @@
             $links{'managetest'} = '/adm/roles?selectrole=1&cm=1&orgurl=%2fadm%2fmenu';
         }
     }
-    my @menutabs = ('review','submit','managetest');
+    my @menutabs = ('review','submit','managetest','tutorial');
     my $tabs;
     foreach my $item (@menutabs) {
         if ($item eq $current) {
@@ -1796,6 +1798,10 @@
     if (caller == 'managetest') {
         document.location.href = '$managetesturl';
     }
+    if (caller == 'tutorial') {
+        document.location.href = '/adm/roles?selectrole=1&st./gci/5422913620b814c90gcil1=1';
+    }
+
     return;
 }
 
Index: loncom/auth/lonroles.pm
diff -u loncom/auth/lonroles.pm:1.240.2.15 loncom/auth/lonroles.pm:1.240.2.16
--- loncom/auth/lonroles.pm:1.240.2.15	Mon Aug  9 23:39:59 2010
+++ loncom/auth/lonroles.pm	Fri Sep  3 19:20:51 2010
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # User Roles Screen
 #
-# $Id: lonroles.pm,v 1.240.2.15 2010/08/09 23:39:59 raeburn Exp $
+# $Id: lonroles.pm,v 1.240.2.16 2010/09/03 19:20:51 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -972,6 +972,7 @@
 <li>Review and comment on existing GCI questions</li>
 <li>Submit a GCI question of your own</li>
 <li>Create an online test for your students</li>
+<li>View tutorials on creating online tests</li>
 </ul>
 </p>
 <p>For more information about writing and reviewing Concept Inventory questions
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.1048.2.3 loncom/lonnet/perl/lonnet.pm:1.1048.2.4
--- loncom/lonnet/perl/lonnet.pm:1.1048.2.3	Fri Feb 26 23:11:33 2010
+++ loncom/lonnet/perl/lonnet.pm	Fri Sep  3 19:20:54 2010
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # TCP networking package
 #
-# $Id: lonnet.pm,v 1.1048.2.3 2010/02/26 23:11:33 raeburn Exp $
+# $Id: lonnet.pm,v 1.1048.2.4 2010/09/03 19:20:54 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -6312,7 +6312,7 @@
                     }
                 } elsif (($selfenroll == 1) && ($role eq 'st') && ($udom eq $env{'user.domain'}) && ($uname eq $env{'user.name'})) {
                     $refused = '';
-                } elsif (($selfenroll == 1) && ($role eq 'st') && ($cdom eq 'gci') && ($cnum eq '1H96711d710194bfegcil1')) {
+                } elsif (($selfenroll == 1) && ($role eq 'st') && ($cdom eq 'gci') && (($cnum eq '1H96711d710194bfegcil1') || ($cnum eq '5422913620b814c90gcil1'))) {
                     if ($env{'request.role'} eq 'cc./gci/9615072b469884921gcil1') {
                         $refused = '';
                     }