--- loncom/interface/Attic/londropadd.pm 2007/10/22 22:16:38 1.173
+++ loncom/interface/Attic/londropadd.pm 2009/02/04 13:21:48 1.178
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to drop and add students in courses
#
-# $Id: londropadd.pm,v 1.173 2007/10/22 22:16:38 raeburn Exp $
+# $Id: londropadd.pm,v 1.178 2009/02/04 13:21:48 hauer Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -26,8 +26,23 @@
# http://www.lon-capa.org/
#
#
-###############################################################
-##############################################################
+
+=head1 NAME
+
+Apache::londropadd.pm
+
+=head1 SYNOPSIS
+
+drop & add students
+
+This is part of the LearningOnline Network with CAPA project
+described at http://www.lon-capa.org.
+
+=head1 SUBROUTINES
+
+=over
+
+=cut
package Apache::londropadd;
@@ -42,8 +57,6 @@ use Apache::lonlocal;
use Apache::longroup;
use LONCAPA();
-###############################################################
-###############################################################
sub header {
my ($jscript,$loaditems) = @_;
my $start_page;
@@ -59,9 +72,14 @@ $start_page
ENDHEAD
}
-###############################################################
-###############################################################
-# Drop student from all sections of a course, except optional $csec
+=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
@@ -104,9 +122,14 @@ sub modifystudent {
return $result;
}
-###############################################################
-###############################################################
-# build a domain and server selection form
+=pod
+
+=item domain_form()
+
+ build a domain and server selection form
+
+=cut
+
sub domain_form {
my ($defdom) = @_;
# Set up domain and server selection forms
@@ -135,9 +158,14 @@ sub domain_form {
return $result;
}
-###############################################################
-###############################################################
-# Menu Phase One
+=pod
+
+=item print_main_menu()
+
+ Menu Phase One
+
+=cut
+
sub print_main_menu {
my ($r,$permission)=@_;
#
@@ -224,13 +252,15 @@ sub print_main_menu {
return;
}
-###############################################################
-###############################################################
+
+
sub hidden_input {
my ($name,$value) = @_;
return ''."\n";
}
+
+
sub print_upload_manager_header {
my ($r,$datatoken,$distotal,$krbdefdom)=@_;
my $javascript;
@@ -291,8 +321,10 @@ sub print_upload_manager_header {
$javascript."\n".$javascript_validations.'');
}
-###############################################################
-###############################################################
+
+
+
+
sub javascript_validations {
my ($mode,$krbdefdom,$curr_authtype,$curr_authfield,$domain)=@_;
my $authheader;
@@ -324,7 +356,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?',
);
@@ -471,8 +503,9 @@ END
return $result;
}
-###############################################################
-###############################################################
+
+
+
sub upload_manager_javascript_forward_associate {
return(<".&mt('Drop Students')."
");
@@ -1264,7 +1314,15 @@ sub print_drop_menu {
return;
}
-# ============================================== view classlist
+
+=pod
+
+=item print_html_classlist()
+
+ view classlist
+
+=cut
+
sub print_html_classlist {
my ($r,$mode,$permission) = @_;
if (! exists($env{'form.sortby'})) {
@@ -1354,7 +1412,15 @@ sub print_html_classlist {
}
}
-# =================================================== Show student list to drop
+
+=pod
+
+=item show_class_list()
+
+ Show student list to drop
+
+=cut
+
sub show_class_list {
my ($r,$mode,$linkto,$statusmode,$classlist,$keylist)=@_;
my $cid=$env{'request.course.id'};
@@ -1409,7 +1475,7 @@ END
'start' => "start date",
'end' => "end date",
'type' => "enroll type/action",
- 'email' => "email address",
+ 'email' => "e-mail address",
'clicker'=> "clicker id",
'photo' => "photo",
);
@@ -1512,9 +1578,9 @@ END
time.'_'.rand(1000000000).'.csv';
unless ($CSVfile = Apache::File->new('>/home/httpd'.$CSVfilename)) {
$r->log_error("Couldn't open $CSVfilename for output $!");
- $r->print("Problems occured in writing the csv file. ".
- "This error has been logged. ".
- "Please alert your LON-CAPA administrator.");
+ $r->print(&mt('Problems occurred in writing the csv file. '
+ .'This error has been logged. '
+ .'Please alert your LON-CAPA administrator.'));
$CSVfile = undef;
}
#
@@ -1756,9 +1822,14 @@ END
}
-#
-# print out form for modification of a single students data
-#
+=pod
+
+=item print_modify_student_form()
+
+ print out form for modification of a single students data
+
+=cut
+
sub print_modify_student_form {
my $r = shift();
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
@@ -1887,9 +1958,15 @@ END
return;
}
-#
-# modify a single students section
-#
+
+=pod
+
+=item modify_single_student()
+
+ modify a single students section
+
+=cut
+
sub modify_single_student {
my ($r) = @_;
#
@@ -2051,7 +2128,7 @@ END
$env{'request.course.id'},
$section,undef);
if ($modify_section_results !~ /^ok/) {
- $r->print(&mt('An error occured during the attempt to change the section for this student.')."
");
+ $r->print(&mt('An error occurred during the attempt to change the section for this student.')."
");
}
my $roleresults = &Apache::lonnet::modifystudent
($sdom,$slogin,$sid,undef,undef,$firstname,$middlename,$lastname,
@@ -2119,12 +2196,10 @@ sub get_enrollment_data {
return ($start,$end,$section);
}
-#################################################
-#################################################
=pod
-=item show_drop_list
+=item show_drop_list()
Display a list of students to drop
Inputs:
@@ -2144,8 +2219,6 @@ which describes the order elements are s
=cut
-#################################################
-#################################################
sub show_drop_list {
my ($r,$classlist,$keylist,$nosort)=@_;
my $cid=$env{'request.course.id'};
@@ -2305,9 +2378,15 @@ END
return;
}
-#
-# Print out the initial form to get the courselist file
-#
+
+=pod
+
+=item print_first_courselist_upload_form()
+
+ Print out the initial form to get the courselist file
+
+=cut
+
sub print_first_courselist_upload_form {
my $r=shift;
my $str;
@@ -2332,7 +2411,15 @@ sub print_first_courselist_upload_form {
return;
}
-# ================================================= Drop/Add from uploaded file
+
+=pod
+
+=item upfile_drop_add()
+
+ Drop/Add from uploaded file
+
+=cut
+
sub upfile_drop_add {
my $r=shift;
&Apache::loncommon::load_tmp_file($r);
@@ -2538,7 +2625,7 @@ sub upfile_drop_add {
}
}
} # end of foreach (@studentdata)
- $r->print("
\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 '.
@@ -2589,7 +2676,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); } @@ -2646,12 +2733,9 @@ sub get_permission { return (\%permission,$allowed); } -################################################################### -################################################################### - =pod -=item &handler +=item &handler() The typical handler you see in all these modules. Takes $r, the http request, as an argument. @@ -2678,8 +2762,6 @@ The response to the request is governed =cut -################################################################### -################################################################### sub handler { my $r=shift; if ($r->header_only) { @@ -2890,10 +2972,12 @@ sub handler { return OK; } -################################################################### -################################################################### 1; __END__ +=pod +=back + +=cut