--- loncom/interface/Attic/londropadd.pm 2003/06/20 20:57:44 1.68
+++ loncom/interface/Attic/londropadd.pm 2003/07/03 19:26:20 1.72
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to drop and add students in courses
#
-# $Id: londropadd.pm,v 1.68 2003/06/20 20:57:44 matthew Exp $
+# $Id: londropadd.pm,v 1.72 2003/07/03 19:26:20 matthew Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -79,13 +79,16 @@ sub modifystudent {
# We are in this course
my $section=$1;
$section='' if ($course eq $courseid.'_st');
- if ( ((!$section) && (!$csec)) || ($section ne $csec) ) {
+ if ($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
- ($udom,$unam,'','','','','','','',
+ # dom name id mode pass f m l g
+ ($udom,$unam,'', '', '',undef,undef,undef,undef,
$section,time,undef,undef,$desiredhost);
$result .= $reply.':';
}
@@ -660,6 +663,9 @@ sub make_dates_default {
'default_enrollment_end_date' =>$enddate},$dom,$crs);
if ($put_result eq 'ok') {
$result .= "Set default start and end dates for course
";
+ #
+ # Refresh the course environment
+ &Apache::lonnet::coursedescription($ENV{'request.course.id'});
} else {
$result .= "Unable to set default dates for course:".$put_result.
'
';
@@ -1460,7 +1466,7 @@ sub upfile_drop_add {
#######################################
## Enroll Students ##
#######################################
- $r->print('
'); my $count=0; my $flushc=0; my %student=(); @@ -1489,9 +1495,9 @@ sub upfile_drop_add { } } if ($entries{$fields{'username'}}=~/\W/) { - $r->print('
Unacceptable username: '.
+ $r->print('
Unacceptable username: '.
$entries{$fields{'username'}}.' for user '.
- $fname.' '.$mname.' '.$lname.' '.$gen.'
'); + $fname.' '.$mname.' '.$lname.' '.$gen.''); } else { # determine section number my $sec=''; @@ -1533,9 +1539,9 @@ sub upfile_drop_add { $fname,$mname,$lname,$gen,$sec,$enddate, $startdate,$ENV{'form.forceid'},$desiredhost); if ($reply ne 'ok') { - $r->print('
'. - 'Error enrolling '.$username.': '. - $reply.'
'); + $reply =~ s/^error://; + $r->print('No password for $username
");
+ $r->print('
'.$username.':'.
+ ' Unable to enroll: No password specified.');
}
}
}
} # end of foreach (@studentdata)
- $r->print('
Processed Students: '.$count.'
'); + $r->print('Processed Students: '.$count.'
'); $r->print("If active, the new role will be available when the ". "students next log in to LON-CAPA.
"); #####################################