version 1.57, 2010/08/24 13:51:52
|
version 1.59, 2011/01/15 18:24:16
|
Line 845 sub modify_course {
|
Line 845 sub modify_course {
|
push(@warnings,&mt('There is no owner associated with this LON-CAPA course.'). |
push(@warnings,&mt('There is no owner associated with this LON-CAPA course.'). |
'<br />'.&mt('If automated enrollment at your institution requires validation of course owners, automated enrollment will fail.')); |
'<br />'.&mt('If automated enrollment at your institution requires validation of course owners, automated enrollment will fail.')); |
} else { |
} else { |
|
my %crsenv = &Apache::lonnet::get('environment',['internal.co-owners'],$cdom,$cnum); |
|
my $coowners = $crsenv{'internal.co-owners'}; |
if (@sections > 0) { |
if (@sections > 0) { |
if ($changed{'code'}) { |
if ($changed{'code'}) { |
foreach my $sec (@sections) { |
foreach my $sec (@sections) { |
Line 853 sub modify_course {
|
Line 855 sub modify_course {
|
my $inst_course_id = $newattr{'coursecode'}.$1; |
my $inst_course_id = $newattr{'coursecode'}.$1; |
my $course_check = &Apache::lonnet::auto_validate_courseID($cnum,$cdom,$inst_course_id); |
my $course_check = &Apache::lonnet::auto_validate_courseID($cnum,$cdom,$inst_course_id); |
if ($course_check eq 'ok') { |
if ($course_check eq 'ok') { |
my $outcome = &Apache::lonnet::auto_new_course($cnum,$cdom,$inst_course_id,$newattr{'courseowner'}); |
my $outcome = &Apache::lonnet::auto_new_course($cnum,$cdom,$inst_course_id,$newattr{'courseowner'},$coowners); |
unless ($outcome eq 'ok') { |
unless ($outcome eq 'ok') { |
|
|
push(@warnings,&mt('If automatic enrollment is enabled for "[_1]", automated enrollment may fail for "[_2]" - section: [_3] for the following reason: "[_4]".',$description,$newattr{'coursecode'},$instsec,$outcome).'<br/>'); |
push(@warnings,&mt('If automatic enrollment is enabled for "[_1]", automated enrollment may fail for "[_2]" - section: [_3] for the following reason: "[_4]".',$description,$newattr{'coursecode'},$instsec,$outcome).'<br/>'); |
Line 870 sub modify_course {
|
Line 872 sub modify_course {
|
if ($sec =~ m/^(.+):/) { |
if ($sec =~ m/^(.+):/) { |
my $instsec = $1; |
my $instsec = $1; |
my $inst_course_id = $newattr{'coursecode'}.$instsec; |
my $inst_course_id = $newattr{'coursecode'}.$instsec; |
my $outcome = &Apache::lonnet::auto_new_course($cnum,$cdom,$inst_course_id,$newattr{'courseowner'}); |
my $outcome = &Apache::lonnet::auto_new_course($cnum,$cdom,$inst_course_id,$newattr{'courseowner'},$coowners); |
unless ($outcome eq 'ok') { |
unless ($outcome eq 'ok') { |
push(@warnings,&mt('If automatic enrollment is enabled for "[_1]", automated enrollment may fail for "[_2]" - section: [_3] for the following reason: "[_4]".',$description,$newattr{'coursecode'},$instsec,$outcome)); |
push(@warnings,&mt('If automatic enrollment is enabled for "[_1]", automated enrollment may fail for "[_2]" - section: [_3] for the following reason: "[_4]".',$description,$newattr{'coursecode'},$instsec,$outcome)); |
} |
} |
Line 886 sub modify_course {
|
Line 888 sub modify_course {
|
foreach my $xlist (@xlists) { |
foreach my $xlist (@xlists) { |
if ($xlist =~ m/^(.+):/) { |
if ($xlist =~ m/^(.+):/) { |
my $instxlist = $1; |
my $instxlist = $1; |
my $outcome = &Apache::lonnet::auto_new_course($cnum,$cdom,$instxlist,$newattr{'courseowner'}); |
my $outcome = &Apache::lonnet::auto_new_course($cnum,$cdom,$instxlist,$newattr{'courseowner'},$coowners); |
unless ($outcome eq 'ok') { |
unless ($outcome eq 'ok') { |
push(@warnings,&mt('If automatic enrollment is enabled for "[_1]", automated enrollment may fail for crosslisted class "[_2]" for the following reason: "[_3]".',$description,$instxlist,$outcome)); |
push(@warnings,&mt('If automatic enrollment is enabled for "[_1]", automated enrollment may fail for crosslisted class "[_2]" for the following reason: "[_3]".',$description,$instxlist,$outcome)); |
} |
} |
Line 1040 sub update_coowners {
|
Line 1042 sub update_coowners {
|
if ($designhash{$cdom.'.autoassign.co-owners'}) { |
if ($designhash{$cdom.'.autoassign.co-owners'}) { |
my @newcoowners = (); |
my @newcoowners = (); |
if ($settings->{'internal.co-owners'}) { |
if ($settings->{'internal.co-owners'}) { |
my @currcoown = split(',',$settings->{'internal.coowners'}); |
my @currcoown = split(',',$settings->{'internal.co-owners'}); |
my ($updatecoowners,$delcoowners); |
my ($updatecoowners,$delcoowners); |
foreach my $person (@currcoown) { |
foreach my $person (@currcoown) { |
my ($result,$desc) = &Apache::lonnet::auto_validate_instcode($cnum,$cdom,$newattr->{'coursecode'},$person); |
my ($result,$desc) = &Apache::lonnet::auto_validate_instcode($cnum,$cdom,$newattr->{'coursecode'},$person); |