--- loncom/interface/lonpopulate.pm 2003/12/09 20:06:37 1.4 +++ loncom/interface/lonpopulate.pm 2003/12/12 00:45:49 1.6 @@ -1,5 +1,5 @@ # automated enrollment configuration handler -# $Id: lonpopulate.pm,v 1.4 2003/12/09 20:06:37 albertel Exp $ +# $Id: lonpopulate.pm,v 1.6 2003/12/12 00:45:49 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -622,7 +622,8 @@ As you are the only user with the role o - For each section, check the checkbox if you want registered students in that section to be included in the student roster for LON-CAPA course: $realm ($enrollvar{coursecode}); otherwise uncheck it. If you want to change the section/group designation used for this section in LON-CAPA, delete the currecnt value in the LON-CAPA section/group textbox and enter the new value. The LON-CAPA section/group ID can be left (or set to) empty, if you do not wish to tie a section/group ID to this section. If you wish to add new course section, enter the number of new sections to add in the textbox at the bottom of the page. You will provide information about each of the new sections on a subsequent page. Click 'Go' to store your changes. + For each section, check the checkbox if you want registered students in that section to be included in the student roster for LON-CAPA course: $realm ($enrollvar{coursecode}); otherwise uncheck it. If you want to change the section/group designation used for this section in LON-CAPA, delete the current value in the LON-CAPA section/group textbox and enter the new value. The LON-CAPA section/group ID can be left (or set to) empty, if you do not wish to tie a section/group ID to this section. To add a new section, check the 'Enrollment in this course?' checkbox, and enter the desired LON-CAPA section/groupID in the appropriate textbox. Click 'Go' to store +your changes.
@@ -631,7 +632,7 @@ As you are the only user with the role o - @@ -640,8 +641,8 @@ As you are the only user with the role o for (my $i=0; $i<@sections; $i++) { my $colflag = $i%2; my $shrflag = 0; - $r->print(" - +
Course code/td> + Section Current status LON-CAPA section/group ID Enrollment in this course?
$sections[$i]/td> + $r->print("
$sections[$i] "); if (grep/^$sections[$i]$/,@currsections) { @@ -701,7 +702,7 @@ As you are the only user with the role o if (@currsections) { my $secshow = @currsections; $r->print(" - Currently, LON-CAPA course: $realm ($enrollvar{coursecode}) incorporates enrollment from $secshow sections. Students enrolling in any of 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. For each section, uncheck the checkbox if you want registered students in that section to cease being included in the student roster for LON-CAPA course: $realm ($enrollvar{coursecode}); otherwise leave it checked. If you want to change the section/group designation used for this section in LON-CAPA, delete the current value in the LON-CAPA section/groupID textbox and enter the new value. If you wish to add new course section, enter the number of new sections to add in the textbox at the bottom of the page. You will provide information about each of the new sections on a subsequent page. Click 'Go' to store your changes. + Currently, LON-CAPA course: $realm ($enrollvar{coursecode}) incorporates enrollment from $secshow sections. Students enrolling in any of 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. For each section, uncheck the checkbox if you want registered students in that section to cease being included in the student roster for LON-CAPA course: $realm ($enrollvar{coursecode}); otherwise leave it checked. If you want to change the section/group designation used for this section in LON-CAPA, delete the current value in the LON-CAPA section/groupID textbox and enter the new value. If you wish to add new course section, enter the number of new sections to add in the textbox at the bottom of the page. You will provide information about each of the new sections on a subsequent page. Click 'Go' to store your changes.
@@ -1110,7 +1111,7 @@ sub print_crosslistings_menu () { $response = "There was a problem processing your requested changes. The automated enrollment settings for this course have been left unchanged.
"; } else { if ($removecount > 0) { - $response = "A total of $removecount courses are no longer crosslisted with LON-CAPA course: $realm ($coursecode).
/
"; + $response = "A total of $removecount courses are no longer crosslisted with LON-CAPA course: $realm ($coursecode).

"; } if ($crosscount > 0) { $response .= "The $crosscount courses listed below remain 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.

\n"; &print_reply($r,$response,$$tasktitleref{$action}); return; @@ -1231,6 +1276,7 @@ sub print_sections_menu () { my @sections = (); my $seccount = 0; my $removecount = 0; + my $addcount = 0; my $secstr = ''; my $response = ''; my $coursecode = $settings{'internal.coursecode'}; @@ -1239,14 +1285,44 @@ sub print_sections_menu () { } elsif ($settings{'internal.sectionnums'} ne '') { $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++) { my $sec = "sec_".$i; my $gp = "secgp_".$i; if ( exists($ENV{"form.$sec"}) ) { my $secentry = ''; - if ($currsections[$i] =~ m/^(\w+:)/) { + if ($currsections[$i] =~ m/^(\w+:)/ ) { $secentry = $1; } if ( exists($ENV{"form.$gp"}) ) { @@ -1273,8 +1349,12 @@ sub print_sections_menu () { 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).

"; } + 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).

"; + } 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.