version 1.1410, 2023/07/06 17:16:35
|
version 1.1412, 2023/09/25 22:36:29
|
Line 6849 ENDJS
|
Line 6849 ENDJS
|
$endbodytag; |
$endbodytag; |
} |
} |
} |
} |
|
if ((ref($args) eq 'HASH') && ($args->{'dashjs'})) { |
|
$endbodytag = &Apache::lonhtmlcommon::dash_to_minus_js().$endbodytag; |
|
} |
return $endbodytag; |
return $endbodytag; |
} |
} |
|
|
Line 17051 sub construct_course {
|
Line 17054 sub construct_course {
|
$cenv{'internal.defaultcredits'} = $args->{'defaultcredits'}; |
$cenv{'internal.defaultcredits'} = $args->{'defaultcredits'}; |
} |
} |
my @badclasses = (); # Used to accumulate sections/crosslistings that did not pass classlist access check for course owner. |
my @badclasses = (); # Used to accumulate sections/crosslistings that did not pass classlist access check for course owner. |
|
my @oklcsecs = (); # Used to accumulate LON-CAPA sections for validated institutional sections. |
if ($args->{'crssections'}) { |
if ($args->{'crssections'}) { |
$cenv{'internal.sectionnums'} = ''; |
$cenv{'internal.sectionnums'} = ''; |
if ($args->{'crssections'} =~ m/,/) { |
if ($args->{'crssections'} =~ m/,/) { |
Line 17064 sub construct_course {
|
Line 17068 sub construct_course {
|
my $class = $args->{'crscode'}.$sec; |
my $class = $args->{'crscode'}.$sec; |
my $addcheck = &Apache::lonnet::auto_new_course($$crsunum,$$crsudom,$class,$cenv{'internal.courseowner'}); |
my $addcheck = &Apache::lonnet::auto_new_course($$crsunum,$$crsudom,$class,$cenv{'internal.courseowner'}); |
$cenv{'internal.sectionnums'} .= $item.','; |
$cenv{'internal.sectionnums'} .= $item.','; |
unless ($addcheck eq 'ok') { |
if ($addcheck eq 'ok') { |
|
unless (grep(/^\Q$gp\E$/,@oklcsecs)) { |
|
push(@oklcsecs,$gp); |
|
} |
|
} else { |
push(@badclasses,$class); |
push(@badclasses,$class); |
} |
} |
} |
} |
Line 17092 sub construct_course {
|
Line 17100 sub construct_course {
|
my ($xl,$gp) = split/:/,$item; |
my ($xl,$gp) = split/:/,$item; |
my $addcheck = &Apache::lonnet::auto_new_course($$crsunum,$$crsudom,$xl,$cenv{'internal.courseowner'}); |
my $addcheck = &Apache::lonnet::auto_new_course($$crsunum,$$crsudom,$xl,$cenv{'internal.courseowner'}); |
$cenv{'internal.crosslistings'} .= $item.','; |
$cenv{'internal.crosslistings'} .= $item.','; |
unless ($addcheck eq 'ok') { |
if ($addcheck eq 'ok') { |
|
unless (grep(/^\Q$gp\E$/,@oklcsecs)) { |
|
push(@oklcsecs,$gp); |
|
} |
|
} else { |
push(@badclasses,$xl); |
push(@badclasses,$xl); |
} |
} |
} |
} |
Line 17155 sub construct_course {
|
Line 17167 sub construct_course {
|
if ($args->{'no_end_date'}) { |
if ($args->{'no_end_date'}) { |
$args->{'endaccess'} = 0; |
$args->{'endaccess'} = 0; |
} |
} |
|
# If an official course with institutional sections is created by cloning |
|
# an existing course, section-specific hiding of course totals in student's |
|
# view of grades as copied from cloned course, will be checked for valid |
|
# sections. |
|
if (($can_clone && $cloneid) && |
|
($cenv{'internal.coursecode'} ne '') && |
|
($cenv{'grading'} eq 'standard') && |
|
($cenv{'hidetotals'} ne '') && |
|
($cenv{'hidetotals'} ne 'all')) { |
|
my @hidesecs; |
|
my $deletehidetotals; |
|
if (@oklcsecs) { |
|
foreach my $sec (split(/,/,$cenv{'hidetotals'})) { |
|
if (grep(/^\Q$sec$/,@oklcsecs)) { |
|
push(@hidesecs,$sec); |
|
} |
|
} |
|
if (@hidesecs) { |
|
$cenv{'hidetotals'} = join(',',@hidesecs); |
|
} else { |
|
$deletehidetotals = 1; |
|
} |
|
} else { |
|
$deletehidetotals = 1; |
|
} |
|
if ($deletehidetotals) { |
|
delete($cenv{'hidetotals'}); |
|
&Apache::lonnet::del('environment',['hidetotals'],$$crsudom,$$crsunum); |
|
} |
|
} |
$cenv{'internal.autostart'}=$args->{'enrollstart'}; |
$cenv{'internal.autostart'}=$args->{'enrollstart'}; |
$cenv{'internal.autoend'}=$args->{'enrollend'}; |
$cenv{'internal.autoend'}=$args->{'enrollend'}; |
$cenv{'default_enrollment_start_date'}=$args->{'startaccess'}; |
$cenv{'default_enrollment_start_date'}=$args->{'startaccess'}; |