--- loncom/interface/lonmodifycourse.pm 2023/09/05 03:42:31 1.103 +++ loncom/interface/lonmodifycourse.pm 2023/12/23 02:17:38 1.104 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # handler for DC-only modifiable course settings # -# $Id: lonmodifycourse.pm,v 1.103 2023/09/05 03:42:31 raeburn Exp $ +# $Id: lonmodifycourse.pm,v 1.104 2023/12/23 02:17:38 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -433,6 +433,7 @@ sub print_modification_menu { 'setpostsubmit' => 'View/Modify submit button behavior, post-submission', 'setltiauth' => 'View/Modify re-authentication requirement for LTI launch of deep-linked item', 'setexttool' => 'View/Modify External Tools permissions', + 'setcrsauthor' => 'View/Modify In-course Authoring permissions', ); } else { %linktext = ( @@ -442,6 +443,7 @@ sub print_modification_menu { 'setpostsubmit' => 'View submit button behavior, post-submission', 'setltiauth' => 'View re-authentication requirement for LTI launch of deep-linked item', 'setexttool' => 'View External Tools permissions', + 'setcrsauthor' => 'View In-course Authoring permissions', ); } if ($type eq 'Community') { @@ -582,6 +584,14 @@ sub print_modification_menu { permission => $permission->{'setexttool'}, linktitle => '', }, + { + linktext => $linktext{'setcrsauthor'}, + icon => 'crsauthor.png', + #help => '', + url => &phaseurl('setcrsauthor'), + permission => $permission->{'setcrsauthor'}, + linktitle => '', + }, ] }, ); @@ -1301,171 +1311,76 @@ 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; +sub print_default_overrides { + my ($r,$cdom,$cnum,$cdesc,$type,$readonly,$item) = @_; + my (%titles,$checkeddom,$checkedcrs,$divsty,$currcrsval,$crsdefault,%crschecked, + $helpfile,$title,$crselements); + %titles = &default_overrides_titles($type); + my ($title,$domdefdisplay,$settings,$optiontext,$options) = + &default_overrides_common($item,$cdom,$cnum,$type,\%titles); $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'}; + if ($item eq 'ltiauth') { + $helpfile = 'Modify_Course_LTI_Authen'; + $crsdefault = 0; + } else { + if ($item eq 'exttool') { + $helpfile = 'Modify_Course_External_Tool'; + $crsdefault = 'both'; + } elsif ($item eq 'crsauthor') { + $helpfile = 'Modify_Course_Crsauthor'; + $crsdefault = 1; + } } - my %settings = &Apache::lonnet::get('environment',['internal.ltiauth'],$cdom,$cnum); - my $ltiauth = $settings{'internal.ltiauth'}; - - if ($ltiauth ne '') { + $currcrsval = $settings->{'internal.'.$item}; + if ($currcrsval 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'); - my $showtype = &mt($type); - $r->print(<$helpitem $lt{'requ'} -

$showtype: $cdesc

-
-

$lt{'curd'}: $domdefdisplay

-

-
- -

-
-$lt{'valu'} - - -
- - - -

-$submit -$hidden_elements -

