version 1.40, 2006/02/10 02:59:02
|
version 1.42, 2006/05/16 21:56:14
|
Line 38 use LONCAPA::Enrollment;
|
Line 38 use LONCAPA::Enrollment;
|
|
|
############################################################### |
############################################################### |
sub header { |
sub header { |
my $html=&Apache::lonxml::xmlbegin(); |
return &Apache::loncommon::start_page('Classlist Manager'); |
my $bodytag=&Apache::loncommon::bodytag('Classlist Manager'); |
|
return(<<ENDHEAD); |
|
$html |
|
<head> |
|
<title>LON-CAPA Classlist Manager</title> |
|
</head> |
|
$bodytag |
|
ENDHEAD |
|
} |
} |
|
|
############################################################### |
############################################################### |
|
|
sub choose_header { |
sub choose_header { |
my $action = shift; |
my ($action) = @_; |
my $bodytag=&Apache::loncommon::bodytag('Classlist Manager'); |
|
my $scripttag = qq| |
my $scripttag = qq| |
<script language='javascript' type='text/javascript'> |
<script language='javascript' type='text/javascript'> |
<!-- |
<!-- |
Line 175 function countChecked(field) {
|
Line 167 function countChecked(field) {
|
// End hiding --> |
// End hiding --> |
</script> |
</script> |
|; |
|; |
my $html=&Apache::lonxml::xmlbegin(); |
|
return(<<ENDHEAD); |
return &Apache::loncommon::start_page('Classlist Manager', |
$html |
$scripttag); |
<head> |
|
<title>LON-CAPA Classlist Manager</title> |
|
$scripttag |
|
$bodytag |
|
ENDHEAD |
|
} |
} |
|
|
sub print_mainbox { |
sub print_mainbox { |
Line 312 sub print_main_frame {
|
Line 299 sub print_main_frame {
|
<td>Use <i>"Section settings"</i> to make changes to the choice of sections included for enrollment in your LON-CAPA course.</td> |
<td>Use <i>"Section settings"</i> to make changes to the choice of sections included for enrollment in your LON-CAPA course.</td> |
</tr> |
</tr> |
<td> </td> |
<td> </td> |
<td>Use <i>"Student photos settings"</i> to enable or disable automatic import of photos for registered students in your course.</td> |
<td>Use <i>"Student photo settings"</i> to enable or disable automatic import of photos for registered students in your course.</td> |
</tr> |
</tr> |
<tr> |
<tr> |
<td> </td> |
<td> </td> |
Line 491 ENDTWO
|
Line 478 ENDTWO
|
} elsif ($action eq "notify") { |
} elsif ($action eq "notify") { |
my $notifycount = 0; |
my $notifycount = 0; |
my @notified = split(/,/,$enrollvar{notifylist}); |
my @notified = split(/,/,$enrollvar{notifylist}); |
foreach (@notified) { |
for (my $i=0; $i<@notified; $i++) { |
unless ($_ eq '') { $notifycount ++; } |
if ($notified[$i] !~ /:/) { |
|
$notified[$i] =~ s/\@/:/; |
|
} |
|
unless ($notified[$i] eq '') { $notifycount ++; } |
} |
} |
my $noteset = ''; |
my $noteset = ''; |
if ($notifycount) { |
if ($notifycount) { |
Line 538 ENDTWO
|
Line 528 ENDTWO
|
foreach (@coursepersonnel) { |
foreach (@coursepersonnel) { |
my @roleinfo = split/:/,$_; |
my @roleinfo = split/:/,$_; |
if ($roleinfo[0] eq 'cc') { |
if ($roleinfo[0] eq 'cc') { |
unless (grep/^$roleinfo[1]\@$roleinfo[2]/,@ccs) { |
unless (grep/^$roleinfo[1]\:$roleinfo[2]/,@ccs) { |
my $active_cc = &Apache::loncommon::check_user_status($roleinfo[2],$roleinfo[1],$dom,$crs,'cc'); |
my $active_cc = &Apache::loncommon::check_user_status($roleinfo[2],$roleinfo[1],$dom,$crs,'cc'); |
if ($active_cc eq 'active') { |
if ($active_cc eq 'active') { |
push @ccs, "$roleinfo[1]\@$roleinfo[2]"; |
push @ccs, $roleinfo[1].':'.$roleinfo[2]; |
$pname{"$roleinfo[1]\@$roleinfo[2]"} = &Apache::loncommon::plainname($roleinfo[1],$roleinfo[2]); |
$pname{$roleinfo[1].':'.$roleinfo[2]} = &Apache::loncommon::plainname($roleinfo[1],$roleinfo[2]); |
if (grep/^$roleinfo[1]\@$roleinfo[2]$/,@notified) { |
if (grep/^$roleinfo[1]\:$roleinfo[2]$/,@notified) { |
$notifystate{"$roleinfo[1]\@$roleinfo[2]"} = 1; |
$notifystate{$roleinfo[1].':'.$roleinfo[2]} = 1; |
} else { |
} else { |
$notifystate{"$roleinfo[1]\@$roleinfo[2]"} = 0; |
$notifystate{$roleinfo[1].':'.$roleinfo[2]} = 0; |
} |
} |
} else { |
} else { |
push @oldccs, "$roleinfo[1]\@$roleinfo[2]"; |
push @oldccs, $roleinfo[1].':'.$roleinfo[2]; |
} |
} |
} |
} |
} |
} |
Line 558 ENDTWO
|
Line 548 ENDTWO
|
foreach my $person (@notified) { |
foreach my $person (@notified) { |
unless ( (grep/^$person$/,@ccs) || ($person eq '') || (grep/^$person$/,@oldccs) ) { |
unless ( (grep/^$person$/,@ccs) || ($person eq '') || (grep/^$person$/,@oldccs) ) { |
push @ccs, $person; |
push @ccs, $person; |
my ($puname,$pdom) = split/\@/,$person; |
my ($puname,$pdom) = split/:/,$person; |
$pname{$person} = &Apache::loncommon::plainname($puname,$pdom); |
$pname{$person} = &Apache::loncommon::plainname($puname,$pdom); |
$notifystate{$person} = 1; |
$notifystate{$person} = 1; |
} |
} |
} |
} |
} |
} |
my $viewer = $env{'user.name'}.'@'.$env{'user.domain'}; |
my $viewer = $env{'user.name'}.':'.$env{'user.domain'}; |
unless ( (grep/^$viewer$/,@ccs) || ($viewer eq '') ) { |
unless ( (grep/^$viewer$/,@ccs) || ($viewer eq '') ) { |
push @ccs,$viewer; |
push @ccs,$viewer; |
$pname{$viewer} = &Apache::loncommon::plainname($env{'user.name'},$env{'user.domain'}); |
$pname{$viewer} = &Apache::loncommon::plainname($env{'user.name'},$env{'user.domain'}); |
Line 581 ENDTWO
|
Line 571 ENDTWO
|
</td> |
</td> |
</tr> |
</tr> |
<tr> |
<tr> |
<td> |
<td>"); |
<table border=\"0\" cellpadding=\"3\" cellspacing=\"3\"> |
$r->print(&Apache::loncommon::start_data_table()); |
<tr bgcolor=\"#CCCCFF\"> |
$r->print(&Apache::loncommon::start_data_table_row()); |
<td><b>Name</b></td> |
$r->print(" |
<td><b>username</b></td> |
<th>Name</th> |
<td><b>Current status</b></td> |
<th>username:domain</th> |
<td><b>Notification?</b></td> |
<th>Current status</th> |
</tr> |
<th>Notification?</th> |
"); |
"); |
|
$r->print(&Apache::loncommon::end_data_table_row()); |
for (my $i=0; $i<@ccs; $i++) { |
for (my $i=0; $i<@ccs; $i++) { |
my $colflag = $i%2; |
$r->print(&Apache::loncommon::start_data_table_row()); |
$r->print("<tr bgcolor=\"$bgcolors[$colflag]\" align=\"left\"> |
$r->print(" |
<td>$pname{$ccs[$i]}</td> |
<td>$pname{$ccs[$i]}</td> |
<td><input type=\"hidden\" name=\"notifyname_$i\" value=\"$ccs[$i]\" />$ccs[$i]</td> |
<td><input type=\"hidden\" name=\"notifyname_$i\" value=\"$ccs[$i]\" />$ccs[$i]</td> |
<td> |
<td> |
Line 603 ENDTWO
|
Line 594 ENDTWO
|
$r->print("Notification inactive"); |
$r->print("Notification inactive"); |
} |
} |
if ($notifystate{$ccs[$i]} == 1) { |
if ($notifystate{$ccs[$i]} == 1) { |
$r->print("</td><td><input type=\"checkbox\" name=\"note_$i\" checked=\"true\" /></td></tr>"); |
$r->print("</td><td><input type=\"checkbox\" name=\"note_$i\" checked=\"true\" /></td>"); |
} else { |
} else { |
$r->print("</td><td><input type=\"checkbox\" name=\"note_$i\" /></td></tr>"); |
$r->print("</td><td><input type=\"checkbox\" name=\"note_$i\" /></td>"); |
} |
} |
|
$r->print(&Apache::loncommon::end_data_table_row()); |
} |
} |
|
$r->print(&Apache::loncommon::end_data_table()); |
$r->print(" |
$r->print(" |
</table> |
|
<br/> |
<br/> |
<table width=\"100%\" border=\"0\" cellspadding=\"2\" cellspacing=\"2\"> |
<table width=\"100%\" border=\"0\" cellspadding=\"2\" cellspacing=\"2\"> |
<tr> |
<tr> |
Line 650 ENDTWO
|
Line 642 ENDTWO
|
"); |
"); |
if ($cross_str > 0) { |
if ($cross_str > 0) { |
$r->print(" |
$r->print(" |
Currently, this LON-CAPA course is crosslisted with $cross_str course section(s). 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. For each crosslisting, leave the checkbox checked if you want registered students in that course to be included in the student roster for LON-CAPA course: <b>$realm ($enrollvar{coursecode})</b>; otherwise uncheck it. If you wish to change the section/group ID assigned in your LON-CAPA course for a crosslisted course, enter the new section/group ID in the appropriate textbox. 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 crosslisting. If you wish to add new crosslisted courses, enter the number of new courses to add in the textbox at the bottom of the page. You will provide information about each of the new crosslistings on a subsequent page. Click 'Go' to store your changes. |
Currently, this LON-CAPA course is crosslisted with $cross_str course section(s). 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. For each crosslisting, leave the checkbox checked if you want registered students in that course to be included in the student roster for LON-CAPA course: <b>$realm ($enrollvar{coursecode})</b>; otherwise uncheck it. If you wish to change the section ID assigned in your LON-CAPA course for a crosslisted course, enter the new section ID in the appropriate textbox. The LON-CAPA section ID can be left (or set to) empty, if you do not wish to tie a section ID to this crosslisting. If you wish to add new crosslisted courses, enter the number of new courses to add in the textbox at the bottom of the page. You will provide information about each of the new crosslistings on a subsequent page. Click 'Go' to store your changes. |
</td> |
</td> |
</tr> |
</tr> |
</table> |
</table> |
<br/> |
<br/> |
<table border=\"0\" cellpadding=\"3\" cellspacing=\"3\"> |
"); |
<tr> |
$r->print(&Apache::loncommon::start_data_table()); |
<td> |
$r->print(&Apache::loncommon::start_data_table_row()); |
<table border=\"0\" width=\"100%\" cellspacing=\"3\" cellpadding=\"3\"> |
$r->print(" |
<tr bgcolor=\"#CCCCFF\" align=\"left\"> |
<th>Enrollment?</th> |
<td><b>Enrollment?</b></td> |
<th>Crosslisted course</th> |
<td><b>Crosslisted course</b></td> |
<th>LON-CAPA section ID</th> |
<td><b>LON-CAPA section/groupID</b></td> |
|
</tr> |
|
"); |
"); |
|
$r->print(&Apache::loncommon::end_data_table_row()); |
for (my $i=0; $i<@xlists; $i++) { |
for (my $i=0; $i<@xlists; $i++) { |
my $xl = ' '; |
my $xl = ' '; |
my $gp = ' '; |
my $lc_sec = ' '; |
if ($xlists[$i] =~ /^([^:]+):?(.*)$/) { |
if ($xlists[$i] =~ /^([^:]+):?(.*)$/) { |
$xl = $1; |
$xl = $1; |
$gp = $2; |
$lc_sec = $2; |
} |
} |
my $colflag = $i%2; |
my $colflag = $i%2; |
|
$r->print(&Apache::loncommon::start_data_table_row()); |
$r->print(" |
$r->print(" |
<tr bgcolor=\"$bgcolors[$colflag]\" align=\"left\"> |
|
<td><input type=\"checkbox\" name=\"cross_$i\" checked=\"true\" /></td> |
<td><input type=\"checkbox\" name=\"cross_$i\" checked=\"true\" /></td> |
<td>$xl</td> |
<td>$xl</td> |
<td><input type =\"text\" size=\"10\" name=\"gp_$i\" value=\"$gp\" /></td> |
<td><input type =\"text\" size=\"10\" name=\"lcsec_$i\" value=\"$lc_sec\" /></td> |
</tr> |
|
"); |
"); |
|
$r->print(&Apache::loncommon::end_data_table_row()); |
} |
} |
$r->print(" </table> |
$r->print(&Apache::loncommon::end_data_table()); |
</td> |
|
</tr> |
|
</table> |
|
"); |
|
} |
} |
else { |
else { |
$r->print(" |
$r->print(" |
Line 741 ENDTWO
|
Line 728 ENDTWO
|
</td> |
</td> |
</tr> |
</tr> |
<tr> |
<tr> |
<td>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: <b>$realm ($enrollvar{coursecode})</b>; 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 |
<td>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: <b>$realm ($enrollvar{coursecode})</b>; otherwise uncheck it. If you want to change the section ID designation used for this section in LON-CAPA, delete the current value in the LON-CAPA section ID textbox and enter the new value. The LON-CAPA section ID can be left (or set to) empty, if you do not wish to tie a section ID to this section. To add a new section, check the 'Enrollment in this course?' checkbox, and enter the desired LON-CAPA section ID in the appropriate textbox. Click 'Go' to store |
your changes.</td> |
your changes.</td> |
</tr> |
</tr> |
</table> |
</table> |
<br/> |
<br/> |
<table border=\"0\" cellpadding=\"3\" cellspacing=\"3\"> |
|
<tr bgcolor=\"#CCCCFF\"> |
|
<td><b>Section</b></td> |
|
<td><b>Current status</b></td> |
|
<td><b>LON-CAPA section/group ID</b></td> |
|
<td><b>Enrollment in this course?</b></td> |
|
</tr> |
|
"); |
"); |
|
$r->print(&Apache::loncommon::start_data_table()); |
|
$r->print(&Apache::loncommon::start_data_table_row()); |
|
$r->print(" |
|
<th>Section</th> |
|
<th>Current status</th> |
|
<th>LON-CAPA section ID</th> |
|
<th>Enrollment in this course?</th> |
|
"); |
|
$r->print(&Apache::loncommon::end_data_table_row()); |
for (my $i=0; $i<@sections; $i++) { |
for (my $i=0; $i<@sections; $i++) { |
my $colflag = $i%2; |
my $colflag = $i%2; |
my $shrflag = 0; |
my $shrflag = 0; |
$r->print("<tr bgcolor=\"$bgcolors[$colflag]\" align=\"left\"> |
$r->print(&Apache::loncommon::start_data_table_row()); |
|
$r->print(" |
<td>$sections[$i]<input type=\"hidden\" name=\"secnum_$i\" value=\"$sections[$i]\" /></td> |
<td>$sections[$i]<input type=\"hidden\" name=\"secnum_$i\" value=\"$sections[$i]\" /></td> |
<td> |
<td> |
"); |
"); |
Line 768 your changes.</td>
|
Line 758 your changes.</td>
|
$r->print("Enrollment inactive"); |
$r->print("Enrollment inactive"); |
} |
} |
if ($shrflag) { |
if ($shrflag) { |
$r->print("</td><td><input type=\"text\" size=\"10\" name=\"loncapasec_$i\" value=\"$sec_id{$sections[$i]}\"></td><td><input type=\"checkbox\" name=\"sec_$i\" checked=\"true\" /></td></tr>"); |
$r->print("</td><td><input type=\"text\" size=\"10\" name=\"loncapasec_$i\" value=\"$sec_id{$sections[$i]}\"></td><td><input type=\"checkbox\" name=\"sec_$i\" checked=\"true\" /></td>"); |
} else { |
} else { |
$r->print("</td><td><input type=\"text\" size=\"10\" name=\"loncapasec_$i\" value=\"\" /></td><td><input type=\"checkbox\" name=\"sec_$i\" /></td></tr>"); |
$r->print("</td><td><input type=\"text\" size=\"10\" name=\"loncapasec_$i\" value=\"\" /></td><td><input type=\"checkbox\" name=\"sec_$i\" /></td>"); |
} |
} |
|
$r->print(&Apache::loncommon::end_data_table_row()); |
} |
} |
|
$r->print(&Apache::loncommon::end_data_table()); |
$r->print(" |
$r->print(" |
</table> |
|
<br/> |
<br/> |
<table width=\"100%\" border=\"0\" cellspacing=\"3\" cellpadding=\"3\"> |
<table width=\"100%\" border=\"0\" cellspacing=\"3\" cellpadding=\"3\"> |
<tr> |
<tr> |
Line 798 your changes.</td>
|
Line 789 your changes.</td>
|
if (@currsections) { |
if (@currsections) { |
my $secshow = @currsections; |
my $secshow = @currsections; |
$r->print(" |
$r->print(" |
Currently, this LON-CAPA course 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: <b>$realm ($enrollvar{coursecode})</b>; 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, this LON-CAPA course 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: <b>$realm ($enrollvar{coursecode})</b>; otherwise leave it checked. If you want to change the section ID designation used for this section in LON-CAPA, delete the current value in the LON-CAPA section ID 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. |
</td> |
</td> |
</tr> |
</tr> |
</table> |
</table> |
<br/> |
<br/> |
<table border=\"0\" cellpadding=\"3\" cellspacing=\"3\"> |
|
<tr> |
|
<td> |
|
<table border=\"0\" width=\"100%\" cellspacing=\"3\" cellpadding=\"3\"> |
|
<tr bgcolor=\"#CCCCFF\"> |
|
<td><b>Enrollment?</b></td> |
|
<td><b>Section</b></td> |
|
<td><b>LON-CAPA section/groupID</b></td> |
|
</tr> |
|
"); |
"); |
|
$r->print(&Apache::loncommon::start_data_table()); |
|
$r->print(&Apache::loncommon::start_data_table_row()); |
|
$r->print(" |
|
<th>Enrollment?</th> |
|
<th>Section</th> |
|
<th>LON-CAPA section ID</th> |
|
"); |
|
$r->print(&Apache::loncommon::end_data_table_row()); |
for (my $j=0; $j<@currsections; $j++) { |
for (my $j=0; $j<@currsections; $j++) { |
my $colflag = $j%2; |
my $colflag = $j%2; |
|
$r->print(&Apache::loncommon::start_data_table_row()); |
$r->print(" |
$r->print(" |
<tr bgcolor=\"$bgcolors[$colflag]\" align=\"left\"> |
|
<td><input type=\"checkbox\" name=\"sec_$j\" checked=\"true\" /></td> |
<td><input type=\"checkbox\" name=\"sec_$j\" checked=\"true\" /></td> |
<td>$currsections[$j]</td> |
<td>$currsections[$j]</td> |
<td><input type=\"text\" name=\"secgp_$j\" size=\"10\" value=\"$sec_id{$currsections[$j]}\" /></td> |
<td><input type=\"text\" name=\"lcsec_$j\" size=\"10\" value=\"$sec_id{$currsections[$j]}\" /></td> |
</tr> |
|
"); |
"); |
|
$r->print(&Apache::loncommon::end_data_table_row()); |
} |
} |
$r->print(" </table> |
$r->print(&Apache::loncommon::end_data_table()); |
</td> |
|
</tr> |
|
</table> |
|
"); |
|
} else { |
} else { |
$r->print(" |
$r->print(" |
Currently no sections of $realm ($enrollvar{coursecode}) are contributing enrollment to the LON-CAPA class roster. |
Currently no sections of $realm ($enrollvar{coursecode}) are contributing enrollment to the LON-CAPA class roster. |
Line 1267 ENDFOUR
|
Line 1253 ENDFOUR
|
|
|
############################################################### |
############################################################### |
sub print_doc_base { |
sub print_doc_base { |
my $r = shift; |
my ($r) = @_; |
$r->print(<<ENDBASE); |
$r->print(<<ENDBASE); |
</td> |
</td> |
</tr> |
</tr> |
</table> |
</table> |
<br/> |
<br /> |
</body> |
|
</html> |
|
ENDBASE |
ENDBASE |
|
$r->print(&Apache::loncommon::end_page()); |
} |
} |
|
|
################################################################### |
################################################################### |
Line 1658 sub print_crosslistings_menu () {
|
Line 1643 sub print_crosslistings_menu () {
|
if (@currxlists > 0) { |
if (@currxlists > 0) { |
for (my $i=0; $i<@currxlists; $i++) { |
for (my $i=0; $i<@currxlists; $i++) { |
my $xlist = "cross_".$i; |
my $xlist = "cross_".$i; |
my $gp = "gp_".$i; |
my $lc_sec = "lcsec_".$i; |
if ( exists($env{"form.$xlist"}) ) { |
if ( exists($env{"form.$xlist"}) ) { |
my $xlistentry = ''; |
my $xlistentry = ''; |
if ($currxlists[$i] =~ m/^([^:]+)/) { |
if ($currxlists[$i] =~ m/^([^:]+)/) { |
$xlistentry = $1.':'; |
$xlistentry = $1.':'; |
} |
} |
if ( exists($env{"form.$gp"}) ) { |
if ( exists($env{"form.$lc_sec"}) ) { |
$xlistentry .= $env{"form.$gp"}; |
$xlistentry .= $env{"form.$lc_sec"}; |
} |
} |
push @xlists,$xlistentry; |
push @xlists,$xlistentry; |
$crosscount ++; |
$crosscount ++; |
Line 1688 sub print_crosslistings_menu () {
|
Line 1673 sub print_crosslistings_menu () {
|
if ($crosscount > 0) { |
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.<br/><ul>\n"; |
$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.<br/><ul>\n"; |
foreach (@xlists) { |
foreach (@xlists) { |
my ($xlist,$gp) = split/:/,$_; |
my ($xlist,$lc_sec) = split/:/,$_; |
$response .= "<li>$xlist - ID: $gp</li>\n"; |
$response .= "<li>$xlist - ID: $lc_sec</li>\n"; |
} |
} |
$response .= "</ul><br/>\n"; |
$response .= "</ul><br/>\n"; |
} |
} |
Line 1698 sub print_crosslistings_menu () {
|
Line 1683 sub print_crosslistings_menu () {
|
my $numcross = $env{'form.numcross'}; |
my $numcross = $env{'form.numcross'}; |
if ($numcross > 0) { |
if ($numcross > 0) { |
my @bgcolors=("#eeeeee","#cccccc"); |
my @bgcolors=("#eeeeee","#cccccc"); |
$response .= qq(You indicated that you wish to add an additional $numcross crosslisting(s). For each new crosslisting enter the insititutional course section code (e.g., fs03zol101001, for section 001 of zol101 for fs03 semester), and the LON-CAPA section/group ID you wish to assign to students who will be enrolled in your LON-CAPA class as a result of their registration in the crosslisted course section. The LON-CAPA section/group ID can be left blank, if you do not wish to tie a section/group ID to this crosslisting. The institutional course section code should only contain letters and/or numbers, and must be consistent with the scheme adopted by your Domain Coordinator to map course codes (and section numbers) to your institution\'s student information system.<br/><br/> |
$response .= qq(You indicated that you wish to add an additional $numcross crosslisting(s). For each new crosslisting enter the insititutional course section code (e.g., fs03zol101001, for section 001 of zol101 for fs03 semester), and the LON-CAPA section ID you wish to assign to students who will be enrolled in your LON-CAPA class as a result of their registration in the crosslisted course section. The LON-CAPA section ID can be left blank, if you do not wish to tie a section ID to this crosslisting. The institutional course section code should only contain letters and/or numbers, and must be consistent with the scheme adopted by your Domain Coordinator to map course codes (and section numbers) to your institution's student information system.<br/><br/> |
<form name="enter" method="post"> |
<form name="enter" method="post">); |
<table border="0" cellpadding="2" cellspacing="2" width="100%"> |
$response .= &Apache::loncommon::start_data_table(); |
<tr> |
$response .= &Apache::loncommon::start_data_table_row(); |
<td> |
$response .= qq( |
<table border="0" cellspacing="3" cellpadding="3"> |
<th>Crosslisting</th> |
<tr bgcolor="#CCCCFF" align="left"> |
<th>LON-CAPA section ID</th> |
<td><b>Crosslisting</b></td> |
|
<td><b>LON-CAPA section/groupID</b></td> |
|
</tr> |
|
); |
); |
|
$response .= &Apache::loncommon::end_data_table_row(); |
for (my $i=0; $i<$numcross; $i++) { |
for (my $i=0; $i<$numcross; $i++) { |
my $colflag = $i%2; |
$response .= &Apache::loncommon::start_data_table_row(); |
$response .= qq( |
$response .= qq( |
<tr bgcolor="$bgcolors[$colflag]" align="left"> |
|
<td><input type="text" size="15" name="newcross_$i" /></td> |
<td><input type="text" size="15" name="newcross_$i" /></td> |
<td><input type="text" size="10" name="newgroupid_$i" /></td> |
<td align="right"><input type="text" size="10" name="newlcsec_$i" /></td> |
</tr> |
|
); |
); |
|
$response .= &Apache::loncommon::end_data_table_row(); |
} |
} |
$response .= qq( </table> |
$response .= &Apache::loncommon::end_data_table(); |
|
$response .= qq( |
</td> |
</td> |
</tr> |
</tr> |
<tr> |
<tr> |
Line 1746 sub print_crosslistings_response () {
|
Line 1729 sub print_crosslistings_response () {
|
my @allxlists = (); |
my @allxlists = (); |
my @badxlists = (); |
my @badxlists = (); |
my @badowner = (); |
my @badowner = (); |
|
my @reserved = (); |
|
my @matchgroup = (); |
my $numcross = 0; |
my $numcross = 0; |
my $xliststr = $settings{'internal.crosslistings'}; |
my $xliststr = $settings{'internal.crosslistings'}; |
my $coursecode = $settings{'internal.coursecode'}; |
my $coursecode = $settings{'internal.coursecode'}; |
Line 1763 sub print_crosslistings_response () {
|
Line 1748 sub print_crosslistings_response () {
|
} |
} |
|
|
if ($numcross > 0) { |
if ($numcross > 0) { |
|
my %curr_groups = &Apache::loncommon::coursegroups(); |
for (my $i=0; $i<$numcross; $i++) { |
for (my $i=0; $i<$numcross; $i++) { |
my $xl = "newcross_".$i; |
my $xl = "newcross_".$i; |
my $gp = "newgroupid_".$i; |
my $lc_sec = "newlcsec_".$i; |
if ( exists($env{"form.$xl"}) ) { |
if ( exists($env{"form.$xl"}) ) { |
|
if (exists($env{"form.$lc_sec"})) { |
|
my $lc_sec_check = &validate_lcsec(\%curr_groups, |
|
$env{"form.$lc_sec"}); |
|
if ($lc_sec_check eq 'reserved') { |
|
push(@reserved,$env{"form.$xl"}.":".$env{"form.$lc_sec"}); |
|
next; |
|
} elsif ($lc_sec_check eq 'group') { |
|
push (@matchgroup,$env{"form.$xl"}.":".$env{"form.$lc_sec"}); |
|
next; |
|
} |
|
} |
my $coursecheck = ''; |
my $coursecheck = ''; |
$coursecheck = &Apache::lonnet::auto_validate_courseID($crs,$dom,$env{"form.$xl"}); |
$coursecheck = &Apache::lonnet::auto_validate_courseID($crs,$dom,$env{"form.$xl"}); |
if ($coursecheck eq 'ok') { |
if ($coursecheck eq 'ok') { |
my $addcheck = ''; |
my $addcheck = ''; |
$addcheck = &Apache::lonnet::auto_new_course($crs,$dom,$env{"form.$xl"},$owner); |
$addcheck = &Apache::lonnet::auto_new_course($crs,$dom,$env{"form.$xl"},$owner); |
if ($addcheck eq 'ok') { |
if ($addcheck eq 'ok') { |
push @xlists,$env{"form.$xl"}.":".$env{"form.$gp"}; |
push @xlists,$env{"form.$xl"}.":".$env{"form.$lc_sec"}; |
} else { |
} else { |
push @badowner,$env{"form.$xl"}.":".$env{"form.$gp"}; |
push @badowner,$env{"form.$xl"}.":".$env{"form.$lc_sec"}; |
} |
} |
} else { |
} else { |
push @badxlists, $env{"form.$xl"}.":".$env{"form.$gp"}.":".$coursecheck; |
push @badxlists, $env{"form.$xl"}.":".$env{"form.$lc_sec"}.":".$coursecheck; |
} |
} |
} |
} |
} |
} |
Line 1796 sub print_crosslistings_response () {
|
Line 1793 sub print_crosslistings_response () {
|
} 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) { |
foreach (@allxlists) { |
my ($xlist,$gp) = split/:/,$_; |
my ($xlist,$lc_sec) = split/:/,$_; |
$response .= "<li>$xlist - ID: $gp</li>\n"; |
$response .= "<li>$xlist - ID: $lc_sec</li>\n"; |
} |
} |
$response .= "</ul><br/><br/>\n"; |
$response .= "</ul><br/><br/>\n"; |
} |
} |
Line 1806 sub print_crosslistings_response () {
|
Line 1803 sub print_crosslistings_response () {
|
my @oldxlists = (split/,/,$xliststr); |
my @oldxlists = (split/,/,$xliststr); |
$response .= "Although no new crosslistings were added, the courses listed below continue to be crosslisted with your LON-CAPA course.<br/><ul>\n"; |
$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) { |
foreach (@oldxlists) { |
my ($xlist,$gp) = split/:/,$_; |
my ($xlist,$lc_sec) = split/:/,$_; |
$response .= "<li>$xlist - ID: $gp</li>\n"; |
$response .= "<li>$xlist - ID: $lc_sec</li>\n"; |
} |
} |
$response .= "</ul><br/><br/>\n"; |
$response .= "</ul><br/><br/>\n"; |
} |
} |
Line 1815 sub print_crosslistings_response () {
|
Line 1812 sub print_crosslistings_response () {
|
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,$prob) = split/:/,$_; |
my ($xlist,$lc_sec,$prob) = split/:/,$_; |
$response .= "<li>$xlist - ID: $gp - Error: $prob</li>\n"; |
$response .= "<li>$xlist - ID: $lc_sec - Error: $prob</li>\n"; |
} |
} |
$response .= "</ul><br/><br/>\n"; |
$response .= "</ul><br/><br/>\n"; |
} |
} |
Line 1824 sub print_crosslistings_response () {
|
Line 1821 sub print_crosslistings_response () {
|
if (@badowner > 0) { |
if (@badowner > 0) { |
$response .= "The courses listed below could not be included in the crosslistings for this LON-CAPA course, because the owner of this course - $owner - does not have rights to view enrollment in those classes as determined by your instititution's policies on access to official classlists.<br/><ul>\n"; |
$response .= "The courses listed below could not be included in the crosslistings for this LON-CAPA course, because the owner of this course - $owner - does not have rights to view enrollment in those classes as determined by your instititution's policies on access to official classlists.<br/><ul>\n"; |
foreach (@badowner) { |
foreach (@badowner) { |
my ($xlist,$gp) = split/:/,$_; |
my ($xlist,$lc_sec) = split/:/,$_; |
$response .= "<li>$xlist - ID: $gp</li>\n"; |
$response .= "<li>$xlist - ID: $lc_sec</li>\n"; |
} |
} |
$response .= "</ul><br/><br/>\n"; |
$response .= "</ul><br/><br/>\n"; |
} |
} |
|
if (@reserved > 0) { |
|
$response .= "The courses listed below could not be included in the crosslistings for this LON-CAPA course, because the section ID associated with the crosslisted course is a reserved word. Please <a href=\"javascript:history(-1)\">go back</a> and change the section ID for each of these courses.<br/><ul>\n"; |
|
foreach (@reserved) { |
|
my ($xlist,$lc_sec) = split/:/,$_; |
|
$response .= "<li>$xlist - ID: $lc_sec</li>\n"; |
|
} |
|
$response .= "</ul><br/><br/>\n"; |
|
} |
|
|
|
if (@matchgroup > 0) { |
|
$response .= "The courses listed below could not be included in the crosslistings for this LON-CAPA course, because the section ID associated with the crosslisted course is the name of a group in this course. Please <a href=\"javascript:history(-1)\">go back</a> and change the section ID for each of these courses.<br/><ul>\n"; |
|
foreach (@matchgroup) { |
|
my ($xlist,$lc_sec) = split/:/,$_; |
|
$response .= "<li>$xlist - ID: $lc_sec</li>\n"; |
|
} |
|
$response .= "</ul><br/><br/>\n"; |
|
} |
|
|
if (@allxlists > 0) { |
if (@allxlists > 0) { |
$warning = &warning_message($dom,$crs,$action); |
$warning = &warning_message($dom,$crs,$action); |
Line 1864 sub print_sections_menu () {
|
Line 1878 sub print_sections_menu () {
|
|
|
if ( exists($env{'form.secshow'}) ) { |
if ( exists($env{'form.secshow'}) ) { |
for (my $i=0; $i<$env{'form.secshow'}; $i++) { |
for (my $i=0; $i<$env{'form.secshow'}; $i++) { |
my $gp = "loncapasec_".$i; |
my $lc_sec = "loncapasec_".$i; |
my $secnum = "secnum_".$i; |
my $secnum = "secnum_".$i; |
my $sec = "sec_".$i; |
my $sec = "sec_".$i; |
if ( exists( $env{"form.$sec"} ) ) { |
if ( exists( $env{"form.$sec"} ) ) { |
Line 1872 sub print_sections_menu () {
|
Line 1886 sub print_sections_menu () {
|
if ( exists( $env{"form.$secnum"} ) ) { |
if ( exists( $env{"form.$secnum"} ) ) { |
$secentry = $env{"form.$secnum"}.':'; |
$secentry = $env{"form.$secnum"}.':'; |
} |
} |
if ( exists( $env{"form.$gp"} ) ) { |
if ( exists( $env{"form.$lc_sec"} ) ) { |
$secentry .= $env{"form.$gp"}; |
$secentry .= $env{"form.$lc_sec"}; |
} |
} |
if ( grep/^$env{"form.$secnum"}:/,@currsections) { |
if ( grep/^$env{"form.$secnum"}:/,@currsections) { |
push @sections, $secentry; |
push @sections, $secentry; |
Line 1884 sub print_sections_menu () {
|
Line 1898 sub print_sections_menu () {
|
if ($coursecheck eq 'ok') { |
if ($coursecheck eq 'ok') { |
my $addcheck = &Apache::lonnet::auto_new_course($crs,$dom,$newsec,$owner); |
my $addcheck = &Apache::lonnet::auto_new_course($crs,$dom,$newsec,$owner); |
if ($addcheck eq 'ok') { |
if ($addcheck eq 'ok') { |
push @sections,$env{"form.$secnum"}.":".$env{"form.$gp"}; |
push @sections,$env{"form.$secnum"}.":".$env{"form.$lc_sec"}; |
$seccount ++; |
$seccount ++; |
$addcount ++; |
$addcount ++; |
} else { |
} else { |
push @badowner,$env{"form.$secnum"}.":".$env{"form.$gp"}; |
push @badowner,$env{"form.$secnum"}.":".$env{"form.$lc_sec"}; |
} |
} |
} else { |
} else { |
push @badsections, $env{"form.$secnum"}.":".$env{"form.$gp"}.":".$coursecheck; |
push @badsections, $env{"form.$secnum"}.":".$env{"form.$lc_sec"}.":".$coursecheck; |
} |
} |
} |
} |
} |
} |
Line 1909 sub print_sections_menu () {
|
Line 1923 sub print_sections_menu () {
|
} elsif (@currsections > 0) { |
} 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 $lc_sec = "lcsec_".$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.$lc_sec"}) ) { |
$secentry .= $env{"form.$gp"}; |
$secentry .= $env{"form.$lc_sec"}; |
} |
} |
push @sections,$secentry; |
push @sections,$secentry; |
$seccount ++; |
$seccount ++; |
Line 1943 sections which contribute to enrollment
|
Line 1957 sections which contribute to enrollment
|
if ($seccount > 0) { |
if ($seccount > 0) { |
$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"; |
$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,$lc_sec) = split/:/,$_; |
$response .= "<li>$sec - ID: $gp</li>\n"; |
$response .= "<li>$sec - ID: $lc_sec</li>\n"; |
} |
} |
$response .= "</ul><br/>\n"; |
$response .= "</ul><br/>\n"; |
} |
} |
Line 1953 sections which contribute to enrollment
|
Line 1967 sections which contribute to enrollment
|
if (@badsections > 0) { |
if (@badsections > 0) { |
$response .= "The sections listed below could not be included in the sections for this LON-CAPA course, because they are not valid section numbers according to your institution's official schedule of classes and sections.<br/><ul>\n"; |
$response .= "The sections listed below could not be included in the sections for this LON-CAPA course, because they are not valid section numbers according to your institution's official schedule of classes and sections.<br/><ul>\n"; |
foreach (@badsections) { |
foreach (@badsections) { |
my ($secnum,$gp,$prob) = split/:/,$_; |
my ($secnum,$lc_sec,$prob) = split/:/,$_; |
$response .= "<li>$secnum - ID: $gp - Error: $prob</li>\n"; |
$response .= "<li>$secnum - ID: $lc_sec - Error: $prob</li>\n"; |
} |
} |
$response .= "</ul><br/><br/>\n"; |
$response .= "</ul><br/><br/>\n"; |
} |
} |
Line 1962 sections which contribute to enrollment
|
Line 1976 sections which contribute to enrollment
|
if (@badowner > 0) { |
if (@badowner > 0) { |
$response .= "The sections listed below could not be included in the sections for this LON-CAPA course, because the owner of this course - $owner - does not have rights to view enrollment in those classes as determined by your instititution's policies on access to official classlists.<br/><ul>\n"; |
$response .= "The sections listed below could not be included in the sections for this LON-CAPA course, because the owner of this course - $owner - does not have rights to view enrollment in those classes as determined by your instititution's policies on access to official classlists.<br/><ul>\n"; |
foreach (@badowner) { |
foreach (@badowner) { |
my ($secnum,$gp) = split/:/,$_; |
my ($secnum,$lc_sec) = split/:/,$_; |
$response .= "<li>$secnum - ID: $gp</li>\n"; |
$response .= "<li>$secnum - ID: $lc_sec</li>\n"; |
} |
} |
$response .= "</ul><br/><br/>\n"; |
$response .= "</ul><br/><br/>\n"; |
} |
} |
Line 1981 sections which contribute to enrollment
|
Line 1995 sections which contribute to enrollment
|
if ($numsec > 0) { |
if ($numsec > 0) { |
my @bgcolors=("#eeeeee","#cccccc"); |
my @bgcolors=("#eeeeee","#cccccc"); |
$response .= qq( |
$response .= qq( |
You indicated that you wish to incorporate student enrollment in your LON-CAPA course from an additional $numsec section(s). For each new section enter the insititutional section code (e.g., 004), and the LON-CAPA section/group ID you wish to assign to students who will be enrolled in your LON-CAPA class as a result of their registration in this particular section. The LON-CAPA section/group ID can be left blank, if you do not wish to designate a section/group ID for this course section. The institutional section code should only contain letters and/or numbers, and must be consistent with the scheme adopted by your Domain Coordinator to map course section numbers to your institution\'s student information system.<br/><br/> |
You indicated that you wish to incorporate student enrollment in your LON-CAPA course from an additional $numsec section(s). For each new section enter the insititutional section code (e.g., 004), and the LON-CAPA section ID you wish to assign to students who will be enrolled in your LON-CAPA class as a result of their registration in this particular section. The LON-CAPA section ID can be left blank, if you do not wish to designate a section ID for this course section. The institutional section code should only contain letters and/or numbers, and must be consistent with the scheme adopted by your Domain Coordinator to map course section numbers to your institution\'s student information system.<br/><br/> |
<form name="enter" method="post"> |
<form name="enter" method="post"> |
<table border="0" cellpadding="2" cellspacing="2" width="100%"> |
<table border="0" cellpadding="2" cellspacing="2" width="100%"> |
<tr> |
<tr> |
<td> |
<td>); |
<table border="0" cellspacing="3" cellpadding="3"> |
$response .= &Apache::loncommon::start_data_table(); |
<tr bgcolor="#CCCCFF" align="left"> |
$response .= &Apache::loncommon::start_data_table_row(); |
<td><b>Section number</b></td> |
$response .= qq( |
<td><b>LON-CAPA section/groupID</b></td> |
<th>Section number</th> |
</tr> |
<th>LON-CAPA section ID</th> |
); |
); |
|
$response .= &Apache::loncommon::end_data_table_row(); |
for (my $i=0; $i<$numsec; $i++) { |
for (my $i=0; $i<$numsec; $i++) { |
my $colflag = $i%2; |
$response .= &Apache::loncommon::start_data_table_row(); |
$response .= qq( |
$response .= qq( |
<tr bgcolor="$bgcolors[$colflag]" align="left"> |
<td><input type="text" size="10" name="newsec_$i" /></td> |
<td><input type="text" size="15" name="newsec_$i" /></td> |
<td align="right"> |
<td><input type="text" size="10" name="newsecgp_$i" /></td> |
<input type="text" size="10" name="newlcsec_$i" /> |
</tr> |
</td> |
); |
); |
|
$response .= &Apache::loncommon::end_data_table_row(); |
} |
} |
$response .= qq( </table> |
$response .= &Apache::loncommon::end_data_table(); |
|
$response .= qq( |
</td> |
</td> |
</tr> |
</tr> |
<tr> |
<tr> |
Line 2029 sub print_sections_response () {
|
Line 2046 sub print_sections_response () {
|
my @allsections = (); |
my @allsections = (); |
my @badowner = (); |
my @badowner = (); |
my @badsections = (); |
my @badsections = (); |
|
my @reserved = (); |
|
my @matchgroup = (); |
my $numsec = 0; |
my $numsec = 0; |
my $secstr = $settings{'internal.sectionnums'}; |
my $secstr = $settings{'internal.sectionnums'}; |
my $coursecode = $settings{'internal.coursecode'}; |
my $coursecode = $settings{'internal.coursecode'}; |
Line 2046 sub print_sections_response () {
|
Line 2065 sub print_sections_response () {
|
} |
} |
|
|
if ($numsec > 0) { |
if ($numsec > 0) { |
|
my %curr_groups = &Apache::loncommon::coursegroups(); |
for (my $i=0; $i<$numsec; $i++) { |
for (my $i=0; $i<$numsec; $i++) { |
my $sec = "newsec_".$i; |
my $sec = "newsec_".$i; |
my $gp = "newsecgp_".$i; |
my $lc_sec = "newlcsec_".$i; |
if ( exists($env{"form.$sec"}) ) { |
if ( exists($env{"form.$sec"}) ) { |
unless ( (grep/^$env{"form.$sec"}:/,@allsections) || (grep/^$env{"form.$sec"}:/,@sections) ) { |
unless ( (grep/^$env{"form.$sec"}:/,@allsections) || (grep/^$env{"form.$sec"}:/,@sections) ) { |
|
my $lc_sec_check = &validate_lcsec(\%curr_groups, $env{"form.$lc_sec"}); |
|
if ($lc_sec_check eq 'reserved') { |
|
push(@reserved,$env{"form.$sec"}.":".$env{"form.$lc_sec"}); |
|
next; |
|
} elsif ($lc_sec_check eq 'group') { |
|
push (@matchgroup,$env{"form.$sec"}.":".$env{"form.$lc_sec"}); |
|
next; |
|
} |
my $newsec = $coursecode.$env{"form.$sec"}; |
my $newsec = $coursecode.$env{"form.$sec"}; |
my $coursecheck = &Apache::lonnet::auto_validate_courseID($crs,$dom,$newsec); |
my $coursecheck = &Apache::lonnet::auto_validate_courseID($crs,$dom,$newsec); |
if ($coursecheck eq 'ok') { |
if ($coursecheck eq 'ok') { |
my $addcheck = &Apache::lonnet::auto_new_course($crs,$dom,$newsec,$owner); |
my $addcheck = &Apache::lonnet::auto_new_course($crs,$dom,$newsec,$owner); |
if ($addcheck eq 'ok') { |
if ($addcheck eq 'ok') { |
push @sections,$env{"form.$sec"}.":".$env{"form.$gp"}; |
push @sections,$env{"form.$sec"}.":".$env{"form.$lc_sec"}; |
} else { |
} else { |
push @badowner,$env{"form.$sec"}.":".$env{"form.$gp"}; |
push @badowner,$env{"form.$sec"}.":".$env{"form.$lc_sec"}; |
} |
} |
} else { |
} else { |
push @badsections, $env{"form.$sec"}.":".$env{"form.$gp"}.":".$coursecheck; |
push @badsections, $env{"form.$sec"}.":".$env{"form.$lc_sec"}.":".$coursecheck; |
} |
} |
} |
} |
} |
} |
Line 2082 sub print_sections_response () {
|
Line 2110 sub print_sections_response () {
|
if ($putreply =~ /^ok/) { |
if ($putreply =~ /^ok/) { |
$response = "Students enrolling in the sections listed below will be automatically added to the class roster for LON-CAPA course $realm ($coursecode), if you have chosen to enable a nightly automated enrollment update.<br/><ul>\n"; |
$response = "Students enrolling in the sections listed below will be automatically added to the class roster for LON-CAPA course $realm ($coursecode), if you have chosen to enable a nightly automated enrollment update.<br/><ul>\n"; |
foreach (@allsections) { |
foreach (@allsections) { |
my ($sec,$gp) = split/:/,$_; |
my ($sec,$lc_sec) = split/:/,$_; |
$response .= "<li>$sec - ID: $gp</li>\n"; |
$response .= "<li>$sec - ID: $lc_sec</li>\n"; |
} |
} |
$response .= "</ul><br/><br/>\n"; |
$response .= "</ul><br/><br/>\n"; |
} |
} |
Line 2091 sub print_sections_response () {
|
Line 2119 sub print_sections_response () {
|
if (@badsections > 0) { |
if (@badsections > 0) { |
$response .= "The sections listed below could not be included in the sections for this LON-CAPA course, because they are not valid section numbers according to your institution's official schedule of classes and sections.<br/><ul>\n"; |
$response .= "The sections listed below could not be included in the sections for this LON-CAPA course, because they are not valid section numbers according to your institution's official schedule of classes and sections.<br/><ul>\n"; |
foreach (@badsections) { |
foreach (@badsections) { |
my ($secnum,$gp,$prob) = split/:/,$_; |
my ($secnum,$lc_sec,$prob) = split/:/,$_; |
$response .= "<li>$secnum - ID: $gp - Error: $prob</li>\n"; |
$response .= "<li>$secnum - ID: $lc_sec - Error: $prob</li>\n"; |
} |
} |
$response .= "</ul><br/><br/>\n"; |
$response .= "</ul><br/><br/>\n"; |
} |
} |
Line 2100 sub print_sections_response () {
|
Line 2128 sub print_sections_response () {
|
if (@badowner > 0) { |
if (@badowner > 0) { |
$response .= "The sections listed below could not be included in the sections for this LON-CAPA course, because the owner of this course - $owner - does not have rights to view enrollment in those classes as determined by your instititution's policies on access to official classlists.<br/><ul>\n"; |
$response .= "The sections listed below could not be included in the sections for this LON-CAPA course, because the owner of this course - $owner - does not have rights to view enrollment in those classes as determined by your instititution's policies on access to official classlists.<br/><ul>\n"; |
foreach (@badowner) { |
foreach (@badowner) { |
my ($secnum,$gp) = split/:/,$_; |
my ($secnum,$lc_sec) = split/:/,$_; |
$response .= "<li>$secnum - ID: $gp</li>\n"; |
$response .= "<li>$secnum - ID: $lc_sec</li>\n"; |
} |
} |
$response .= "</ul><br/><br/>\n"; |
$response .= "</ul><br/><br/>\n"; |
} |
} |
|
|
|
if (@reserved > 0) { |
|
$response .= "The sections listed below could not be included in the sections for this LON-CAPA course, because the section ID associated with the institutional section is a reserved word. Please <a href=\"javascript:history.go(-1)\">go back</a> and change the section ID for each of these sections.<br/><ul>\n"; |
|
foreach (@reserved) { |
|
my ($xlist,$lc_sec) = split/:/,$_; |
|
$response .= "<li>$xlist - ID: $lc_sec</li>\n"; |
|
} |
|
$response .= "</ul><br/><br/>\n"; |
|
} |
|
|
|
if (@matchgroup > 0) { |
|
$response .= "The sections listed below could not be included in the sections for this LON-CAPA course, because the section ID associated with the institutional section is the name of a group in this course. Please <a href=\"javascript:history.go(-1)\">go back</a> and change the section ID for each of these sections.<br/><ul>\n"; |
|
foreach (@matchgroup) { |
|
my ($xlist,$lc_sec) = split/:/,$_; |
|
$response .= "<li>$xlist - ID: $lc_sec</li>\n"; |
|
} |
|
$response .= "</ul><br/><br/>\n"; |
|
} |
|
|
|
|
if (@allsections > 0) { |
if (@allsections > 0) { |
$warning = &warning_message($dom,$crs,$action); |
$warning = &warning_message($dom,$crs,$action); |
$warn_prefix = "<br/><font size ='+1'><b>Warning</b></font>. Although you have selected sections to contribute enrollment to this course, additional action is required.<br/>"; |
$warn_prefix = "<br/><font size ='+1'><b>Warning</b></font>. Although you have selected sections to contribute enrollment to this course, additional action is required.<br/>"; |
Line 2486 sub get_institutional_codes {
|
Line 2533 sub get_institutional_codes {
|
foreach (@currsections) { |
foreach (@currsections) { |
if (m/^(\w+):(\w*)$/) { |
if (m/^(\w+):(\w*)$/) { |
my $sec = $coursecode.$1; |
my $sec = $coursecode.$1; |
my $gp = $2; |
my $lc_sec = $2; |
unless (grep/^$sec$/,@{$allcourses}) { |
unless (grep/^$sec$/,@{$allcourses}) { |
push @{$allcourses},$sec; |
push @{$allcourses},$sec; |
$$LC_code{$sec} = $gp; |
$$LC_code{$sec} = $lc_sec; |
} |
} |
} |
} |
} |
} |
Line 2804 sub date_setting_table {
|
Line 2851 sub date_setting_table {
|
return ($start_table, $end_table); |
return ($start_table, $end_table); |
} |
} |
|
|
|
sub validate_lcsec { |
|
my ($curr_groups,$lcsec) = @_; |
|
if (($lcsec eq 'all') || ($lcsec eq 'none')) { |
|
return 'reserved'; |
|
} else { |
|
if (exists($$curr_groups{$lcsec})) { |
|
return 'group'; |
|
} |
|
} |
|
return 'ok'; |
|
} |
|
|
################################################################### |
################################################################### |
sub handler { |
sub handler { |
my $r = shift; |
my $r = shift; |