[LON-CAPA-cvs] cvs: loncom /interface londropadd.pm

droeschl droeschl at source.lon-capa.org
Tue Apr 24 17:05:15 EDT 2012


droeschl		Tue Apr 24 21:05:15 2012 EDT

  Modified files:              
    /loncom/interface	londropadd.pm 
  Log:
  Removed londropadd::modifystudent. It is not used anymore and has been
  superseded by lonuserutils::modifystudent. 
  
  
Index: loncom/interface/londropadd.pm
diff -u loncom/interface/londropadd.pm:1.178 loncom/interface/londropadd.pm:1.179
--- loncom/interface/londropadd.pm:1.178	Wed Feb  4 13:21:48 2009
+++ loncom/interface/londropadd.pm	Tue Apr 24 21:05:15 2012
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to drop and add students in courses 
 #
-# $Id: londropadd.pm,v 1.178 2009/02/04 13:21:48 hauer Exp $
+# $Id: londropadd.pm,v 1.179 2012/04/24 21:05:15 droeschl Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -74,56 +74,6 @@
 
 =pod
 
-=item modifystudent()
-
-    Drop student from all sections of a course, except optional $csec
-
-=cut
-
-sub modifystudent {
-    my ($udom,$unam,$courseid,$csec,$desiredhost)=@_;
-    # if $csec is undefined, drop the student from all the courses matching
-    # this one.  If $csec is defined, drop them from all other sections of 
-    # this course and add them to section $csec
-    my $cdom = $env{'course.'.$courseid.'.domain'};
-    my $cnum = $env{'course.'.$courseid.'.num'};
-    my %roles = &Apache::lonnet::dump('roles',$udom,$unam);
-    my ($tmp) = keys(%roles);
-    # Bail out if we were unable to get the students roles
-    return "$1" if ($tmp =~ /^(con_lost|error|no_such_host)/i);
-    # Go through the roles looking for enrollment in this course
-    my $result = '';
-    foreach my $course (keys(%roles)) {
-        if ($course=~m{^/\Q$cdom\E/\Q$cnum\E(?:\/)*(?:\s+)*(\w+)*\_st$}) {
-            # We are in this course
-            my $section=$1;
-            $section='' if ($course eq "/$cdom/$cnum".'_st');
-            if (defined($csec) && $section eq $csec) {
-                $result .= 'ok:';
-            } elsif ( ((!$section) && (!$csec)) || ($section ne $csec) ) {
-                my (undef,$end,$start)=split(/\_/,$roles{$course});
-                my $now=time;
-                # if this is an active role
-                if (!($start && ($now<$start)) || !($end && ($now>$end))) {
-                    my $reply=&Apache::lonnet::modifystudent
-                        # dom  name  id mode pass     f     m     l     g
-                        ($udom,$unam,'',  '',  '',undef,undef,undef,undef,
-                         $section,time,undef,undef,$desiredhost);
-                    $result .= $reply.':';
-                }
-            }
-        }
-    }
-    if ($result eq '') {
-        $result = 'Unable to find section for this student';
-    } else {
-        $result =~ s/(ok:)+/ok/g;
-    }
-    return $result;
-}
-
-=pod
-
 =item domain_form()
     
     build a domain and server selection form




More information about the LON-CAPA-cvs mailing list