[LON-CAPA-cvs] cvs: loncom(version_2_11_X) /lonnet/perl lonnet.pm

raeburn raeburn at source.lon-capa.org
Wed Aug 7 22:09:10 EDT 2013


raeburn		Thu Aug  8 02:09:10 2013 EDT

  Modified files:              (Branch: version_2_11_X)
    /loncom/lonnet/perl	lonnet.pm 
  Log:
  - For 2.11
    - Backport 1.1234, 1.1235, 1.1236.
  
  
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.1172.2.30 loncom/lonnet/perl/lonnet.pm:1.1172.2.31
--- loncom/lonnet/perl/lonnet.pm:1.1172.2.30	Sun Aug  4 03:00:12 2013
+++ loncom/lonnet/perl/lonnet.pm	Thu Aug  8 02:09:10 2013
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # TCP networking package
 #
-# $Id: lonnet.pm,v 1.1172.2.30 2013/08/04 03:00:12 raeburn Exp $
+# $Id: lonnet.pm,v 1.1172.2.31 2013/08/08 02:09:10 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2846,6 +2846,13 @@
                     $cfile =~ s{^http://}{};
                     $cfile = '/adm/wrapper/ext/'.$cfile;
                 }
+            } elsif ($resurl =~ m{^/?adm/viewclasslist$}) {
+                if ($env{'form.forceedit'}) {
+                    $forceview = 1;
+                } else {
+                    $forceedit = 1;
+                }
+                $cfile = ($resurl =~ m{^/} ? $resurl : "/$resurl");
             }
         }
         if ($uploaded || $incourse) {
@@ -8478,7 +8485,7 @@
          $desiredhome,$email,$inststatus);
     unless ($reply eq 'ok') { return $reply; }
     # This will cause &modify_student_enrollment to get the uid from the
-    # students environment
+    # student's environment
     $uid = undef if (!$forceid);
     $reply = &modify_student_enrollment($udom,$uname,$uid,$first,$middle,$last,
 					$gene,$usec,$end,$start,$type,$locktype,
@@ -9614,6 +9621,26 @@
     return undef;
 }
 
+sub get_numsuppfiles {
+    my ($cnum,$cdom,$ignorecache)=@_;
+    my $hashid=$cnum.':'.$cdom;
+    my ($suppcount,$cached);
+    unless ($ignorecache) {
+        ($suppcount,$cached) = &is_cached_new('suppcount',$hashid);
+    }
+    unless (defined($cached)) {
+        my $chome=&homeserver($cnum,$cdom);
+        unless ($chome eq 'no_host') {
+            ($suppcount,my $errors) = (0,0);
+            my $suppmap = 'supplemental.sequence';
+            ($suppcount,$errors) =
+                &Apache::loncommon::recurse_supplemental($cnum,$cdom,$suppmap,$suppcount,$errors);
+        }
+        &do_cache_new('suppcount',$hashid,$suppcount,600);
+    }
+    return $suppcount;
+}
+
 #
 # EXT resource caching routines
 #
@@ -12673,8 +12700,8 @@
 modifystudent
 
 modify a student's enrollment and identification information.
-The course id is resolved based on the current users environment.  
-This means the envoking user must be a course coordinator or otherwise
+The course id is resolved based on the current user's environment.  
+This means the invoking user must be a course coordinator or otherwise
 associated with a course.
 
 This call is essentially a wrapper for lonnet::modifyuser and
@@ -12734,20 +12761,20 @@
 
 modify_student_enrollment
 
-Change a students enrollment status in a class.  The environment variable
+Change a student's enrollment status in a class.  The environment variable
 'role.request.course' must be defined for this function to proceed.
 
 Inputs:
 
 =over 4
 
-=item $udom, students domain
+=item $udom, student's domain
 
-=item $uname, students name
+=item $uname, student's name
 
-=item $uid, students user id
+=item $uid, student's user id
 
-=item $first, students first name
+=item $first, student's first name
 
 =item $middle
 
@@ -12829,7 +12856,7 @@
 resdata($name,$domain,$type, at which) : request for current parameter
 setting for a specific $type, where $type is either 'course' or 'user',
 @what should be a list of parameters to ask about. This routine caches
-answers for 5 minutes.
+answers for 10 minutes.
 
 =item *
 
@@ -12838,6 +12865,10 @@
 values that are the resource value.  I believe that the timestamps and
 versions are also returned.
 
+get_numsuppfiles($cnum,$cdom) : retrieve number of files in a course's
+supplemental content area. This routine caches the number of files for
+10 minutes.
+
 =back
 
 =head2 Course Modification




More information about the LON-CAPA-cvs mailing list