version 1.6, 2000/12/28 19:56:31
|
version 1.9, 2001/01/15 14:51:18
|
Line 14
|
Line 14
|
# 11/20,11/21,11/22,11/23,11/24,11/25,11/27,11/28, |
# 11/20,11/21,11/22,11/23,11/24,11/25,11/27,11/28, |
# 12/08,12/12 Gerd Kortemeyer) |
# 12/08,12/12 Gerd Kortemeyer) |
# |
# |
# 12/26,12/27,12/28 Gerd Kortemeyer |
# 12/26,12/27,12/28, |
|
# 01/01/01,01/15 Gerd Kortemeyer |
|
|
package Apache::londropadd; |
package Apache::londropadd; |
|
|
Line 79 ENDUPFORM
|
Line 80 ENDUPFORM
|
# ------------------------------------------------------------------- Phase two |
# ------------------------------------------------------------------- Phase two |
if ($ENV{'form.phase'} eq 'two') { |
if ($ENV{'form.phase'} eq 'two') { |
if ($ENV{'form.fileupload'}) { |
if ($ENV{'form.fileupload'}) { |
|
$ENV{'form.upfile'}=~s/\r/\n/gs; |
|
$ENV{'form.upfile'}=~s/\f/\n/gs; |
|
$ENV{'form.upfile'}=~s/\n+/\n/gs; |
my $datatoken=$ENV{'user.name'}.'_'.$ENV{'user.domain'}. |
my $datatoken=$ENV{'user.name'}.'_'.$ENV{'user.domain'}. |
'_enroll_'.$ENV{'request.course.id'}.'_'.time.'_'.$$; |
'_enroll_'.$ENV{'request.course.id'}.'_'.time.'_'.$$; |
{ |
{ |
Line 392 ENDPICK
|
Line 396 ENDPICK
|
} |
} |
unless (($domain=~/\W/) || ($amode eq '')) { |
unless (($domain=~/\W/) || ($amode eq '')) { |
$r->print('<h3>Enrolling Students</h3>'); |
$r->print('<h3>Enrolling Students</h3>'); |
my $count=1; |
my $count=0; |
|
my $flushc=0; |
|
my %student=(); |
# ----------------------------------------------------------- Get new classlist |
# ----------------------------------------------------------- Get new classlist |
my @studentdata=(); |
my @studentdata=(); |
{ |
{ |
Line 466 ENDPICK
|
Line 472 ENDPICK
|
$r->print( |
$r->print( |
"<p><b>Error enrolling $username: $reply</b><p>"); |
"<p><b>Error enrolling $username: $reply</b><p>"); |
} else { |
} else { |
|
$count++; $flushc++; |
|
$student{$username}=1; |
$r->print('. '); |
$r->print('. '); |
|
if ($flushc>15) { |
|
$r->rflush; |
|
$flushc=0; |
|
} |
} |
} |
} else { |
} else { |
$r->print( |
$r->print( |
Line 475 ENDPICK
|
Line 487 ENDPICK
|
} |
} |
} |
} |
} @studentdata; |
} @studentdata; |
|
$r->print('<p>Processed Students: '.$count); |
# --------------------------------------------------------------- Drop students |
# --------------------------------------------------------------- Drop students |
if ($ENV{'form.fullup'} eq 'yes') { |
if ($ENV{'form.fullup'} eq 'yes') { |
$r->print('<h3>Dropping Students</h3>'); |
$r->print('<h3>Dropping Students</h3>'); |
Line 487 ENDPICK
|
Line 500 ENDPICK
|
my %currentlist=(); |
my %currentlist=(); |
my $now=time; |
my $now=time; |
unless ($classlst=~/^error\:/) { |
unless ($classlst=~/^error\:/) { |
|
map { |
|
my ($name,$value)=split(/\=/,$_); |
|
my ($end,$start)=split(/\:/, |
|
&Apache::lonnet::unescape($value)); |
|
my $active=1; |
|
if (($end) && ($now>$end)) { $active=0; } |
|
if ($active) { |
|
$currentlist{&Apache::lonnet::unescape($name)}=1; |
|
} |
|
} split(/\&/,$classlst); |
|
|
} else { |
} else { |
$r->print( |
$r->print( |
'<font color=red><h3>Could not access classlist: '.$classlst. |
'<font color=red><h3>Could not access classlist: '.$classlst. |