--- loncom/interface/lonpopulate.pm 2003/12/08 17:37:49 1.3 +++ loncom/interface/lonpopulate.pm 2003/12/12 00:45:49 1.6 @@ -1,3 +1,28 @@ +# automated enrollment configuration handler +# $Id: lonpopulate.pm,v 1.6 2003/12/12 00:45:49 raeburn Exp $ +# +# Copyright Michigan State University Board of Trustees +# +# This file is part of the LearningOnline Network with CAPA (LON-CAPA). +# +# LON-CAPA is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# LON-CAPA is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with LON-CAPA; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# /home/httpd/html/adm/gpl.txt +# +# http://www.lon-capa.org/ +# package Apache::lonpopulate; use strict; @@ -597,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.
@@ -606,7 +632,7 @@ As you are the only user with the role o - @@ -615,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) { @@ -676,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.
@@ -1085,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; @@ -1206,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'}; @@ -1214,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"}) ) { @@ -1248,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.