version 1.53, 2002/09/25 16:16:19
|
version 1.54, 2002/09/26 13:29:44
|
Line 558 sub print_upload_manager_form {
|
Line 558 sub print_upload_manager_form {
|
sub enroll_single_student { |
sub enroll_single_student { |
my $r=shift; |
my $r=shift; |
$r->print('<h3>Enrolling Student</h3>'); |
$r->print('<h3>Enrolling Student</h3>'); |
$r->print('<p>Enrolling '.$ENV{'form.cuname'}." in domain ". |
$r->print('<p>Enrolling '.$ENV{'form.cuname'}." \@ ". |
$ENV{'form.lcdomain'}.'</p>'); |
$ENV{'form.lcdomain'}.'</p>'); |
if (($ENV{'form.cuname'})&&($ENV{'form.cuname'}!~/\W/)&& |
if (($ENV{'form.cuname'})&&($ENV{'form.cuname'}!~/\W/)&& |
($ENV{'form.lcdomain'})&&($ENV{'form.lcdomain'}!~/\W/)) { |
($ENV{'form.lcdomain'})&&($ENV{'form.lcdomain'}!~/\W/)) { |
Line 790 sub print_csv_classlist {
|
Line 790 sub print_csv_classlist {
|
if (! scalar(@$student_array)) { |
if (! scalar(@$student_array)) { |
$r->print("There are no students currently enrolled.\n"); |
$r->print("There are no students currently enrolled.\n"); |
} else { |
} else { |
&show_class_list($r,'csv','nolink','any',$student_array,$student_data); |
&show_class_list($r,'csv','nolink','csv', |
|
'any',$student_array,$student_data); |
} |
} |
} |
} |
|
|
Line 1131 sub get_enrollment_data {
|
Line 1132 sub get_enrollment_data {
|
sub show_drop_list { |
sub show_drop_list { |
my ($students,$s_data,$r)=@_; |
my ($students,$s_data,$r)=@_; |
my $cid=$ENV{'request.course.id'}; |
my $cid=$ENV{'request.course.id'}; |
$r->print(<<'END'); |
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, |
<input type="hidden" name="action" value="drop" /> |
['sortby']); |
|
my $sortby = $ENV{'form.sortby'}; |
|
if ($sortby !~ /^(username|domain|section|fullname|id)$/) { |
|
$sortby = 'username'; |
|
} |
|
my $action = "drop"; |
|
$r->print(<<END); |
|
<input type="hidden" name="sortby" value="$sortby" /> |
|
<input type="hidden" name="action" value="$action" /> |
<input type="hidden" name="state" value="done" /> |
<input type="hidden" name="state" value="done" /> |
<script> |
<script> |
function checkAll(field) { |
function checkAll(field) { |
Line 1148 function uncheckAll(field) {
|
Line 1157 function uncheckAll(field) {
|
<p> |
<p> |
<input type="hidden" name="phase" value="four"> |
<input type="hidden" name="phase" value="four"> |
<table border=2> |
<table border=2> |
<tr><th> </th><th>username</th><th>domain</th> |
<tr><th> </th> |
<th>ID</th><th>student name</th><th>section</th></tr> |
<th> |
|
<a href="/adm/dropadd?action=$action&sortby=username">username</a> |
|
</th><th> |
|
<a href="/adm/dropadd?action=$action&sortby=domain">domain</a> |
|
</th><th> |
|
<a href="/adm/dropadd?action=$action&sortby=id">ID</a> |
|
</th><th> |
|
<a href="/adm/dropadd?action=$action&sortby=fullname">student name</a> |
|
</th><th> |
|
<a href="/adm/dropadd?action=$action&sortby=section">section</a> |
|
</th> |
|
</tr> |
END |
END |
foreach my $student (@$students) { |
my @Sorted_Students = sort { |
|
lc($s_data->{$a.':'.$sortby}) cmp lc($s_data->{$b.':'.$sortby}) |
|
|| |
|
lc($s_data->{$a.':username'}) cmp lc($s_data->{$b.':username'}) |
|
|| |
|
lc($s_data->{$a.':domain'}) cmp lc($s_data->{$b.':domain'}) |
|
} @$students; |
|
foreach my $student (@Sorted_Students) { |
my $error; |
my $error; |
if (exists($s_data->{$student.':error'})) { |
if (exists($s_data->{$student.':error'})) { |
$error = $s_data->{$student.':error'}; |
$error = $s_data->{$student.':error'}; |
Line 1445 sub drop_student_list {
|
Line 1472 sub drop_student_list {
|
my ($uname,$udom)=split(/\:/,$_); |
my ($uname,$udom)=split(/\:/,$_); |
my $result = &modifystudent($udom,$uname,$ENV{'request.course.id'}); |
my $result = &modifystudent($udom,$uname,$ENV{'request.course.id'}); |
if ($result eq 'ok' || $result eq 'ok:') { |
if ($result eq 'ok' || $result eq 'ok:') { |
$r->print('Dropped '.$uname.' at '.$udom.'<br>'); |
$r->print('Dropped '.$uname.' @ '.$udom.'<br>'); |
} else { |
} else { |
$r->print('Error dropping '.$uname.' at '.$udom.': '.$result. |
$r->print('Error dropping '.$uname.' @ '.$udom.': '.$result. |
'<br />'); |
'<br />'); |
} |
} |
$count++; |
$count++; |