-
-ENDDOCUMENT - my @actions = - (''. - $lt{'back'}.''); - $r->print('
'.&Apache::lonhtmlcommon::actionbox(\@actions)); - return; -} - -sub print_set_exttool { - my ($r,$cdom,$cnum,$cdesc,$type,$readonly) = @_; - my %titles = &exttool_titles($type); - my ($domdef,$domdefdom,$checkeddom,$checkedcrs,$domdefdisplay,$divsty); - $domdef = 0; - $domdefdom = 1; - $checkeddom = ' checked="checked"'; - $divsty = 'display:none'; - my %settings = &Apache::lonnet::get('environment',['internal.coursecode', - 'internal.textbook'],$cdom,$cnum); - my $lctype = &get_lctype($type,\%settings); - my %domconfig = - &Apache::lonnet::get_dom('configuration',['coursedefaults'],$cdom); - if (ref($domconfig{'coursedefaults'}) eq 'HASH') { - if (ref($domconfig{'coursedefaults'}{'exttool'}) eq 'HASH') { - if (exists($domconfig{'coursedefaults'}{'exttool'}{$lctype})) { - $domdef = $domconfig{'coursedefaults'}{'exttool'}{$lctype}; - } - } - if (ref($domconfig{'coursedefaults'}{'domexttool'}) eq 'HASH') { - if (exists($domconfig{'coursedefaults'}{'domexttool'}{$lctype})) { - $domdefdom = $domconfig{'coursedefaults'}{'domexttool'}{$lctype}; + foreach my $option (@{$options}) { + if ($currcrsval eq $option) { + $crschecked{$option} = ' checked="checked"'; + } else { + $crschecked{$option} = ''; } } - } - if ($domdef && $domdefdom) { - $domdefdisplay = $titles{'both'}; - } elsif ($domdef) { - $domdefdisplay = $titles{'crs'}; - } elsif ($domdefdom) { - $domdefdisplay = $titles{'dom'}; - } else { - $domdefdisplay = $titles{'none'}; - } - my %settings = &Apache::lonnet::get('environment',['internal.exttool'],$cdom,$cnum); - my $crsexttool = $settings{'internal.exttool'}; - my %crschecked = ( - both => ' checked="checked"', - dom => '', - crs => '', - none => '', - ); - if ($crsexttool ne '') { - $checkedcrs = $checkeddom; - $checkeddom = ''; - $divsty = 'display:inline-block'; - foreach my $option ('both','dom','crs','none') { - if ($crsexttool eq $option) { + } else { + foreach my $option (@{$options}) { + if ($crsdefault eq $option) { $crschecked{$option} = ' checked="checked"'; } else { $crschecked{$option} = ''; } } } - &print_header($r,$type); - my $hidden_elements = &hidden_form_elements(); my ($disabled,$submit); if ($readonly) { $disabled = ' disabled="disabled"'; } else { - $submit = ''; + $submit = ''; + } + foreach my $option (@{$options}) { + $crselements .= ''. + ''. + '
'."\n"; } - my $helpitem = &Apache::loncommon::help_open_topic('Modify_Course_External_Tool'); + &print_header($r,$type); + my $hidden_elements = &hidden_form_elements(); + my $helpitem = &Apache::loncommon::help_open_topic($helpfile); my $showtype = &mt($type); $r->print(<$helpitem $titles{'extt'} +

$helpitem $title

$showtype: $cdesc

-
+

$titles{'curd'}: $domdefdisplay

-
+
-

-
+

+
$titles{'valu'} - - -
- - -
- - -
- - - +$crselements

$submit $hidden_elements @@ -1473,20 +1388,26 @@ $hidden_elements

ENDDOCUMENT my @actions = - (''. + (''. $titles{'back'}.''); $r->print('
'.&Apache::lonhtmlcommon::actionbox(\@actions)); return; } -sub exttool_titles { +sub default_overrides_titles { my ($type) = @_; my %titles = &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', 'extt' => 'External Tool permissions', 'none' => 'Use of external tools not permitted', 'crs' => 'Only external tools defined in course may be used', 'dom' => 'Only external tools defined in domain may be used', 'both' => 'External tools defined/configured in either domain or course may be used', + 'stan' => "'In-course' authoring of standard LON-CAPA problems", + 'on' => 'In-course authoring available', + 'off' => 'In-course authoring unavailable', 'used' => 'Use domain default', 'cour' => 'Use course-specific setting', 'curd' => 'Current domain default is', @@ -1503,6 +1424,85 @@ sub exttool_titles { return %titles; } +sub default_overrides_common { + my ($item,$cdom,$cnum,$type,$titles) = @_; + my ($title,$domdef,$domdefdom,$domdefdisplay,%settings,%optiontext,@options); + if ($item eq 'ltiauth') { + %settings = &Apache::lonnet::get('environment',['internal.'.$item],$cdom,$cnum); + $title = $titles->{'requ'}; + $domdef = 0; + @options = ('0','1'); + %optiontext = ( + 0 => $titles->{'logi'}, + 1 => $titles->{'link'}, + ); + } else { + %settings = + &Apache::lonnet::get('environment',['internal.'.$item,'internal.coursecode', + 'internal.textbook'],$cdom,$cnum); + if ($item eq 'exttool') { + $title = $titles->{'extt'}; + $domdefdom = 1; + $domdef = 0; + @options = ('both','dom','crs','none'); + map { $optiontext{$_} = $titles->{$_}; } @options; + } elsif ($item eq 'crsauthor') { + $title = $titles->{'stan'}; + $domdef = 1; + @options = ('1','0'); + %optiontext = ( + 1 => $titles->{'on'}, + 0 => $titles->{'off'}, + ); + } + } + my %domconfig = + &Apache::lonnet::get_dom('configuration',['coursedefaults'],$cdom); + if (ref($domconfig{'coursedefaults'}) eq 'HASH') { + if ($item eq 'ltiauth') { + $domdef = $domconfig{'coursedefaults'}{$item}; + } else { + my $lctype = &get_lctype($type,\%settings); + if (ref($domconfig{'coursedefaults'}{$item}) eq 'HASH') { + if (exists($domconfig{'coursedefaults'}{$item}{$lctype})) { + $domdef = $domconfig{'coursedefaults'}{$item}{$lctype}; + } + } + if ($item eq 'exttool') { + if (ref($domconfig{'coursedefaults'}{'domexttool'}) eq 'HASH') { + if (exists($domconfig{'coursedefaults'}{'domexttool'}{$lctype})) { + $domdefdom = $domconfig{'coursedefaults'}{'domexttool'}{$lctype}; + } + } + } + } + } + if ($item eq 'ltiauth') { + if ($domdef) { + $domdefdisplay = $titles->{'link'}; + } else { + $domdefdisplay = $titles->{'logi'}; + } + } elsif ($item eq 'exttool') { + if ($domdef && $domdefdom) { + $domdefdisplay = $titles->{'both'}; + } elsif ($domdef) { + $domdefdisplay = $titles->{'crs'}; + } elsif ($domdefdom) { + $domdefdisplay = $titles->{'dom'}; + } else { + $domdefdisplay = $titles->{'none'}; + } + } elsif ($item eq 'crsauthor') { + if ($domdef) { + $domdefdisplay = $titles->{'on'}; + } else { + $domdefdisplay = $titles->{'off'}; + } + } + return ($title,$domdefdisplay,\%settings,\%optiontext,\@options); +} + sub modify_selfenrollconfig { my ($r,$type,$cdesc,$coursehash) = @_; return unless(ref($coursehash) eq 'HASH'); @@ -2508,182 +2508,70 @@ sub modify_catsettings { return; } -sub modify_ltiauth { - my ($r,$cdom,$cnum,$cdesc,$domdesc,$type) = @_; - 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', - 'modi' => 'Save', - 'back' => 'Pick another action', - ); - &print_header($r,$type); - $r->print('

'.$lt{'requ'}.'

'."\n". - '

'.&mt($type).': '.$cdesc.'

'."\n". - '
'."\n"); - my %oldsettings = &Apache::lonnet::get('environment',['internal.ltiauth'],$cdom,$cnum); - my $oldltiauth = $oldsettings{'internal.ltiauth'}; - my $domdef; - my %domconfig = - &Apache::lonnet::get_dom('configuration',['coursedefaults'],$cdom); - if (ref($domconfig{'coursedefaults'}) eq 'HASH') { - $domdef = $domconfig{'coursedefaults'}{'ltiauth'}; - } - my ($newltiauth,$nochange,$change,$status,$error,$ltiauth); - if ($env{'form.ltiauthset'} eq 'dom') { - if ($oldltiauth eq '') { - $nochange = 1; - } else { - $change = 1; - } - } elsif ($env{'form.ltiauthset'} eq 'course') { - if ($env{'form.ltiauth'} =~ /^0|1$/) { - $newltiauth = $env{'form.ltiauth'}; - } - if ($oldltiauth == $newltiauth) { - $nochange = 1; - } else { - $change = 1; - } - } - if ($change) { - if ($newltiauth ne '') { - my %cenv = ( - 'internal.ltiauth' => $newltiauth, - ); - if (&Apache::lonnet::put('environment',\%cenv,$cdom,$cnum) eq 'ok') { - if ($env{'course.'.$cdom.'_'.$cnum.'.description'} ne '') { - &Apache::lonnet::appenv( - {'course.'.$cdom.'_'.$cnum.'.internal.ltiauth' => $newltiauth}); - } - } else { - $error = 1; - } - } else { - if (&Apache::lonnet::del('environment',['internal.ltiauth'],$cdom,$cnum) eq 'ok') { - if (exists($env{'course.'.$cdom.'_'.$cnum.'.internal.ltiauth'})) { - &Apache::lonnet::delenv('course.'.$cdom.'_'.$cnum.'.internal.ltiauth'); - } - } else { - $error = 1; - } - } +sub modify_default_overrides { + my ($r,$cdom,$cnum,$cdesc,$domdesc,$type,$item) = @_; + my (%titles,$oldcrsval,$newcrsval,%resulttext,$itemvalue,$nochange,$change,$status,$error); + %titles = &default_overrides_titles($type); + my ($title,$domdefdisplay,$oldsettings,$optiontext,$options) = + &default_overrides_common($item,$cdom,$cnum,$type,\%titles); + $oldcrsval = $oldsettings->{'internal.'.$item}; + if ($item eq 'ltiauth') { + %resulttext = + &Apache::lonlocal::texthash( + chg => 'Re-authentication requirement for LTI launch of deep-linked changed', + nochg => 'Re-authentication requirement for LTI launch of deep-linked item is unchanged', + ); + } elsif ($item eq 'exttool') { + %resulttext = + &Apache::lonlocal::texthash( + chg => 'External Tool permissions changed', + nochg => 'External Tool permissions unchanged', + ); + } elsif ($item eq 'crsauthor') { + %resulttext = + &Apache::lonlocal::texthash( + chg => 'In-course authoring permissions changed', + nochg => 'In-course authoring permissions unchanged', + ); } - if ($error) { - $nochange = 1; - } - if ($nochange) { - $ltiauth = $oldltiauth; - } else { - $ltiauth = $newltiauth; - } - if ($ltiauth eq '') { - $status = $lt{'used'}.': '; - if ($domdef) { - $status .= ''.$lt{'link'}.''; - } else { - $status .= ''.$lt{'logi'}.''; - } - } else { - $status = $lt{'cour'}.': '; - if ($ltiauth) { - $status .= ''.$lt{'link'}.''; - } else { - $status .= ''.$lt{'logi'}.''; - } - } - if ($error) { - $r->print('

'.&mt('An error occurred when saving your changes').'

'); - } - $r->print('

'); - if ($nochange) { - $r->print(&mt('Re-authentication requirement for LTI launch of deep-linked item is unchanged')); - } elsif ($change) { - $r->print(&mt('Re-authentication requirement for LTI launch of deep-linked changed')); - } - $r->print('
'.$status.'

'. - &hidden_form_elements().'
'); - my @actions = - (''. - $lt{'back'}.''); - $r->print('
'.&Apache::lonhtmlcommon::actionbox(\@actions)); - return; -} - -sub modify_exttool { - my ($r,$cdom,$cnum,$cdesc,$domdesc,$type) = @_; - my %titles = &exttool_titles($type); &print_header($r,$type); - $r->print('

'.$titles{'extt'}.'

'."\n". - '

'.$type.': '.$cdesc.'

'."\n". - '
'."\n"); - my %oldsettings = &Apache::lonnet::get('environment',['internal.exttool'],$cdom,$cnum); - my $oldcrsexttool = $oldsettings{'internal.exttool'}; - my $domdefdom = 1; - my $domdef = 0; - my $domdefdisplay; - my %settings = &Apache::lonnet::get('environment',['internal.coursecode', - 'internal.textbook'],$cdom,$cnum); - my $lctype = &get_lctype($type,\%settings); - my %domconfig = - &Apache::lonnet::get_dom('configuration',['coursedefaults'],$cdom); - if (ref($domconfig{'coursedefaults'}) eq 'HASH') { - if (ref($domconfig{'coursedefaults'}{'domexttool'}) eq 'HASH') { - if (exists($domconfig{'coursedefaults'}{'domexttool'}{$lctype})) { - $domdefdom = $domconfig{'coursedefaults'}{'domexttool'}{$lctype}; - } - } - if (ref($domconfig{'coursedefaults'}{'exttool'}) eq 'HASH') { - if (exists($domconfig{'coursedefaults'}{'exttool'}{$lctype})) { - $domdef = $domconfig{'coursedefaults'}{'exttool'}{$lctype}; - } - } - } - if ($domdef && $domdefdom) { - $domdefdisplay = $titles{'both'}; - } elsif ($domdef) { - $domdefdisplay = $titles{'crs'}; - } elsif ($domdefdom) { - $domdefdisplay = $titles{'dom'}; - } else { - $domdefdisplay = $titles{'none'}; - } - my ($newcrsexttool,$nochange,$change,$status,$error,$exttool); - if ($env{'form.exttoolset'} eq 'dom') { - if ($oldcrsexttool eq '') { + $r->print('

'.$title.'

'."\n". + '

'.&mt($type).': '.$cdesc.'

'."\n". + ''."\n"); + if ($env{'form.'.$item.'set'} eq 'dom') { + if ($oldcrsval eq '') { $nochange = 1; } else { $change = 1; } - } elsif ($env{'form.exttoolset'} eq 'course') { - if ($env{'form.exttool'} =~ /^both|dom|crs|none$/) { - $newcrsexttool = $env{'form.exttool'}; + } elsif ($env{'form.'.$item.'set'} eq 'course') { + my $posscrsval = $env{'form.'.$item}; + if (grep(/^\Q$posscrsval\E$/,@{$options})) { + $newcrsval = $posscrsval; } - if ($oldcrsexttool eq $newcrsexttool) { + if ($oldcrsval eq $newcrsval) { $nochange = 1; } else { $change = 1; } } if ($change) { - if ($newcrsexttool ne '') { + if ($newcrsval ne '') { my %cenv = ( - 'internal.exttool' => $newcrsexttool, + 'internal.'.$item => $newcrsval, ); if (&Apache::lonnet::put('environment',\%cenv,$cdom,$cnum) eq 'ok') { if ($env{'course.'.$cdom.'_'.$cnum.'.description'} ne '') { &Apache::lonnet::appenv( - {'course.'.$cdom.'_'.$cnum.'.internal.exttool' => $newcrsexttool}); + {'course.'.$cdom.'_'.$cnum.'.internal.'.$item => $newcrsval}); } } else { $error = 1; } } else { - if (&Apache::lonnet::del('environment',['internal.exttool'],$cdom,$cnum) eq 'ok') { - if (exists($env{'course.'.$cdom.'_'.$cnum.'.internal.exttool'})) { - &Apache::lonnet::delenv('course.'.$cdom.'_'.$cnum.'.internal.exttool'); + if (&Apache::lonnet::del('environment',['internal.'.$item],$cdom,$cnum) eq 'ok') { + if (exists($env{'course.'.$cdom.'_'.$cnum.'.internal.'.$item})) { + &Apache::lonnet::delenv('course.'.$cdom.'_'.$cnum.'.internal.'.$item); } } else { $error = 1; @@ -2694,28 +2582,30 @@ sub modify_exttool { $nochange = 1; } if ($nochange) { - $exttool = $oldcrsexttool; + $itemvalue = $oldcrsval; } else { - $exttool = $newcrsexttool; + $itemvalue = $newcrsval; } - if ($exttool eq '') { - $status = $titles{'used'}.': '.$domdefdisplay.''; + if ($itemvalue eq '') { + $status = $titles{'used'}.': '. + ''.$domdefdisplay.''; } else { - $status = $titles{'cour'}.': '.$titles{$exttool}.''; + $status = $titles{'cour'}.': '. + ''.$optiontext->{$itemvalue}.''; } if ($error) { $r->print('

'.&mt('An error occurred when saving your changes').'

'); } $r->print('

'); if ($nochange) { - $r->print(&mt('External Tool permissions unchanged')); + $r->print($resulttext{'nochg'}); } elsif ($change) { - $r->print(&mt('External Tool permissions changed')); + $r->print($resulttext{'chg'}); } $r->print('
'.$status.'

'. &hidden_form_elements().'
'); my @actions = - (''. + (''. $titles{'back'}.''); $r->print('
'.&Apache::lonhtmlcommon::actionbox(\@actions)); return; @@ -2877,40 +2767,21 @@ function togglePostsubmit(caller) { ENDSCRIPT - } elsif ($phase eq 'setltiauth') { + } elsif (($phase eq 'setltiauth') || ($phase eq 'setexttool') || ($phase eq 'setcrsauthor')) { $js .= <<"ENDJS"; -function toggleLTIOptions(form) { - var radioname = 'ltiauthset'; - var divid = 'crsltiauth'; - var num = form.elements[radioname].length; - if (num) { - var setvis = ''; - for (var i=0; i {'onload' => "hide_searching(); courseSet(document.filterpicker.official, 'load');"}, }; - } elsif ($env{'form.phase'} eq 'setltiauth') { + } elsif ($env{'form.phase'} =~ /^set(ltiauth|exttool|crsauthor)$/) { $starthash = { - add_entries => {'onload' => "toggleLTIOptions(document.setltiauth);"}, - }; - } elsif ($env{'form.phase'} eq 'setexttool') { - $starthash = { - add_entries => {'onload' => "toggleExtToolOptions(document.setexttool);"}, + add_entries => {'onload' => "toggleOptions(document.$env{'form.phase'},'$env{'form.phase'}');"}, }; } $r->print(&Apache::loncommon::start_page('View/Modify Course/Community Settings', @@ -3061,7 +2928,8 @@ sub hidden_form_elements { 'threshold','postsubmit','postsubtimeout','defaultcredits','uploadquota', 'selfenrollmgrdc','selfenrollmgrcc','action','state','currsec_st', 'sections','newsec','mysqltables','nopasswdchg','ltiauth','ltiauthset', - 'exttoolset','exttool'],['^selfenrollmgr_','^selfenroll_'])."\n". + 'exttoolset','exttool','crsauthorset','crsauthor'], + ['^selfenrollmgr_','^selfenroll_'])."\n". ''; return $hidden_elements; } @@ -3098,6 +2966,8 @@ sub get_permission { processltiauth => 'edit', setexttool => 'edit', processexttool => 'edit', + setcrsauthor => 'edit', + processcrsauthor => 'edit', ); if ($passwdconf{'crsownerchg'}) { $permission{passwdchg} = 'edit'; @@ -3115,6 +2985,7 @@ sub get_permission { adhocrole => 'custom', setltiauth => 'view', setexttool => 'view', + setcrsauthor => 'view', ); if ($passwdconf{'crsownerchg'}) { $permission{passwdchg} = 'view'; @@ -3321,27 +3192,39 @@ sub handler { } elsif (($phase eq 'setltiauth') && ($permission->{'setltiauth'})) { &Apache::lonhtmlcommon::add_breadcrumb ({href=>"javascript:changePage(document.$phase,'$phase')", - text=>"Requirement for re-authentication for LTI launch of deep-linked item"}); - &print_set_ltiauth($r,$cdom,$cnum,$cdesc,$type,$readonly); + text=>"Authentication post-LTI launch"}); + &print_default_overrides($r,$cdom,$cnum,$cdesc,$type,$readonly,'ltiauth'); } elsif (($phase eq 'processltiauth') && ($permission->{'processltiauth'})) { &Apache::lonhtmlcommon::add_breadcrumb ({href=>"javascript:changePage(document.$phase,'setltiauth')", - text=>"Requirement for re-authentication for LTI launch of deep-linked item"}, + text=>"Authentication post-LTI launch"}, {href=>"javascript:changePage(document.$phase,'$phase')", text=>"Result"}); - &modify_ltiauth($r,$cdom,$cnum,$cdesc,$domdesc,$type); + &modify_default_overrides($r,$cdom,$cnum,$cdesc,$domdesc,$type,'ltiauth'); } elsif (($phase eq 'setexttool') && ($permission->{'setexttool'})) { &Apache::lonhtmlcommon::add_breadcrumb ({href=>"javascript:changePage(document.$phase,'$phase')", text=>"External Tool permission"}); - &print_set_exttool($r,$cdom,$cnum,$cdesc,$type,$readonly); + &print_default_overrides($r,$cdom,$cnum,$cdesc,$type,$readonly,'exttool'); } elsif (($phase eq 'processexttool') && ($permission->{'processexttool'})) { &Apache::lonhtmlcommon::add_breadcrumb ({href=>"javascript:changePage(document.$phase,'setexttool')", text=>"External Tool permission"}, {href=>"javascript:changePage(document.$phase,'$phase')", text=>"Result"}); - &modify_exttool($r,$cdom,$cnum,$cdesc,$domdesc,$type); + &modify_default_overrides($r,$cdom,$cnum,$cdesc,$domdesc,$type,'exttool'); + } elsif (($phase eq 'setcrsauthor') && ($permission->{'setcrsauthor'})) { + &Apache::lonhtmlcommon::add_breadcrumb + ({href=>"javascript:changePage(document.$phase,'$phase')", + text=>"In-course authoring permission"}); + &print_default_overrides($r,$cdom,$cnum,$cdesc,$type,$readonly,'crsauthor'); + } elsif (($phase eq 'processcrsauthor') && ($permission->{'processcrsauthor'})) { + &Apache::lonhtmlcommon::add_breadcrumb + ({href=>"javascript:changePage(document.$phase,'setcrsauthor')", + text=>"In-course authoring permission"}, + {href=>"javascript:changePage(document.$phase,'$phase')", + text=>"Result"}); + &modify_default_overrides($r,$cdom,$cnum,$cdesc,$domdesc,$type,'crsauthor'); } } } else {