version 1.5, 2003/12/11 02:54:51
|
version 1.6, 2003/12/12 00:45:49
|
Line 1205 sub print_crosslistings_response () {
|
Line 1205 sub print_crosslistings_response () {
|
push @badowner,$ENV{"form.$xl"}.":".$ENV{"form.$gp"}; |
push @badowner,$ENV{"form.$xl"}.":".$ENV{"form.$gp"}; |
} |
} |
} else { |
} else { |
push @badxlists, $ENV{"form.$xl"}.":".$ENV{"form.$gp"}; |
push @badxlists, $ENV{"form.$xl"}.":".$ENV{"form.$gp"}.":".$coursecheck; |
} |
} |
} |
} |
} |
} |
Line 1222 sub print_crosslistings_response () {
|
Line 1222 sub print_crosslistings_response () {
|
my %cenv = ('internal.crosslistings' => $xliststr); |
my %cenv = ('internal.crosslistings' => $xliststr); |
my $reply = &Apache::lonnet::put('environment',\%cenv,$dom,$crs); |
my $reply = &Apache::lonnet::put('environment',\%cenv,$dom,$crs); |
if ($reply !~ /^ok$/) { |
if ($reply !~ /^ok$/) { |
$response = "There was a problem processing your requested changes. The automated enrollment settings for this course have been left unchanged.<br/>"; |
$response = "There was a problem processing your requested changes. The automated enrollment settings for this course have been left unchanged.<br/><br/>"; |
} else { |
} else { |
$response = "The courses listed below are now crosslisted with this LON-CAPA course, and students enrolling in these course sections will be automatically added to the class roster for the course, if you have chosen to enable a nightly automated enrollment update.<br/><ul>\n"; |
$response = "The courses listed below are now crosslisted with this LON-CAPA course, and students enrolling in these course sections will be automatically added to the class roster for the course, if you have chosen to enable a nightly automated enrollment update.<br/><ul>\n"; |
|
foreach (@allxlists) { |
|
my ($xlist,$gp) = split/:/,$_; |
|
$response .= "<li>$xlist - ID: $gp</li>\n"; |
|
} |
|
$response .= "</ul><br/><br/>\n"; |
|
} |
|
} else { |
|
if ($xliststr =~ m/:/) { |
|
my @oldxlists = (); |
|
if ($xliststr =~ m/,/) { |
|
@oldxlists = split/,/,$xliststr; |
|
} else { |
|
$oldxlists[0] = $xliststr; |
|
} |
|
$response .= "Although no new crosslistings were added, the courses listed below continue to be crosslisted with your LON-CAPA course.<br/><ul>\n"; |
|
foreach (@oldxlists) { |
|
my ($xlist,$gp) = split/:/,$_; |
|
$response .= "<li>$xlist - ID: $gp</li>\n"; |
|
} |
|
$response .= "</ul><br/><br/>\n"; |
} |
} |
} |
} |
|
|
foreach (@allxlists) { |
|
my ($xlist,$gp) = split/:/,$_; |
|
$response .= "<li>$xlist - ID: $gp</li>\n"; |
|
} |
|
$response .= "</ul><br/><br/>\n"; |
|
|
|
if (@badxlists > 0) { |
if (@badxlists > 0) { |
$response .= "The courses listed below could not be included in the crosslistings for this LON-CAPA course, because they are not valid courses according to your institution's official schedule of classes and sections.<br/><ul>\n"; |
$response .= "The courses listed below could not be included in the crosslistings for this LON-CAPA course, because they are not valid courses according to your institution's official schedule of classes and sections.<br/><ul>\n"; |
foreach (@badxlists) { |
foreach (@badxlists) { |
my ($xlist,$gp) = split/:/,$_; |
my ($xlist,$gp,$prob) = split/:/,$_; |
$response .= "<li>$xlist - ID: $gp</li>\n"; |
$response .= "<li>$xlist - ID: $gp - Error: $prob</li>\n"; |
} |
} |
$response .= "</ul><br/><br/>\n"; |
$response .= "</ul><br/><br/>\n"; |
} |
} |
Line 1263 sub print_sections_menu () {
|
Line 1276 sub print_sections_menu () {
|
my @sections = (); |
my @sections = (); |
my $seccount = 0; |
my $seccount = 0; |
my $removecount = 0; |
my $removecount = 0; |
|
my $addcount = 0; |
my $secstr = ''; |
my $secstr = ''; |
my $response = ''; |
my $response = ''; |
my $coursecode = $settings{'internal.coursecode'}; |
my $coursecode = $settings{'internal.coursecode'}; |
Line 1271 sub print_sections_menu () {
|
Line 1285 sub print_sections_menu () {
|
} elsif ($settings{'internal.sectionnums'} ne '') { |
} elsif ($settings{'internal.sectionnums'} ne '') { |
$currsections[0] = $settings{'internal.sectionnums'}; |
$currsections[0] = $settings{'internal.sectionnums'}; |
} |
} |
|
|
if (@currsections > 0) { |
if ( exists($ENV{'form.secshow'}) ) { |
|
for (my $i=0; $i<$ENV{'form.secshow'}; $i++) { |
|
my $gp = "loncapasec_".$i; |
|
my $secnum = "secnum_".$i; |
|
my $sec = "sec_".$i; |
|
if ( exists( $ENV{"form.$sec"} ) ) { |
|
my $secentry; |
|
if ( exists( $ENV{"form.$secnum"} ) ) { |
|
$secentry = $ENV{"form.$secnum"}.':'; |
|
} |
|
if ( exists( $ENV{"form.$gp"} ) ) { |
|
$secentry .= $ENV{"form.$gp"}; |
|
} |
|
push @sections, $secentry; |
|
$seccount ++; |
|
unless (grep/^$ENV{"form.$secnum"}:/,@currsections) { |
|
$addcount ++; |
|
} |
|
} |
|
} |
|
if (@currsections > 0) { |
|
for (my $i=0; $i<@currsections; $i++) { |
|
if ($currsections[$i] =~ m/^(\w+:)/ ) { |
|
my $oldsec = $1; |
|
unless (grep/^$oldsec/,@sections) { |
|
$removecount ++; |
|
} |
|
} |
|
} |
|
} |
|
} elsif (@currsections > 0) { |
for (my $i=0; $i<@currsections; $i++) { |
for (my $i=0; $i<@currsections; $i++) { |
my $sec = "sec_".$i; |
my $sec = "sec_".$i; |
my $gp = "secgp_".$i; |
my $gp = "secgp_".$i; |
if ( exists($ENV{"form.$sec"}) ) { |
if ( exists($ENV{"form.$sec"}) ) { |
my $secentry = ''; |
my $secentry = ''; |
if ($currsections[$i] =~ m/^(\w+:)/) { |
if ($currsections[$i] =~ m/^(\w+:)/ ) { |
$secentry = $1; |
$secentry = $1; |
} |
} |
if ( exists($ENV{"form.$gp"}) ) { |
if ( exists($ENV{"form.$gp"}) ) { |
Line 1305 sub print_sections_menu () {
|
Line 1349 sub print_sections_menu () {
|
if ($removecount > 0) { |
if ($removecount > 0) { |
$response = "A total of $removecount sections have been removed from the list of sections which contribute to enrollment in LON-CAPA course: $realm ($coursecode).<br/><br/>"; |
$response = "A total of $removecount sections have been removed from the list of sections which contribute to enrollment in LON-CAPA course: $realm ($coursecode).<br/><br/>"; |
} |
} |
|
if ($addcount > 0) { |
|
$response .= "A total of $addcount sections have been added to the list of |
|
sections which contribute to enrollment in LON-CAPA course: $realm ($coursecode).<br/><br/>"; |
|
} |
if ($seccount > 0) { |
if ($seccount > 0) { |
$response .= "Students enrolling in the $seccount section(s) listed below will continue to be automatically added to the class roster for the course, if you have chosen to enable a nightly automated enrollment update.<br/><ul>\n"; |
$response .= "Students enrolling in the $seccount section(s) listed below will be automatically added to the class roster for the course, if you have chosen to enable a nightly automated enrollment update.<br/><ul>\n"; |
foreach (@sections) { |
foreach (@sections) { |
my ($sec,$gp) = split/:/,$_; |
my ($sec,$gp) = split/:/,$_; |
$response .= "<li>$sec - ID: $gp</li>\n"; |
$response .= "<li>$sec - ID: $gp</li>\n"; |