version 1.1, 2003/12/26 16:30:17
|
version 1.26, 2006/07/11 02:28:22
|
Line 1
|
Line 1
|
|
# The LearningOnline Network with CAPA |
|
# automated enrollment course setup handler |
|
# |
|
# $Id$ |
|
# |
|
# 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::lonmodifycourse; |
package Apache::lonmodifycourse; |
|
|
use strict; |
use strict; |
Line 8 use Apache::lonlocal;
|
Line 35 use Apache::lonlocal;
|
use Apache::londropadd; |
use Apache::londropadd; |
use LONCAPA::Enrollment; |
use LONCAPA::Enrollment; |
use lib '/home/httpd/lib/perl'; |
use lib '/home/httpd/lib/perl'; |
use localenroll; |
use LONCAPA; |
|
|
sub print_course_selection_page { |
sub print_course_selection_page { |
my ($r,$tasklongref) = @_; |
my ($r,$tasklongref) = @_; |
my $dom = $ENV{'user.domain'}; |
my $dom = $env{'request.role.domain'}; |
my %lt=&Apache::lonlocal::texthash( |
my %lt=&Apache::lonlocal::texthash( |
'incs' => "Internal course settings", |
'csae' => "Course settings for automated enrollment", |
'stat' => "Although the majority of course settings for LON-CAPA courses may be modified by a Course Coordinator, there are a small number of settings which may only be modified by a Domain Coordinator. These particular course parameters control automated student enrollment in LON-CAPA courses based on classlist data available from your institution's student information system.", |
'unst' => "Unlike standard LON-CAPA course parameters, such as course description, feedback addresses, and top level map, which are displayed and/or modified using the 'Course Environment Parameters' screen, settings that control automated enrollment based on classlist data available from your institution's student information system are handled differently. Automated enrollment settings fall into two groups: (a) settings that can be modified by a Course Coordinator using the Automated Enrollment Manager and (b) settings that may only be modified by a Domain Coordinator via the 'View/Modify Course settings' menu accessed from this page.", |
'chcs' => "Once you have chosen the course for which you wish to view/modify internal settings, click 'Go' to proceed", |
'chcs' => "Choose the course for which you wish to view/modify automated enrollment settings from the select box below and click 'Go' to proceed.", |
|
'eaen' => "Each entry in the select box contains: <b>course code</b> -- <b>course title</b> ------- <b>course owner</b>, and entries are ordered alphabetically by course code.", |
|
'psac' => "Please select a course", |
'ccrs' => "Choose a course", |
'ccrs' => "Choose a course", |
'gobt' => "Go" |
'gobt' => "Go" |
); |
); |
|
|
# Determine the courses |
# Determine the courses |
my %courseIDs = &Apache::lonnet::courseiddump($dom,'.',1); |
my %courseIDs = &Apache::lonnet::courseiddump($dom,'.',1,'.','.','.',undef,undef,'.'); |
&print_header($r,$tasklongref); |
&print_header($r,$tasklongref); |
$r->print(<<ENDBLOCK); |
$r->print(<<ENDBLOCK); |
<form action="/adm/modifycourse" method="post" name="cmods"> |
<form action="/adm/modifycourse" method="post" name="cmod"> |
<h2>$lt{'incs'}</h2> |
<h3>$lt{'csae'}</h3> |
<p>$lt{'stat'} |
<p>$lt{'unst'} |
</p><p>$lt{'chcs'} |
</p><p>$lt{'chcs'} |
</p> |
<br/>$lt{'eaen'} |
|
</p><p> |
<b>$lt{'ccrs'}:</b> |
<b>$lt{'ccrs'}:</b> |
<select name="course"> |
<select name="course"> |
<option value="0" />Please select a course |
<option value="0" />$lt{'psac'} |
<option value="-1" />--------------------------------------------------- |
<option value="-1" />--------------------------------------------------- |
ENDBLOCK |
ENDBLOCK |
my $iter = 0; |
my $iter = 0; |
Line 41 ENDBLOCK
|
Line 71 ENDBLOCK
|
foreach my $key (sort keys %courseIDs) { |
foreach my $key (sort keys %courseIDs) { |
# Get current code |
# Get current code |
my $crs; |
my $crs; |
my $currcode; |
my ($description,$currcode,$owner); |
if ($key =~ m/^($dom)_(\w+)$/) { |
if ($courseIDs{$key} =~ m/^([^:]*):([^:]+)/ ) { |
|
$currcode = $2; |
|
} elsif ($key =~ m/^($dom)_(\w+)$/) { |
$crs = $2; |
$crs = $2; |
my %settings = &Apache::lonnet::get('environment',['internal.coursecode'],$dom,$crs); |
my %settings = &Apache::lonnet::get('environment',['internal.coursecode'],$dom,$crs); |
if (defined($settings{'internal.coursecode'}) ) { |
if (defined($settings{'internal.coursecode'}) ) { |
$currcode = $settings{'internal.coursecode'}; |
$currcode = $settings{'internal.coursecode'}; |
if ($currcode eq '') { |
|
$currcode = "___".$iter; |
|
$iter ++; |
|
} |
|
} else { |
|
$currcode = "___".$iter; |
|
$iter ++; |
|
} |
} |
} else { |
} |
|
if ($currcode eq '') { |
$currcode = "___".$iter; |
$currcode = "___".$iter; |
$iter ++; |
$iter ++; |
} |
} |
unless (grep/^$currcode$/,@codes) { |
unless (grep/^$currcode$/,@codes) { |
push @codes,$currcode; |
push @codes,$currcode; |
Line 75 ENDBLOCK
|
Line 101 ENDBLOCK
|
unless ($code =~m/^___\d+$/) { $showcode = $code; } |
unless ($code =~m/^___\d+$/) { $showcode = $code; } |
if ($item =~ m/^($dom)_(\w+)$/) { |
if ($item =~ m/^($dom)_(\w+)$/) { |
$crs = $2; |
$crs = $2; |
$description = $courseIDs{$item}; |
if ($courseIDs{$item} =~ /^([^:]*):([^:]*):([^:]*)/) { |
|
$description = &unescape($1); |
|
$owner = &unescape($3); |
|
if (($owner ne '') && ($owner !~ /^([^:]+):([^:]+)$/)) { |
|
$owner = $owner.':'.$dom; |
|
} |
|
} elsif ($courseIDs{$item} =~ /^([^:]*):([^:]*)$/) { |
|
$description = &unescape($1); |
|
} else { |
|
$description = &unescape($courseIDs{$item}); |
|
} |
# Get course owner |
# Get course owner |
my %settings = &Apache::lonnet::get('environment',['internal.courseowner'],$dom,$crs); |
if ($owner eq '') { |
if ( defined($settings{'internal.courseowner'}) ) { |
my %settings = &Apache::lonnet::get('environment',['internal.courseowner'],$dom,$crs); |
$owner = $settings{'internal.courseowner'}; |
if ( defined($settings{'internal.courseowner'}) ) { |
$ownername = &Apache::loncommon::plainname($owner,$dom); |
$owner = $settings{'internal.courseowner'}; |
|
} |
|
} |
|
unless ($owner eq '') { |
|
my ($owneruname,$ownerdom); |
|
if ($owner =~ /^([^:]+):([^:]+)$/) { |
|
$owneruname = $1; |
|
$ownerdom = $2; |
|
} else { |
|
$owneruname = $owner; |
|
$ownerdom = $dom; |
|
} |
|
$ownername = &Apache::loncommon::plainname($owneruname, |
|
$ownerdom); |
} |
} |
$r->print("<option value=\"$crs\">$showcode -- $description ---------- $ownername"); |
$r->print("<option value=\"$crs\">$showcode -- $description ---------- $ownername"); |
} |
} |
Line 99 ENDBLOCK
|
Line 148 ENDBLOCK
|
sub print_course_modification_page { |
sub print_course_modification_page { |
my ($r,$tasklongref,$typeref) = @_; |
my ($r,$tasklongref,$typeref) = @_; |
my %enrollvar = (); |
my %enrollvar = (); |
|
my $javascript_validations; |
|
my $course = ''; |
|
my $dom = $env{'request.role.domain'}; |
|
if ( defined($env{'form.course'}) ) { |
|
$course = $env{'form.course'}; |
|
} |
|
my $ok_course = 'ok'; |
|
if ( ($course == -1) || ($course == '-2') || ($course eq '') ) { |
|
$ok_course = 'invalid'; |
|
} else { |
|
$ok_course = &check_course($dom,$course); |
|
} |
|
|
|
unless ($ok_course eq 'ok') { |
|
&print_header($r,$tasklongref,'',\$javascript_validations); |
|
my $reply = "<br/>".&mt("The LON-CAPA course selected was not a valid course for this domain"); |
|
$r->print($reply); |
|
&print_footer($r); |
|
return; |
|
} |
|
|
my @bgcolors=("#eeeeee","#cccccc"); |
my @bgcolors=("#eeeeee","#cccccc"); |
my $course = $ENV{'form.course'}; |
|
my $dom = $ENV{'user.domain'}; |
|
my $ownertable; |
my $ownertable; |
|
my %lt=&Apache::lonlocal::texthash( |
|
'actv' => "Active", |
|
'inac' => "Inactive", |
|
'ccor' => "Course Coordinator", |
|
'noen' => "No end date", |
|
'ownr' => "Owner", |
|
'name' => "Name", |
|
'unme' => "Username:Domain", |
|
'stus' => "Status", |
|
'aecs' => "Automated Enrollment Course Settings", |
|
'cose' => "Course settings for LON-CAPA courses that control automated student enrollment based on classlist data available from your institution's student information system fall into two groups: (a) settings that can be modified by a Course Coordinator using the ", |
|
'aenm' => "Automated Enrollment Manager", |
|
'andb' => " and (b) settings that may only be modified by a Domain Coordinator via this page.", |
|
'caes' => 'Current automated enrollment settings', |
|
'cour' => "Course settings that control automated enrollment in this LON-CAPA course |
|
are currently:", |
|
'cset' => "Course setting", |
|
'valu' => "Current value", |
|
'nocc' => "There is currently no course owner set for this course. In addition, no active course coordinators from this LON-CAPA domain were found, so you will not be able assign a course owner. If you wish to assign a course owner, it is recommended that you use the 'User Roles' screen to add a course coordinator with a LON-CAPA account in this domain to the course.", |
|
'ccus' => "A course coordinator can use the 'Automated Enrollment Manager' to change |
|
all settings except course code, course owner, and default authentication method for students added to your course (who are also new to the LON-CAPA system at this domain).", |
|
'mkch' => "Make changes to course settings set by Domain Coordinator", |
|
'ccod' => "Course Code", |
|
'ccus' => "The course code is used during automated enrollment to map the internal LON-CAPA course ID for this course to the corresponding course section ID(s) used by the office responsible for providing official class lists for courses at your institution.", |
|
'cown' => "Course Owner", |
|
'cous' => "The course owner is used in the retrieval of class lists from your institution's student information system when access to class lists data incorporates validation of instructor status.", |
|
'tabl' => 'The table below contains a list of active course coordinators in this course, who are from this domain', |
|
'usrd' => 'Use the radio buttons to select a different course owner.', |
|
'deam' => "Default Authentication method", |
|
'deus' => "The default authentication method, and default authentication parameter (domain, initial password or argument) are used when automatic enrollment of students in a course requires addition of new user accounts in your domain, and the class list file contains empty entries for the <authtype> and <autharg> properties for the new student. If you choose 'internally authenticated', and leave the initial password field empty, the automated enrollment process will create a randomized password for each new student account that it adds to your LON-CAPA domain.", |
|
'gobt' => "Modify settings", |
|
); |
|
|
my %settings = &Apache::lonnet::dump('environment',$dom,$course); |
my %settings = &Apache::lonnet::dump('environment',$dom,$course); |
|
$enrollvar{'autharg'} = ''; |
|
$enrollvar{'authtype'} = ''; |
foreach my $item (keys %settings) { |
foreach my $item (keys %settings) { |
if ($item =~ m/^internal\.(.+)$/) { |
if ($item =~ m/^internal\.(.+)$/) { |
if ( ($1 eq "autoadds") || ($1 eq "autodrops") ) { |
my $type = $1; |
|
|
|
if ( ($type eq "autoadds") || ($type eq "autodrops") ) { |
if ($settings{$item} == 1) { |
if ($settings{$item} == 1) { |
$enrollvar{$1} = "ON"; |
$enrollvar{$type} = "ON"; |
} else { |
} else { |
$enrollvar{$1} = "OFF"; |
$enrollvar{$type} = "OFF"; |
} |
} |
} elsif ( ($1 eq "autostart") || ($1 eq "autoend") ) { |
} elsif ( ($type eq "autostart") || ($type eq "autoend") ) { |
if ( ($1 eq "autoend") && ($settings{$item} == 0) ) { |
if ( ($type eq "autoend") && ($settings{$item} == 0) ) { |
$enrollvar{$1} = "No end date"; |
$enrollvar{$type} = $lt{'noen'}; |
} else { |
} else { |
$enrollvar{$1} = localtime($settings{$item}); |
$enrollvar{$type} = localtime($settings{$item}); |
} |
} |
|
} elsif ($type eq "sectionums") { |
|
$enrollvar{$type} = $settings{$item}; |
|
$enrollvar{$type} =~ s/,/, /g; |
|
} elsif ($type eq "authtype" |
|
|| $type eq "autharg" || $type eq "coursecode" |
|
|| $type eq "crosslistings") { |
|
$enrollvar{$type} = $settings{$item}; |
|
} elsif ($type eq 'courseowner') { |
|
if ($settings{$item} =~ /^[^:]+:[^:]+$/) { |
|
$enrollvar{$type} = $settings{$item}; |
|
} else { |
|
if ($settings{$item} ne '') { |
|
$enrollvar{$type} = $settings{$item}.':'.$dom; |
|
} |
|
} |
|
} |
|
} elsif ($item =~ m/^default_enrollment_(start|end)_date$/) { |
|
my $type = $1; |
|
if ( ($type eq 'end') && ($settings{$item} == 0) ) { |
|
$enrollvar{$item} = $lt{'noen'}; |
|
} elsif ( ($type eq 'start') && ($settings{$item} eq '') ) { |
|
$enrollvar{$item} = 'When enrolled'; |
} else { |
} else { |
$enrollvar{$1} = $settings{$item}; |
$enrollvar{$item} = localtime($settings{$item}); |
} |
} |
} |
} |
} |
} |
Line 129 sub print_course_modification_page {
|
Line 256 sub print_course_modification_page {
|
my %cc_status = (); |
my %cc_status = (); |
my %pname = (); |
my %pname = (); |
my $active_cc; |
my $active_cc; |
foreach (@coursepersonnel) { |
foreach my $person (@coursepersonnel) { |
my @roleinfo = split/:/,$_; |
my ($role,$user) = split(/:/,$person,2); |
if ( ($roleinfo[0] eq 'cc') && ($roleinfo[2] eq $dom) ) { |
$user =~ s/:$//; |
unless (grep/^$roleinfo[1]$/,@local_ccs) { |
if (($role eq 'cc') && ($user ne '')) { |
$active_cc = &LONCAPA::Enrollment::check_user_status($roleinfo[2],$roleinfo[1],$dom,$course,'cc'); |
if (!grep(/^\Q$user\E$/,@local_ccs)) { |
if ($active_cc eq 'ok') { |
my ($ccname,$ccdom) = split(/:/,$user); |
push @local_ccs, $roleinfo[1]; |
$active_cc = |
$pname{$roleinfo[1]} = &Apache::loncommon::plainname($roleinfo[1],$roleinfo[2]); |
&Apache::loncommon::check_user_status($ccdom,$ccname,$dom, |
$cc_status{$roleinfo[1]} = 'Active'; |
$course,'cc'); |
|
if ($active_cc eq 'active') { |
|
push(@local_ccs,$user); |
|
$pname{$user} = &Apache::loncommon::plainname($ccname,$ccdom); |
|
$cc_status{$user} = $lt{'actv'}; |
} |
} |
} |
} |
} |
} |
} |
} |
unless ( (grep/^$enrollvar{'courseowner'}$/,@local_ccs) || ($enrollvar{'courseowner'} eq '') ) { |
if ( (!grep(/^$enrollvar{'courseowner'}$/,@local_ccs)) && |
push @local_ccs, $enrollvar{'coursecode'}; |
($enrollvar{'courseowner'} ne '') ) { |
my ($puname,$pdom) = split/\@/,$enrollvar{'courseowner'}; |
my ($owneruname,$ownerdom) = split(/:/,$enrollvar{'courseowner'}); |
$pname{$enrollvar{'courseowner'}} = &Apache::loncommon::plainname($puname,$pdom); |
push(@local_ccs,$enrollvar{'courseowner'}); |
$active_cc = &LONCAPA::Enrollment::check_user_status($pdom,$enrollvar{'coursecode'},$dom,$course,'cc'); |
$pname{$enrollvar{'courseowner'}} = |
if ($active_cc eq 'ok') { |
&Apache::loncommon::plainname($owneruname,$ownerdom); |
$cc_status{$enrollvar{'courseowner'}} = 'Active'; |
$active_cc = &Apache::loncommon::check_user_status($ownerdom,$owneruname, |
|
$dom,$course,'cc'); |
|
if ($active_cc eq 'active') { |
|
$cc_status{$enrollvar{'courseowner'}} = $lt{'actv'}; |
} else { |
} else { |
$cc_status{$enrollvar{'courseowner'}} = 'Inactive'; |
$cc_status{$enrollvar{'courseowner'}} = $lt{'inac'}; |
} |
} |
} |
} |
my $numlocalcc = @local_ccs; |
my $numlocalcc = @local_ccs; |
my $bodytag=&Apache::loncommon::bodytag('Modify Course Settings'); |
|
my $helplink=&Apache::loncommon::help_open_topic('Modify_Course',&mt('Help on Modifying Courses')); |
my $helplink=&Apache::loncommon::help_open_topic('Modify_Course',&mt("Help on Modifying Courses")); |
my $defdom=$ENV{'request.role.domain'}; |
my ($krbdef,$krbdefdom)=&Apache::loncommon::get_kerberos_defaults($dom); |
my ($krbdef,$krbdefdom)=&Apache::loncommon::get_kerberos_defaults($defdom); |
my $curr_authtype = ''; |
my $javascript_validations=&Apache::londropadd::javascript_validations('createcourse',$krbdefdom); |
my $curr_authfield = ''; |
my %param = ( formname => 'document.cmods', |
if ($enrollvar{'authtype'} =~ /^krb/) { |
|
$curr_authtype = 'krb'; |
|
} elsif ($enrollvar{'authtype'} eq 'internal' ) { |
|
$curr_authtype = 'int'; |
|
} elsif ($enrollvar{'authtype'} eq 'localauth' ) { |
|
$curr_authtype = 'loc'; |
|
} |
|
unless ($curr_authtype eq '') { |
|
$curr_authfield = $curr_authtype.'arg'; |
|
} |
|
$javascript_validations=&Apache::londropadd::javascript_validations('modifycourse',$krbdefdom,$curr_authtype,$curr_authfield); |
|
my %param = ( formname => 'document.cmod', |
kerb_def_dom => $krbdefdom, |
kerb_def_dom => $krbdefdom, |
kerb_def_auth => $krbdef |
kerb_def_auth => $krbdef, |
|
mode => 'modifycourse', |
|
curr_authtype => $curr_authtype, |
|
curr_autharg => $enrollvar{'autharg'} |
); |
); |
my $selscript=&Apache::loncommon::studentbrowser_javascript(); |
|
my $sellink=&Apache::loncommon::selectstudent_link |
|
('cmod','crsown','ccdomain'); |
|
my $krbform = &Apache::loncommon::authform_kerberos(%param); |
my $krbform = &Apache::loncommon::authform_kerberos(%param); |
my $intform = &Apache::loncommon::authform_internal(%param); |
my $intform = &Apache::loncommon::authform_internal(%param); |
my $locform = &Apache::loncommon::authform_local(%param); |
my $locform = &Apache::loncommon::authform_local(%param); |
my %lt=&Apache::lonlocal::texthash( |
|
'aecs' => "Automated Enrollment Course Settings", |
|
'cose' => "Course settings for LON-CAPA courses that control automated student enrollment based on classlist data available from your institution's student information system fall into two groups: (a) settings that can be modified by a Course Coordinator using the ", |
|
'aenm' => "Automated Enrollment Manager", |
|
'andb' => " and (b) settings that may only be modified by a Domain Coordinator via this page.", |
|
'caes' => 'Current automated enrollment settings', |
|
'cour' => "Course settings that control automated enrollment in this LON-CAPA course are currently:", |
|
'cset' => "Course setting", |
|
'valu' => "Current value", |
|
'ccus' => "A course coordinator can use the 'Automated Enrollment Manager' to change all settings except course code, course owner, and default authentication method for students added to your course (who are also new to the LON-CAPA system at this domain).", |
|
'mkch' => "Make changes to course settings set by Domain Coordinator", |
|
'ccod' => "Course Code", |
|
'ccus' => "The course code is used during automated enrollment to map the internal LON-CAPA course ID for this course to the corresponding course section ID(s) used by the office responsible for providing official class lists for courses at your institution.", |
|
'cown' => "Course Owner", |
|
'cous' => "The course owner is used in the retrieval of class lists from your institution's student information system when access to class lists data incorporates validation of instructor status.", |
|
'tabl' => 'The table below contains a list of active course coordinators in this course, |
|
who are from this domain', |
|
'usrd' => 'Use the radio buttons to select a different course owner.', |
|
'deam' => "Default Authentication method", |
|
'deus' => "The default authentication method, and default authentication parameter (domain, initial password or argument) are used when automatic enrollment of students in a course requires addition of new user accounts in your domain, and the class list file contains empty entries for the <authtype> and <autharg> properties for the new student.", |
|
'gobt' => "Modify settings", |
|
); |
|
|
|
my $disp_table = qq|<table border="0" cellpadding="0" cellspacing="0"> |
my $disp_table = qq|<table border="0" cellpadding="0" cellspacing="0"> |
<tr> |
<tr> |
Line 211 who are from this domain',
|
Line 334 who are from this domain',
|
<td>$$typeref{$key}</td> |
<td>$$typeref{$key}</td> |
<td>$enrollvar{$key}</td> |
<td>$enrollvar{$key}</td> |
</tr>"; |
</tr>"; |
$iter ++; |
$iter ++; |
} |
} |
$disp_table .= "</table> |
$disp_table .= "</table> |
</td> |
</td> |
Line 222 who are from this domain',
|
Line 345 who are from this domain',
|
</table>"; |
</table>"; |
|
|
if ($numlocalcc == 0) { |
if ($numlocalcc == 0) { |
$ownertable = "No course coordinators"; |
$ownertable = $lt{'nocc'}; |
} |
} |
|
|
if ($numlocalcc > 0) { |
if ($numlocalcc > 0) { |
@local_ccs = sort @local_ccs; |
@local_ccs = sort @local_ccs; |
$ownertable = qq( |
$ownertable = qq( |
Line 244 who are from this domain',
|
Line 368 who are from this domain',
|
<td width="100%" bgcolor="#000000"> |
<td width="100%" bgcolor="#000000"> |
<table border="0" cellpadding="3" cellspacing="3" bgcolor="#FFFFFF"> |
<table border="0" cellpadding="3" cellspacing="3" bgcolor="#FFFFFF"> |
<tr bgcolor="#CCCC99" align="center"> |
<tr bgcolor="#CCCC99" align="center"> |
<td><b>Owner</b></td> |
<td><b>$lt{'ownr'}</b></td> |
<td><b>Name</b></td> |
<td><b>$lt{'name'}</b></td> |
<td><b>Username</b></td> |
<td><b>$lt{'unme'}</b></td> |
<td><b>Status</b></td> |
<td><b>$lt{'stus'}</b></td> |
</tr> |
</tr> |
); |
); |
for (my $i=0; $i<@local_ccs; $i++) { |
for (my $i=0; $i<@local_ccs; $i++) { |
my $colflag = $i%2; |
my $colflag = $i%2; |
$ownertable .= "<tr bgcolor=\"$bgcolors[$colflag]\" align=\"left\">"; |
$ownertable .= "<tr bgcolor=\"$bgcolors[$colflag]\" align=\"left\">"; |
if ($local_ccs[$i] eq $enrollvar{'courseowner'}) { |
if ($local_ccs[$i] eq $enrollvar{'courseowner'}) { |
$ownertable .= "<td><input type=\"radio\" name=\"courseowner\" value=\"$i\" checked=\"true\"/></td>"; |
$ownertable .= "<td><input type=\"radio\" name=\"courseowner\" value=\"$local_ccs[$i]\" checked=\"checked\" /></td>"; |
} else { |
} else { |
$ownertable .= "<td><input type=\"radio\" name=\"courseowner\" value=\"$i\" /></td>"; |
$ownertable .= "<td><input type=\"radio\" name=\"courseowner\" value=\"$local_ccs[$i]\" /></td>"; |
} |
} |
$ownertable .= " |
$ownertable .= " |
<td>$pname{$local_ccs[$i]}</td> |
<td>$pname{$local_ccs[$i]}</td> |
<td><input type=\"hidden\" name=\"username_$i\" value=\"$local_ccs[$i]\" />$local_ccs[$i]</td> |
<td>$local_ccs[$i]</td> |
<td>$cc_status{$local_ccs[$i]} Course Coordinator</td></tr>"; |
<td>$cc_status{$local_ccs[$i]} $lt{'ccor'}</td></tr>"; |
} |
} |
$ownertable .= "</table> |
$ownertable .= "</table> |
</td> |
</td> |
Line 277 who are from this domain',
|
Line 401 who are from this domain',
|
&print_header($r,$tasklongref,$settings{'description'},\$javascript_validations); |
&print_header($r,$tasklongref,$settings{'description'},\$javascript_validations); |
$r->print(<<ENDDOCUMENT); |
$r->print(<<ENDDOCUMENT); |
<form action="/adm/modifycourse" method="post" name="cmod"> |
<form action="/adm/modifycourse" method="post" name="cmod"> |
<h2>$lt{'aecs'}</h2> |
<h3>$lt{'aecs'}</h3> |
$lt{'cose'}<a href="/adm/populate">$lt{'aenm'}</a>$lt{'andb'} |
$lt{'cose'}<a href="/adm/populate">$lt{'aenm'}</a>$lt{'andb'} |
<p> |
<p> |
<table width="100%" cellspacing="0" cellpadding="0"> |
<table width="100%" cellspacing="0" cellpadding="0"> |
Line 302 $disp_table
|
Line 426 $disp_table
|
</tr> |
</tr> |
</table> |
</table> |
</p><p> |
</p><p> |
<table width="100%" cellspacing="3" cellpadding="8"> |
<table width="100%" cellspacing="6" cellpadding="6"> |
|
<tr> |
|
<td colspan="2">Use the appropriate text boxes and radio buttons below to change some or all of the four automated enrollment settings that may only be changed by a Domain Coordinator. Click the <b>"$lt{'gobt'}"</b> button to save your changes.</td> |
|
</tr> |
<tr> |
<tr> |
<td width="50%" valign="top"> |
<td width="50%" valign="top"> |
<b>$lt{'ccod'}</b> |
<b>$lt{'ccod'}:</b> |
<input type="text" size="10" name="coursecode" value="$enrollvar{'coursecode'}"/><br/><br/> |
<input type="text" size="10" name="coursecode" value="$enrollvar{'coursecode'}"/><br/><br/> |
$lt{'ccus'} |
$lt{'ccus'} |
</td> |
</td> |
<td width="50%" valign="top" rowspan="2"> |
<td width="50%" valign="top" rowspan="2"> |
<b>$lt{'cown'}</b><br/><br/> |
<b>$lt{'cown'}:</b><br/><br/> |
$lt{'cous'} |
|
<br/><br/> |
|
$ownertable |
$ownertable |
|
<br/><br/> |
|
$lt{'cous'} |
</td> |
</td> |
</tr> |
</tr> |
<tr> |
<tr> |
<td width="50%" valign="top"> |
<td width="50%" valign="top"> |
<b>$lt{'deam'}.</b><br/><br/> |
<b>$lt{'deam'}:</b><br/><br/> |
|
$krbform |
|
<br/> |
|
$intform |
|
<br/> |
|
$locform |
|
<br/> |
|
<br/> |
$lt{'deus'}. |
$lt{'deus'}. |
</p><p> |
|
$krbform |
|
<br /> |
|
$intform |
|
<br /> |
|
$locform |
|
</td> |
</td> |
<td width="50%"> </td> |
<td width="50%"> </td> |
</tr> |
</tr> |
Line 345 $locform
|
Line 473 $locform
|
<br/> |
<br/> |
ENDDOCUMENT |
ENDDOCUMENT |
&print_footer($r); |
&print_footer($r); |
|
return; |
} |
} |
|
|
sub modify_course { |
sub modify_course { |
my ($r,$tasklongref,$typeref) = @_; |
my ($r,$tasklongref,$typeref) = @_; |
my $dom = $ENV{'user.domain'}; |
my $dom = $env{'user.domain'}; |
my $crs = $ENV{'form.course'}; |
my $crs = $env{'form.course'}; |
my %settings = &Apache::lonnet::get('environment',['internal.courseowner','internal.coursecode','internal.authtype','internal.autharg','internal.sectionnums','internal.crosslistngs','description'],$dom,$crs); |
unless ( &check_course($dom,$crs) eq 'ok' ) { |
|
&print_header($r,$tasklongref); |
|
my $reply = "<br/>".&mt("The LON-CAPA course selected was not a valid course for this domain"); |
|
$r->print($reply); |
|
&print_footer($r); |
|
return; |
|
} |
|
|
|
my %settings = &Apache::lonnet::get('environment',['internal.courseowner','internal.coursecode','internal.authtype','internal.autharg','internal.sectionnums','internal.crosslistings','description'],$dom,$crs); |
my %currattr = (); |
my %currattr = (); |
my %newattr = (); |
my %newattr = (); |
my %cenv = (); |
my %cenv = (); |
Line 390 sub modify_course {
|
Line 527 sub modify_course {
|
my $description = $settings{'description'}; |
my $description = $settings{'description'}; |
my %cenv = (); |
my %cenv = (); |
|
|
if ($ENV{'form.login'} eq 'krb') { |
if ($env{'form.login'} eq 'krb') { |
$newattr{'authtype'} = $ENV{'form.login'}; |
$newattr{'authtype'} = $env{'form.login'}; |
$newattr{'authtype'} .= $ENV{'form.krbver'}; |
$newattr{'authtype'} .= $env{'form.krbver'}; |
$newattr{'autharg'} = $ENV{'form.krbarg'}; |
$newattr{'autharg'} = $env{'form.krbarg'}; |
} elsif ($ENV{'form.login'} eq 'int') { |
} elsif ($env{'form.login'} eq 'int') { |
$newattr{'authtype'} ='internal'; |
$newattr{'authtype'} ='internal'; |
if ((defined($ENV{'form.intarg'})) && ($ENV{'form.intarg'})) { |
if ((defined($env{'form.intarg'})) && ($env{'form.intarg'})) { |
$newattr{'autharg'} = $ENV{'form.intarg'}; |
$newattr{'autharg'} = $env{'form.intarg'}; |
} |
} |
} elsif ($ENV{'form.login'} eq 'loc') { |
} elsif ($env{'form.login'} eq 'loc') { |
$newattr{'authtype'} = 'localauth'; |
$newattr{'authtype'} = 'localauth'; |
if ((defined($ENV{'form.locarg'})) && ($ENV{'form.locarg'})) { |
if ((defined($env{'form.locarg'})) && ($env{'form.locarg'})) { |
$newattr{'autharg'} = $ENV{'form.locarg'}; |
$newattr{'autharg'} = $env{'form.locarg'}; |
} |
} |
} |
} |
if ( $newattr{'authtype'}=~ /^krb/) { |
if ( $newattr{'authtype'}=~ /^krb/) { |
if ($newattr{'autharg'} eq '') { |
if ($newattr{'autharg'} eq '') { |
$warning = qq('<font color="red" size="+1">'. |
$warning = qq(<font color="red" size="+1">). |
&mt('As you did not include the default Kerberos domain to be used for authentication in this class, the institutional data used by the automated enrollment process must include the Kerberos domain for each new student').'</font></p>'); |
&mt("As you did not include the default Kerberos domain to be used for authentication in this class, the institutional data used by the automated enrollment process must include the Kerberos domain for each new student").qq(</font></p>); |
} |
} |
} |
} |
|
|
if ( exists($ENV{'form.courseowner'}) ) { |
if ( exists($env{'form.courseowner'}) ) { |
my $ownerparam = 'username_'.$ENV{'form.courseowner'}; |
$newattr{'courseowner'}=$env{'form.courseowner'}; |
if ( exists($ENV{"form.$ownerparam"}) ) { |
unless ( $newattr{'courseowner'} eq $currattr{'courseowner'} ) { |
$newattr{'courseowner'}=$ENV{"form.$ownerparam"}; |
$changeowner = 1; |
unless ( $newattr{'courseowner'} eq $currattr{'courseowner'} ) { |
|
$changeowner = 1; |
|
} |
|
} |
} |
} |
} |
|
|
if ( exists($ENV{'form.coursecode'}) ) { |
if ( exists($env{'form.coursecode'}) ) { |
$newattr{'coursecode'}=$ENV{'form.coursecode'}; |
$newattr{'coursecode'}=$env{'form.coursecode'}; |
unless ( $newattr{'coursecode'} eq $currattr{'coursecode'} ) { |
unless ( $newattr{'coursecode'} eq $currattr{'coursecode'} ) { |
$changecode = 1; |
$changecode = 1; |
} |
} |
} |
} |
|
if ($changeowner == 1 || $changecode == 1) { |
|
my $courseid_entry = &escape($dom.'_'.$crs).'='.&escape($description).':'.&escape($env{'form.coursecode'}).':'.&escape($env{'form.courseowner'}); |
|
&Apache::lonnet::courseidput($dom,$courseid_entry,&Apache::lonnet::homeserver($crs,$dom)); |
|
} |
|
|
foreach (@params) { |
foreach (@params) { |
if ($currattr{$_} eq $newattr{$_}) { |
if ($currattr{$_} eq $newattr{$_}) { |
Line 440 sub modify_course {
|
Line 578 sub modify_course {
|
} |
} |
|
|
if (@changes > 0) { |
if (@changes > 0) { |
$chgresponse = "The following automated enrollment parameters have been changed:<br/><ul>"; |
$chgresponse = &mt("The following automated enrollment parameters have been changed:<br/><ul>"); |
} |
} |
if (@nochanges > 0) { |
if (@nochanges > 0) { |
$nochgresponse = "The following automated enrollment parameters remain unchanged:<br/><ul>"; |
$nochgresponse = &mt("The following automated enrollment parameters remain unchanged:<br/><ul>"); |
} |
} |
if (@changes > 0) { |
if (@changes > 0) { |
my $putreply = &Apache::lonnet::put('environment',\%cenv,$dom,$crs); |
my $putreply = &Apache::lonnet::put('environment',\%cenv,$dom,$crs); |
if ($putreply !~ /^ok$/) { |
if ($putreply !~ /^ok$/) { |
$response = "There was a problem processing your requested changes. The automated enrollment settings for this course have been left unchanged.<br/>"; |
$response = &mt("There was a problem processing your requested changes. The automated enrollment settings for this course have been left unchanged.<br/>"); |
} else { |
} else { |
foreach my $attr (@params) { |
foreach my $attr (@params) { |
if (grep/^$attr$/,@changes) { |
if (grep/^$attr$/,@changes) { |
$chgresponse .= "<li>$$typeref{$attr} now set to $newattr{$attr}.</li>"; |
$chgresponse .= "<li>$$typeref{$attr} ".&mt("now set to \"").$newattr{$attr}."\".</li>"; |
} else { |
} else { |
$nochgresponse .= "<li>$$typeref{$attr} still set to $currattr{$attr}.</li>"; |
$nochgresponse .= "<li>$$typeref{$attr} ".&mt("still set to \"").$currattr{$attr}."\".</li>"; |
} |
} |
} |
} |
if ($changecode || $changeowner) { |
if ($changecode || $changeowner) { |
if ( $newattr{'courseowner'} eq '') { |
if ( $newattr{'courseowner'} eq '') { |
$warning .= "There is no owner associated with this LON-CAPA course. If automated enrollment in LON-CAPA courses at your institution requires validation of course owners, automated enrollment will fail for this course.<br/>"; |
$warning .= &mt("There is no owner associated with this LON-CAPA course. If automated enrollment in LON-CAPA courses at your institution requires validation of course owners, automated enrollment will fail for this course.<br/>"); |
} else { |
} else { |
if (@sections > 0) { |
if (@sections > 0) { |
foreach my $sec (@sections) { |
if ($changecode) { |
if ($sec =~ m/^(.+):/) { |
foreach my $sec (@sections) { |
my $course_id = $newattr{'coursecode'}.$1; |
if ($sec =~ m/^(.+):/) { |
if ($changecode) { |
my $inst_course_id = $newattr{'coursecode'}.$1; |
# my $course_check = &localenroll::validate_courseID($course_id); |
my $course_check = &Apache::lonnet::auto_validate_courseID($crs,$dom,$inst_course_id); |
my $course_check = 'ok'; |
if ($course_check eq 'ok') { |
if ($course_check eq 'ok') { |
my $outcome = &Apache::lonnet::auto_new_course($crs,$dom,$inst_course_id,$newattr{'courseowner'}); |
# my $outcome = &localenroll::new_course($course_id,$newattr{'courseowner'}); |
|
my $outcome = 'ok'; |
|
unless ($outcome eq 'ok') { |
unless ($outcome eq 'ok') { |
$warning .= "If automatic enrollment is enabled for LON-CAPA course: $description, automated enrollment may fail for $newattr{'coursecode'} - section $1 for the following reason: $outcome.<br/>"; |
$warning .= &mt("If automatic enrollment is enabled for LON-CAPA course: ").$description.&mt(", automated enrollment may fail for ").$newattr{'coursecode'}.&mt(" - section $1 for the following reason: $outcome.<br/>"); |
} |
} |
} else { |
} else { |
$warning .= "If automatic enrollment is enabled for LON-CAPA course: $description, automated enrollment may fail for $newattr{'coursecode'} - section $1 for the following reason: $course_check.<br/>"; |
$warning .= &mt("If automatic enrollment is enabled for LON-CAPA course: ").$description.&mt(", automated enrollment may fail for ").$newattr{'coursecode'}.&mt(" - section $1 for the following reason: $course_check.<br/>"); |
} |
} |
} else { |
} else { |
$warning .= "If automatic enrollment is enabled for LON-CAPA course: $description, automated enrollment may fail for $newattr{'coursecode'} - section $sec because this is not a valid section entry.<br/>"; |
$warning .= &mt("If automatic enrollment is enabled for LON-CAPA course: ").$description.&mt(", automated enrollment may fail for ").$newattr{'coursecode'}.&mt(" - section $sec because this is not a valid section entry.<br/>"); |
} |
} |
} |
} |
} |
} elsif ($changeowner) { |
|
foreach my $sec (@sections) { |
|
if ($sec =~ m/^(.+):/) { |
|
my $inst_course_id = $newattr{'coursecode'}.$1; |
|
my $outcome = &Apache::lonnet::auto_new_course($crs,$dom,$inst_course_id,$newattr{'courseowner'}); |
|
unless ($outcome eq 'ok') { |
|
$warning .= &mt("If automatic enrollment is enabled for LON-CAPA course: ").$description.&mt(", automated enrollment may fail for ").$newattr{'coursecode'}.&mt(" - section $1 for the following reason: $outcome.<br/>"); |
|
} |
|
} else { |
|
$warning .= &mt("If automatic enrollment is enabled for LON-CAPA course: ").$description.&mt(", automated enrollment may fail for ").$newattr{'coursecode'}.&mt(" - section $sec because this is not a valid section entry.<br/>"); |
|
} |
|
} |
|
} |
} else { |
} else { |
$warning .= "As no section numbers are currently listed for LON-CAPA course: $description, automated enrollment will not occur for any sections of coursecode: $newattr{'coursecode'}.<br/>"; |
$warning .= &mt("As no section numbers are currently listed for LON-CAPA course: ").$description.&mt(", automated enrollment will not occur for any sections of coursecode: ").$newattr{'coursecode'}."<br/>"; |
} |
} |
if ( (@xlists > 0) && ($changeowner) ) { |
if ( (@xlists > 0) && ($changeowner) ) { |
foreach my $xlist (@xlists) { |
foreach my $xlist (@xlists) { |
if ($xlist =~ m/^(.+):/) { |
if ($xlist =~ m/^(.+):/) { |
# my $outcome = &localenroll::new_course($1,$newattr{'courseowner'}); |
my $outcome = &Apache::lonnet::auto_new_course($crs,$dom,$1,$newattr{'courseowner'}); |
my $outcome = 'ok'; |
|
unless ($outcome eq 'ok') { |
unless ($outcome eq 'ok') { |
$warning .= "If automatic enrollment is enabled for LON-CAPA course: $description, automated enrollment may fail for crosslisted class: $1 for the following reason: $outcome.<br/>"; |
$warning .= &mt("If automatic enrollment is enabled for LON-CAPA course: ").$description.&mt(", automated enrollment may fail for crosslisted class: ").$1.&mt(" for the following reason: $outcome.<br/>"); |
} |
} |
} |
} |
} |
} |
Line 499 sub modify_course {
|
Line 646 sub modify_course {
|
} |
} |
} |
} |
} |
} |
|
} else { |
|
foreach my $attr (@params) { |
|
$nochgresponse .= "<li>$$typeref{$attr} ".&mt("still set to")." \"".$currattr{$attr}."\".</li>"; |
|
} |
} |
} |
|
|
|
|
if (@changes > 0) { |
if (@changes > 0) { |
$chgresponse .= "</ul><br/><br/>"; |
$chgresponse .= "</ul><br/><br/>"; |
} |
} |
Line 508 sub modify_course {
|
Line 660 sub modify_course {
|
$nochgresponse .= "</ul><br/><br/>"; |
$nochgresponse .= "</ul><br/><br/>"; |
} |
} |
unless ($warning eq '') { |
unless ($warning eq '') { |
$warning = "The following warning messages were generated as a result of applying the changes you specified to course settings that can affect the automated enrollment process:<br/><br/>".$warning; |
$warning = &mt("The following warning messages were generated as a result of applying the changes you specified to course settings that can affect the automated enrollment process:<br/><br/>").$warning; |
} |
} |
if ($response eq '') { |
if ($response eq '') { |
$reply = $chgresponse.$nochgresponse.$warning; |
$reply = $chgresponse.$nochgresponse.$warning; |
Line 516 sub modify_course {
|
Line 668 sub modify_course {
|
$reply = $response; |
$reply = $response; |
} |
} |
&print_header($r,$tasklongref,$description); |
&print_header($r,$tasklongref,$description); |
$r->print("<table><tr><td>$reply</td></tr></table"); |
$reply = "<h3>".&mt("Automated Enrollment Course Settings")."</h3><table><tr><td>".$reply."</td></tr></table>"; |
|
$r->print($reply); |
&print_footer($r); |
&print_footer($r); |
return; |
return; |
} |
} |
|
|
sub print_header { |
sub print_header { |
my ($r,$tasklongref,$description,$javascriptref) = @_; |
my ($r,$tasklongref,$description,$javascriptref) = @_; |
my %lt = ( |
my %lt =&Apache::lonlocal::texthash( |
'vmcs' => 'View/Modify Course Settings', |
|
'chco' => 'Choose a course', |
'chco' => 'Choose a course', |
'main' => 'Main Menu', |
'main' => 'Main Menu', |
'comg' => 'Course Manager', |
'comg' => 'Course Manager', |
); |
); |
my $action = "start"; |
my $action = "start"; |
if ( exists($ENV{'form.action'}) ) { |
if ( exists($env{'form.action'}) ) { |
$action = $ENV{'form.action'}; |
$action = $env{'form.action'}; |
} |
} |
if ( ($description eq '') || (!defined($description)) ) { |
if ( ($description eq '') || (!defined($description)) ) { |
$description = $lt{'comg'}; |
$description = $lt{'comg'}; |
} |
} |
my $page = ''; |
my $page = ''; |
my $bodytag=&Apache::loncommon::bodytag($lt{'vmcs'}); |
|
if ($action eq 'start') { |
if ($action eq 'start') { |
$page = "<b>$lt{'chco'}</b>"; |
$page = "<b>$lt{'chco'}</b>"; |
} else { |
} else { |
$page = '<a href="/adm/modifycourse">'.$lt{'chco'}.'</a>'; |
$page = '<a href="/adm/modifycourse">'.$lt{'chco'}.'</a>'; |
if ( $action eq 'process' ) { |
if ( $action eq 'process' ) { |
my $course = $ENV{'form.course'}; |
my $course = $env{'form.course'}; |
$page .= "-> <a href=\"/adm/modifycourse?action=display&course=$course\">".$$tasklongref{'display'}."</a> -> <b>$$tasklongref{$action}</b> "; |
$page .= "-> <a href=\"/adm/modifycourse?action=display&course=$course\">".$$tasklongref{'display'}."</a> -> <b>$$tasklongref{$action}</b> "; |
} else { |
} else { |
$page .= " -> <b>".$$tasklongref{$action}."</b>"; |
$page .= " -> <b>".$$tasklongref{$action}."</b>"; |
} |
} |
} |
} |
$r->print(" |
|
<html> |
my $js; |
<head>"); |
|
if ($action eq 'display') { |
if ($action eq 'display') { |
$r->print(" |
$js = '<script type="text/javascript"> |
<script language=\"JavaScript\" type=\"text/javascript\"> |
'.$$javascriptref.' |
$$javascriptref |
</script>'; |
</script>"); |
|
} |
} |
|
$r->print(&Apache::loncommon::start_page('View/Modify Course Settings', |
|
$js)); |
$r->print(<<ENDTHIS); |
$r->print(<<ENDTHIS); |
<title>The LearningOnline Network with CAPA</title> |
|
</head> |
|
$bodytag |
|
<table width="100%" border="0" cellpadding="0" cellspacing="0"> |
<table width="100%" border="0" cellpadding="0" cellspacing="0"> |
<tr> |
<tr> |
<td bgcolor="#CCCC99"> |
<td bgcolor="#CCCC99"> |
Line 573 $bodytag
|
Line 722 $bodytag
|
</tr> |
</tr> |
</table> |
</table> |
ENDTHIS |
ENDTHIS |
|
return; |
} |
} |
|
|
sub print_footer { |
sub print_footer { |
my $r = shift; |
my ($r) = @_; |
$r->print(<<ENDBASE); |
$r->print('<br />'.&Apache::loncommon::end_page()); |
<br/> |
return; |
</body> |
} |
</html> |
|
ENDBASE |
sub check_course { |
|
my ($dom,$course) = @_; |
|
my %courseIDs = &Apache::lonnet::courseiddump($dom,'.',1,'.','.','.',undef,undef,'.'); |
|
foreach my $key (sort keys %courseIDs) { |
|
if ($key =~ m/^($dom)_(\w+)$/) { |
|
if ($2 eq $course) { |
|
return 'ok'; |
|
} |
|
} |
|
} |
|
return 'invalid course'; |
} |
} |
|
|
|
|
Line 593 sub handler {
|
Line 753 sub handler {
|
return OK; |
return OK; |
} |
} |
|
|
if (&Apache::lonnet::allowed('ccc',$ENV{'request.role.domain'})) { |
if (&Apache::lonnet::allowed('ccc',$env{'request.role.domain'})) { |
&Apache::loncommon::content_type($r,'text/html'); |
&Apache::loncommon::content_type($r,'text/html'); |
$r->send_http_header; |
$r->send_http_header; |
|
|
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['action','course']); |
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['action','course']); |
my $dom = $ENV{'user.domain'}; |
my $dom = $env{'user.domain'}; |
my %longtype = ( |
my %longtype=&Apache::lonlocal::texthash( |
'authtype' => 'Default authentication method', |
'authtype' => 'Default authentication method', |
'autharg' => 'Default authentication parameter', |
'autharg' => 'Default authentication parameter', |
'autoadds' => 'Automated adds', |
'autoadds' => 'Automated adds', |
'autodrops' => 'Automated drops', |
'autodrops' => 'Automated drops', |
'autostart' => 'Date of first enrollment', |
'autostart' => 'Date of first automated enrollment', |
'autoend' => 'Date of last enrollment', |
'autoend' => 'Date of last automated enrollment', |
|
'default_enrollment_start_date' => 'Date of first student access', |
|
'default_enrollment_end_date' => 'Date of last student access', |
'coursecode' => 'Official course code', |
'coursecode' => 'Official course code', |
'courseowner' => "Username of course owner (\@$dom)", |
'courseowner' => "Username:domain of course owner", |
'notifylist' => 'Course Coordinators to be notified of enrollment changes', |
'notifylist' => 'Course Coordinators to be notified of enrollment changes', |
'sectionnums' => 'Course section number(:groupID)', |
'sectionnums' => 'Course section number(:groupID)', |
'crosslistings' => 'Crosslisted class(:groupID)', |
'crosslistings' => 'Crosslisted class(:groupID)', |
); |
); |
|
|
my %tasklong = ( |
my %tasklong = &Apache::lonlocal::texthash( |
'display' => 'View/modify settings', |
'display' => 'View/modify settings', |
'process' => 'Results of changes', |
'process' => 'Results of changes', |
); |
); |
|
|
if ($ENV{'form.action'} eq 'process') { |
if ($env{'form.action'} eq 'process') { |
&modify_course($r,\%tasklong,\%longtype); |
&modify_course($r,\%tasklong,\%longtype); |
} elsif ($ENV{'form.action'} eq 'display') { |
} elsif ($env{'form.action'} eq 'display') { |
&print_course_modification_page($r,\%tasklong,\%longtype); |
&print_course_modification_page($r,\%tasklong,\%longtype); |
} else { |
} else { |
&print_course_selection_page($r,\%tasklong); |
&print_course_selection_page($r,\%tasklong); |
} |
} |
} else { |
} else { |
$ENV{'user.error.msg'}= |
$env{'user.error.msg'}= |
"/adm/createcourse:ccc:0:0:Cannot modify course settings"; |
"/adm/modifycourse:ccc:0:0:Cannot modify course settings"; |
return HTTP_NOT_ACCEPTABLE; |
return HTTP_NOT_ACCEPTABLE; |
} |
} |
return OK; |
return OK; |