--- loncom/interface/Attic/londropadd.pm 2002/09/18 14:17:47 1.51 +++ loncom/interface/Attic/londropadd.pm 2002/09/24 18:24:43 1.52 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to drop and add students in courses # -# $Id: londropadd.pm,v 1.51 2002/09/18 14:17:47 matthew Exp $ +# $Id: londropadd.pm,v 1.52 2002/09/24 18:24:43 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -773,9 +773,9 @@ END } else { # Print out the available choices if ($ENV{'form.action'} eq 'modifystudent') { - &show_class_list($r,'view','modify',$student_array,$student_data); + &show_class_list($r,'view','modify','any',$student_array,$student_data); } else { - &show_class_list($r,'view','aboutme',$student_array,$student_data); + &show_class_list($r,'view','aboutme','any',$student_array,$student_data); } } } @@ -788,13 +788,13 @@ sub print_csv_classlist { if (! scalar(@$student_array)) { $r->print("There are no students currently enrolled.\n"); } else { - &show_class_list($r,'csv','nolink',$student_array,$student_data); + &show_class_list($r,'csv','nolink','any',$student_array,$student_data); } } # =================================================== Show student list to drop sub show_class_list { - my ($r,$mode,$linkto,$students,$student_data)=@_; + my ($r,$mode,$linkto,$statusmode,$students,$student_data)=@_; my $cid=$ENV{'request.course.id'}; # Print out header if ($mode eq 'view') { @@ -814,13 +814,25 @@ END "section")).'"'."\n"); } foreach my $student (@$students) { + my $error; + if (exists($student_data->{$student.':error'})) { + $error = $student_data->{$student.':error'}; + } + if ($error) { + $r->print('
+Student ID: +
Section:
First name | $firstname |
Start Time | $displayable_starttime |
End Time | $displayable_endtime |
END
- # send request(s) to modify data
- my $roleresults = 'refused';
- #my $roleresults = &Apache::lonnet::assignrole($sdom,$sname,
- # $courseid.'/'.$section,
- # 'st',
- # $endtime,$starttime);
+ # Send request(s) to modify data
+ # The '1' in the call to modifystudent is to force the students
+ # id to be changed.
+ my $roleresults = &Apache::lonnet::modifystudent
+ ($sdom,$sname,$sid,undef,undef,$firstname,$middlename,$lastname,
+ $generation,$section,$endtime,$starttime,1);
if ($roleresults =~/refused/) {
$r->print("Your request to change the role information for this ".
"student was refused.");
} elsif ($roleresults !~ /ok/) {
$r->print("An error occurred during the attempt to change the role".
- " information for this student. The error reported was ".
+ " information for this student.
".
+ "The error reported was ".
$roleresults);
} else { # everything is okay!
- $r->print("Student role updated successfully.");
+ $r->print("Student information updated successfully.
".
+ "The student must log out and log in again to see ".
+ "these changes.");
}
- #
$r->print(<