--- loncom/interface/Attic/londropadd.pm 2002/04/26 18:59:00 1.31
+++ loncom/interface/Attic/londropadd.pm 2002/05/06 17:48:57 1.41
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to drop and add students in courses
#
-# $Id: londropadd.pm,v 1.31 2002/04/26 18:59:00 matthew Exp $
+# $Id: londropadd.pm,v 1.41 2002/05/06 17:48:57 matthew Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -62,20 +62,20 @@ sub header {
return(<
-
Drop/Add Students
-
+ + +
+END } # ================================================= Drop/Add from uploaded file @@ -852,11 +995,12 @@ sub upfile_drop_add { } } if ($password) { + &modifystudent($domain,$username,$cid,$sec, + $desiredhost); my $reply=&Apache::lonnet::modifystudent ($domain,$username,$id,$amode,$password, $fname,$mname,$lname,$gen,$sec,$enddate, $startdate,$ENV{'form.forceid'},$desiredhost); - &modifystudent($domain,$username,$cid,$sec); if ($reply ne 'ok') { $r->print(''.
'Error enrolling '.$username.': '.
@@ -912,10 +1056,21 @@ sub upfile_drop_add {
sub drop_student_list {
my $r=shift;
my $count=0;
- foreach (@{$ENV{'form.droplist'}}) {
+ my @droplist;
+ if (ref($ENV{'form.droplist'})) {
+ @droplist = @{$ENV{'form.droplist'}};
+ } else {
+ @droplist = ($ENV{'form.droplist'});
+ }
+ foreach (@droplist) {
my ($uname,$udom)=split(/\:/,$_);
- &modifystudent($udom,$uname,$ENV{'request.course.id'});
- $r->print('Dropped '.$uname.' at '.$udom.'
');
+ my $result = &modifystudent($udom,$uname,$ENV{'request.course.id'});
+ if ($result eq 'ok' || $result eq 'ok:') {
+ $r->print('Dropped '.$uname.' at '.$udom.'
');
+ } else {
+ $r->print('Error dropping '.$uname.' at '.$udom.': '.$result.
+ '
');
+ }
$count++;
}
$r->print('
Dropped '.$count.' student(s).'); @@ -934,9 +1089,9 @@ sub handler { if (($ENV{'request.course.fn'}) && (&Apache::lonnet::allowed('cst',$ENV{'request.course.id'}))) { # Start page - $r->content_type('text/html'); + $r->content_type('text/html') if (! exists($ENV{'form.viewcsv'})); $r->send_http_header; - $r->print(&header()); + $r->print(&header()) if (! exists($ENV{'form.viewcsv'})); # Phase one, initial screen unless ($ENV{'form.phase'}) { &menu_phase_one($r); @@ -957,6 +1112,10 @@ sub handler { &menu_phase_two_enroll($r); } elsif ($ENV{'form.drop'}) { &menu_phase_two_drop($r); + } elsif ($ENV{'form.view'}) { + &menu_phase_two_view($r); + } elsif ($ENV{'form.viewcsv'}) { + &menu_phase_two_viewcsv($r); } } # Phase three @@ -974,7 +1133,7 @@ sub handler { &enroll_single_student($r); } # End - $r->print('