--- loncom/interface/lonmodifycourse.pm 2022/02/07 12:03:43 1.79.2.9.2.1 +++ loncom/interface/lonmodifycourse.pm 2022/02/16 02:20:59 1.98 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # handler for DC-only modifiable course settings # -# $Id: lonmodifycourse.pm,v 1.79.2.9.2.1 2022/02/07 12:03:43 raeburn Exp $ +# $Id: lonmodifycourse.pm,v 1.98 2022/02/16 02:20:59 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -79,6 +79,13 @@ sub catalog_settable { if ($confhash->{'categorizecomm'} ne 'comm') { push(@settable,'categorize'); } + } elsif ($type eq 'Placement') { + if ($confhash->{'togglecatsplace'} ne 'place') { + push(@settable,'togglecats'); + } + if ($confhash->{'categorizeplace'} ne 'place') { + push(@settable,'categorize'); + } } else { if ($confhash->{'togglecats'} ne 'crs') { push(@settable,'togglecats'); @@ -175,6 +182,8 @@ sub print_course_search_page { $r->print(&Apache::loncommon::js_changer()); if ($type eq 'Community') { $r->print('
'); if ($type eq 'Community') { $r->print(&mt("If a community has been categorized using at least one of the categories defined for communities in the domain, it will be listed in the domain's publicly accessible Course/Community Catalog, unless excluded.")); + } elsif ($type eq 'Placement') { + $r->print(&mt("If a placement test has been categorized using at least one of the categories defined for placement tests in the domain, it will be listed in the domain's publicly accessible Course/Community Catalog, unless excluded.")); } else { $r->print(&mt("Unless excluded, a course will be listed in the domain's publicly accessible Course/Community Catalog, if at least one of the following applies").':
'.&mt('If auto-cataloging based on institutional code is enabled in the domain, a course will continue to be listed in the catalog of official courses, in addition to receiving a listing under any manually assigned categor(ies).').'
'); } } @@ -1109,7 +1131,7 @@ sub print_course_modification_page { foreach my $cc (@local_ccs) { $ownertable .= &Apache::loncommon::start_data_table_row()."\n"; if ($cc eq $enrollvar{'courseowner'}) { - $ownertable .= '$lt{'curd'}: '.$domdefdisplay +
$lt{'curd'}: $domdefdisplay
@@ -1387,6 +1409,8 @@ sub gather_authenitems {
$curr_authtype = 'int';
} elsif ($enrollvar->{'authtype'} eq 'localauth' ) {
$curr_authtype = 'loc';
+ } elsif ($enrollvar->{'authtype'} eq 'lti' ) {
+ $curr_authtype = 'lti';
}
}
unless ($curr_authtype eq '') {
@@ -1407,7 +1431,8 @@ sub gather_authenitems {
$authform{'krb'} = &Apache::loncommon::authform_kerberos(%param);
$authform{'int'} = &Apache::loncommon::authform_internal(%param);
$authform{'loc'} = &Apache::loncommon::authform_local(%param);
- foreach my $item ('krb','int','loc') {
+ $authform{'lti'} = &Apache::loncommon::authform_lti(%param);
+ foreach my $item ('krb','int','loc','lti') {
if ($authform{$item} ne '') {
$authenitems .= $authform{$item}.'
';
}
@@ -1422,7 +1447,7 @@ sub modify_course {
'internal.pendingco-owners','internal.selfenrollmgrdc',
'internal.selfenrollmgrcc','internal.mysqltables');
my ($selfenrollrows,$selfenrolltitles) = &Apache::lonuserutils::get_selfenroll_titles();
- unless ($type eq 'Community') {
+ unless (($type eq 'Community') || ($type eq 'Placement')) {
push(@items,('internal.coursecode','internal.authtype','internal.autharg',
'internal.sectionnums','internal.crosslistings'));
if (&showcredits($cdom)) {
@@ -1478,6 +1503,8 @@ sub modify_course {
if ((defined($env{'form.locarg'})) && ($env{'form.locarg'})) {
$newattr{'autharg'} = $env{'form.locarg'};
}
+ } elsif ($env{'form.login'} eq 'lti') {
+ $newattr{'authtype'} = 'lti';
}
if ( $newattr{'authtype'}=~ /^krb/) {
if ($newattr{'autharg'} eq '') {
@@ -1655,7 +1682,7 @@ sub modify_course {
$nochgresponse .= '
'.&mt('If automated enrollment at your institution requires validation of course owners, automated enrollment will fail.'));
@@ -2347,7 +2374,7 @@ sub modify_ltiauth {
$change = 1;
}
} elsif ($env{'form.ltiauthset'} eq 'course') {
- if ($env{'form.ltiauth'} =~ /^0|1$/) {
+ if ($env{'form.ltiauth'} =~ /^0|1$/) {
$newltiauth = $env{'form.ltiauth'};
}
if ($oldltiauth == $newltiauth) {
@@ -2624,6 +2651,8 @@ ENDJS
my $bread_text = "View/Modify Courses/Communities";
if ($type eq 'Community') {
$bread_text = 'Community Settings';
+ } elsif ($type eq 'Placement') {
+ $bread_text = 'Placement Test Settings';
} else {
$bread_text = 'Course Settings';
}
@@ -2831,6 +2860,8 @@ sub handler {
}
if ($type eq 'Community') {
$choose_text = "Choose a community";
+ } elsif ($type eq 'Placement') {
+ $choose_text = "Choose a placement test";
} else {
$choose_text = "Choose a course";
}
@@ -2847,6 +2878,8 @@ sub handler {
my $enter_text;
if ($type eq 'Community') {
$enter_text = 'Enter community';
+ } elsif ($type eq 'Placement') {
+ $enter_text = 'Enter placement test';
} else {
$enter_text = 'Enter course';
}
@@ -2869,11 +2902,11 @@ sub handler {
my ($cdom,$cnum) = split(/_/,$env{'form.pickedcourse'});
my ($readonly,$linktext);
if ($permission->{$phase} eq 'view') {
- $readonly = 1;
+ $readonly = 1;
}
if (($phase eq 'setquota') && ($permission->{'setquota'})) {
if ($permission->{'setquota'} eq 'view') {
- $linktext = 'Set quota';
+ $linktext = 'Set quota';
} else {
$linktext = 'Display quota';
}
@@ -2984,6 +3017,8 @@ sub handler {
$r->print('');
if ($type eq 'Community') {
$r->print(&mt('The community you selected is not a valid community in this domain'));
+ } elsif ($type eq 'Placement') {
+ $r->print(&mt('The course you selected is not a valid placement test in this domain'));
} else {
$r->print(&mt('The course you selected is not a valid course in this domain'));
}