'.&mt('Search for a placement test in the [_1] domain',$domdesc).'
');
} else {
$r->print('
'.&mt('Search for a course in the [_1] domain',$domdesc).'
');
}
@@ -185,6 +194,8 @@ sub print_course_search_page {
my ($actiontext,$roleoption,$settingsoption);
if ($type eq 'Community') {
$actiontext = &mt('Actions available after searching for a community:');
+ } elsif ($type eq 'Placement') {
+ $actiontext = &mt('Actions available after searching for a placement test:')
} else {
$actiontext = &mt('Actions available after searching for a course:');
}
@@ -192,6 +203,9 @@ sub print_course_search_page {
if ($type eq 'Community') {
$roleoption = &mt('Enter the community with the role of [_1]',$cctitle);
$settingsoption = &mt('View or modify community settings which only a [_1] may modify.',$dctitle);
+ } elsif ($type eq 'Placement') {
+ $roleoption = &mt('Enter the placement test with the role of [_1]',$cctitle);
+ $settingsoption = &mt('View or modify placement test settings which only a [_1] may modify.',$dctitle);
} else {
$roleoption = &mt('Enter the course with the role of [_1]',$cctitle);
$settingsoption = &mt('View or modify course settings which only a [_1] may modify.',$dctitle);
@@ -202,6 +216,8 @@ sub print_course_search_page {
if (@{$roles_by_num} > 1) {
if ($type eq 'Community') {
$roleoption = &mt('Enter the community with one of the available ad hoc roles');
+ } elsif ($type eq 'Placement') {
+ $roleoption = &mt('Enter the placement test with one of the available ad hoc roles.');
} else {
$roleoption = &mt('Enter the course with one of the available ad hoc roles.');
}
@@ -209,6 +225,8 @@ sub print_course_search_page {
my $rolename = $description->{$roles_by_num->[0]};
if ($type eq 'Community') {
$roleoption = &mt('Enter the community with the ad hoc role of: [_1]',$rolename);
+ } elsif ($type eq 'Placement') {
+ $roleoption = &mt('Enter the placement test with the ad hoc role of: [_1]',$rolename);
} else {
$roleoption = &mt('Enter the course with the ad hoc role of: [_1]',$rolename);
}
@@ -216,6 +234,8 @@ sub print_course_search_page {
}
if ($type eq 'Community') {
$settingsoption = &mt('View community settings which only a [_1] may modify.',$dctitle);
+ } elsif ($type eq 'Placement') {
+ $settingsoption = &mt('View placement test settings which only a [_1] may modify.',$dctitle);
} else {
$settingsoption = &mt('View course settings which only a [_1] may modify.',$dctitle);
}
@@ -410,6 +430,7 @@ sub print_modification_menu {
'setanon' => 'View/Modify responders threshold for anonymous survey submissions display',
'selfenroll' => 'View/Modify Self-Enrollment configuration',
'setpostsubmit' => 'View/Modify submit button behavior, post-submission',
+ 'setltiauth' => 'View/Modify re-authentication requirement for LTI launch of deep-linked item',
);
} else {
%linktext = (
@@ -417,10 +438,11 @@ sub print_modification_menu {
'setanon' => 'View responders threshold for anonymous survey submissions display',
'selfenroll' => 'View Self-Enrollment configuration',
'setpostsubmit' => 'View submit button behavior, post-submission',
+ 'setltiauth' => 'View re-authentication requirement for LTI launch of deep-linked item',
);
}
if ($type eq 'Community') {
- if ($permission->{'setparms'} eq 'edit') {
+ if ($permission->{'setparms'} eq 'edit') {
$categorytitle = 'View/Modify Community Settings';
$linktext{'setparms'} = 'View/Modify community owner';
$linktext{'catsettings'} = 'View/Modify catalog settings for community';
@@ -430,7 +452,7 @@ sub print_modification_menu {
$linktext{'catsettings'} = 'View catalog settings for community';
}
$setquota_text = &mt('Total disk space allocated for storage of portfolio files in all groups in a community.');
- $setuploadquota_text = &mt('Disk space allocated for storage of content uploaded directly to a community via Content Editor.');
+ $setuploadquota_text = &mt('Disk space allocated for storage of content uploaded directly to a community via Content Editor.');
} else {
if ($permission->{'setparms'} eq 'edit') {
$categorytitle = 'View/Modify Course Settings';
@@ -455,6 +477,7 @@ sub print_modification_menu {
my $anon_text = &mt('Responder threshold required to display anonymous survey submissions.');
my $postsubmit_text = &mt('Override defaults for submit button behavior post-submission for this specific course.');
my $mysqltables_text = &mt('Override default for lifetime of "temporary" MySQL tables containing student performance data.');
+ my $ltiauth_text = &mt('Override default for requirement for re-authentication for LTI-limited launch of deep-linked item');
$linktext{'viewparms'} = 'Display current settings for automated enrollment';
my %domconf = &Apache::lonnet::get_dom('configuration',['coursecategories'],$dom);
@@ -515,7 +538,7 @@ sub print_modification_menu {
{
linktext => $linktext{'viewparms'},
url => &phaseurl('viewparms'),
- permission => ($permission->{'viewparms'} && ($type ne 'Community')),
+ permission => ($permission->{'viewparms'} && ($type ne 'Community') && ($type ne 'Placement')),
#help => '',
icon => 'roles.png',
linktitle => ''
@@ -536,6 +559,14 @@ sub print_modification_menu {
permission => $permission->{'setpostsubmit'},
linktitle => '',
},
+ {
+ linktext => $linktext{'setltiauth'},
+ icon => 'system-lock-screen.png',
+ #help => '',
+ url => &phaseurl('setltiauth'),
+ permission => $permission->{'setltiauth'},
+ linktitle => '',
+ },
]
},
);
@@ -557,7 +588,7 @@ sub print_modification_menu {
} else {
$menu_html .= '
'.&mt('Course owner (permitted to assign Course Coordinator roles in the course).').'
'."\n".
'
'.&mt("Institutional code and default authentication (both required for auto-enrollment of students from institutional datafeeds).").'
'."\n";
- if (&showcredits($dom)) {
+ if (($type ne 'Placement') && &showcredits($dom)) {
$menu_html .= '
'.&mt('Default credits earned by student on course completion.').'
'."\n";
}
$menu_html .= '
'.&mt('Override defaults for who configures self-enrollment for this specific course.').'
'."\n";
@@ -566,7 +597,8 @@ sub print_modification_menu {
'
\n".
&Apache::loncommon::end_data_table_header_row()."\n";
foreach my $item (@items) {
+ my $shown = $enrollvar{$item};
+ if ($item eq 'crosslistings') {
+ my (@xlists,@lcsecs);
+ foreach my $entry (split(/,/,$enrollvar{$item})) {
+ my ($xlist,$lc_sec) = split(/:/,$entry);
+ push(@xlists,$xlist);
+ push(@lcsecs,$lc_sec);
+ }
+ if (@xlists) {
+ my $crskey = $cnum.':'.$enrollvar{'coursecode'};
+ my %reformatted =
+ &Apache::lonnet::auto_instsec_reformat($cdom,'declutter',
+ {$crskey => \@xlists});
+ if (ref($reformatted{$crskey}) eq 'ARRAY') {
+ my @show;
+ my @xlcodes = @{$reformatted{$crskey}};
+ for (my $i=0; $i<@xlcodes; $i++) {
+ push(@show,$xlcodes[$i].':'.$lcsecs[$i]);
+ }
+ if (@show) {
+ $shown = join(',',@show);
+ }
+ }
+ }
+ }
$disp_table .= &Apache::loncommon::start_data_table_row()."\n".
"
$longtype{$item}
\n".
- "
$enrollvar{$item}
\n";
+ "
$shown
\n";
if (grep(/^\Q$item\E$/,@modifiable_params)) {
$disp_table .= '
'.&mt('Yes').'
'."\n";
} else {
@@ -794,7 +851,7 @@ sub print_set_anonsurvey_threshold {
my $hidden_elements = &hidden_form_elements();
my ($disabled,$submit);
if ($readonly) {
- $disabled = ' disabled="disabled"';
+ $disabled = ' disabled="disabled"';
} else {
$submit = '';
}
@@ -888,7 +945,7 @@ sub domain_postsubtimeout {
my ($cdom,$type,$settings) = @_;
return unless (ref($settings) eq 'HASH');
my $lctype = lc($type);
- unless ($type eq 'Community') {
+ unless (($type eq 'Community') || ($type eq 'Placement')) {
$lctype = 'unofficial';
if ($settings->{'internal.coursecode'}) {
$lctype = 'official';
@@ -951,6 +1008,8 @@ sub print_catsettings {
'
');
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('Auto-cataloging is enabled and the course is assigned an institutional code.').'
'.
@@ -972,7 +1031,7 @@ sub print_catsettings {
} else {
$r->print(&mt('No categories defined for this domain'));
}
- unless ($type eq 'Community') {
+ unless (($type eq 'Community') || ($type eq 'Placement')) {
$r->print('
'.&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).').'
');
}
}
@@ -1072,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 .= '
'."\n";
+ $ownertable .= '
'."\n";
} else {
$ownertable .= '
'."\n";
}
@@ -1102,7 +1161,7 @@ sub print_course_modification_page {
' '.&mt('Course Code'))."\n".
''.
&Apache::lonhtmlcommon::row_closure());
- if (&showcredits($cdom)) {
+ if (($crstype eq 'Course') && (&showcredits($cdom))) {
$r->print(&Apache::lonhtmlcommon::row_title(
&Apache::loncommon::help_open_topic('Modify_Course_Credithours').
' '.&mt('Credits (students)'))."\n".
@@ -1214,6 +1273,79 @@ sub print_selfenrollconfig {
return;
}
+sub print_set_ltiauth {
+ my ($r,$cdom,$cnum,$cdesc,$type,$readonly) = @_;
+ my %lt = &Apache::lonlocal::texthash(
+ 'requ' => 'Requirement for re-authentication for student LTI-limited launch of deep-linked item',
+ 'link' => 'Link protection can be set to accept username for an enrolled student (if sent by Consumer)',
+ 'logi' => 'Login needed, regardless of user information sent by LTI Consumer in (signed) parameters',
+ 'used' => 'Use domain default',
+ 'cour' => 'Use course-specific setting',
+ 'curd' => 'Current domain default is',
+ 'valu' => 'Value for this course',
+ 'modi' => 'Save',
+ 'back' => 'Pick another action',
+ );
+ my ($domdef,$checkeddom,$checkedcrs,$domdefdisplay,$divsty,$authok,$authno);
+ $domdef = 0;
+ $checkeddom = 'checked="checked "';
+ $domdefdisplay = $lt{'logi'};
+ $divsty = 'display:none';
+ $authno = 'checked="checked" ';
+ my %domconfig =
+ &Apache::lonnet::get_dom('configuration',['coursedefaults'],$cdom);
+ if (ref($domconfig{'coursedefaults'}) eq 'HASH') {
+ $domdef = $domconfig{'coursedefaults'}{'ltiauth'};
+ }
+ if ($domdef) {
+ $domdefdisplay = $lt{'link'};
+ }
+ my %settings = &Apache::lonnet::get('environment',['internal.ltiauth'],$cdom,$cnum);
+ my $ltiauth = $settings{'internal.ltiauth'};
+
+ if ($ltiauth ne '') {
+ $checkedcrs = $checkeddom;
+ $checkeddom = '';
+ $divsty = 'display:inline-block';
+ if ($ltiauth) {
+ $authok = 'checked="checked "';
+ }
+ }
+ &print_header($r,$type);
+ my $hidden_elements = &hidden_form_elements();
+ my ($disabled,$submit);
+ if ($readonly) {
+ $disabled = ' disabled="disabled"';
+ } else {
+ $submit = '';
+ }
+ my $helpitem = &Apache::loncommon::help_open_topic('Modify_Course_LTI_Authen');
+ $r->print(<
+