--- loncom/interface/Attic/londropadd.pm 2008/11/18 19:14:22 1.176 +++ loncom/interface/Attic/londropadd.pm 2012/04/24 21:05:15 1.179 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to drop and add students in courses # -# $Id: londropadd.pm,v 1.176 2008/11/18 19:14:22 jms Exp $ +# $Id: londropadd.pm,v 1.179 2012/04/24 21:05:15 droeschl Exp $ # # Copyright Michigan State University Board of Trustees # @@ -74,56 +74,6 @@ ENDHEAD =pod -=item modifystudent() - - Drop student from all sections of a course, except optional $csec - -=cut - -sub modifystudent { - my ($udom,$unam,$courseid,$csec,$desiredhost)=@_; - # if $csec is undefined, drop the student from all the courses matching - # this one. If $csec is defined, drop them from all other sections of - # this course and add them to section $csec - my $cdom = $env{'course.'.$courseid.'.domain'}; - my $cnum = $env{'course.'.$courseid.'.num'}; - my %roles = &Apache::lonnet::dump('roles',$udom,$unam); - my ($tmp) = keys(%roles); - # Bail out if we were unable to get the students roles - return "$1" if ($tmp =~ /^(con_lost|error|no_such_host)/i); - # Go through the roles looking for enrollment in this course - my $result = ''; - foreach my $course (keys(%roles)) { - if ($course=~m{^/\Q$cdom\E/\Q$cnum\E(?:\/)*(?:\s+)*(\w+)*\_st$}) { - # We are in this course - my $section=$1; - $section='' if ($course eq "/$cdom/$cnum".'_st'); - if (defined($csec) && $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 - # dom name id mode pass f m l g - ($udom,$unam,'', '', '',undef,undef,undef,undef, - $section,time,undef,undef,$desiredhost); - $result .= $reply.':'; - } - } - } - } - if ($result eq '') { - $result = 'Unable to find section for this student'; - } else { - $result =~ s/(ok:)+/ok/g; - } - return $result; -} - -=pod - =item domain_form() build a domain and server selection form @@ -356,7 +306,7 @@ sub javascript_validations { name => 'The optional name field was not specified.', snum => 'The optional student number field was not specified.', section => 'The optional section field was not specified.', - email => 'The optional email address field was not specified.', + email => 'The optional e-mail address field was not specified.', continue => 'Continue enrollment?', ); @@ -764,7 +714,7 @@ sub print_upload_manager_form { ['id', &mt('ID/Student Number'),$env{'form.id_choice'}], ['sec', &mt('Section'), $env{'form.sec_choice'}], ['ipwd', &mt('Initial Password'),$env{'form.ipwd_choice'}], - ['email',&mt('EMail Address'), $env{'form.email_choice'}]); + ['email',&mt('E-mail Address'), $env{'form.email_choice'}]); if ($env{'form.upfile_associate'} eq 'reverse') { &Apache::loncommon::csv_print_samples($r,\@records); $i=&Apache::loncommon::csv_print_select_table($r,\@records, @@ -1141,7 +1091,7 @@ sub print_enroll_single_student_form { 'hs' => "Home Server", 'pswd' => "Login Data", 'psam' => "Please select an authentication mechanism", - 'mail' => "Email Address" + 'mail' => "E-mail Address" ); my $authhelp=&Apache::loncommon::help_open_topic('Auth_Options'); $user_data_html = < "Middle Name", 'ln' => "Last Name", 'gen' => "Generation", - 'mail' => "Email Address", + 'mail' => "E-mail Address", ); $user_data_html = <$lt{'udf'} $ccuname:$ccdomain @@ -1475,7 +1425,7 @@ END 'start' => "start date", 'end' => "end date", 'type' => "enroll type/action", - 'email' => "email address", + 'email' => "e-mail address", 'clicker'=> "clicker id", 'photo' => "photo", ); @@ -2625,7 +2575,7 @@ sub upfile_drop_add { } } } # end of foreach (@studentdata) - $r->print("

\n

\n".&mt('Processed [_1] student(s).',$count). + $r->print("

\n

\n".&mt('Processed [quant,_1,student].',$count). "

\n"); $r->print("

\n". &mt('If active, the new role will be available when the '. @@ -2676,7 +2626,7 @@ sub drop_student_list { '
'); } } - $r->print('

'.&mt('Dropped [_1] student(s).',$count).'

'); + $r->print('

'.&mt('Dropped [quant,_1,student].',$count).'

'); $r->print('

'.&mt('Re-enrollment will re-activate data.')) if ($count); }