version 1.390, 2021/11/22 22:19:58
|
version 1.391, 2021/11/22 23:40:59
|
Line 3249 sub lti_toggle_js {
|
Line 3249 sub lti_toggle_js {
|
localauth => 'Local auth argument', |
localauth => 'Local auth argument', |
krb => 'Kerberos domain', |
krb => 'Kerberos domain', |
); |
); |
|
my $crsincalert = &mt('"User\'s identity sent" needs to be set to "Yes" first,[_1] before setting "Course\'s identity sent" to "Yes"',"\n"); |
|
&js_escape(\$crsincalert); |
return <<"ENDSCRIPT"; |
return <<"ENDSCRIPT"; |
<script type="text/javascript"> |
<script type="text/javascript"> |
// <![CDATA[ |
// <![CDATA[ |
|
|
function toggleLTI(form,setting,item) { |
function toggleLTI(form,setting,item) { |
if (setting == 'requser') { |
if ((setting == 'requser') || (setting == 'crsinc')) { |
var fieldsets = document.getElementsByClassName('ltioption_'+item); |
var usrfieldsets = document.getElementsByClassName('ltioption_usr_'+item); |
if (fieldsets.length) { |
var setvis = ''; |
var radioname = 'lti_'+setting+'_'+item; |
var radioname = 'lti_requser_'+item; |
|
var num = form.elements[radioname].length; |
|
if (num) { |
|
for (var i=0; i<num; i++) { |
|
if (form.elements[radioname][i].checked) { |
|
if (form.elements[radioname][i].value == '1') { |
|
setvis = 1; |
|
break; |
|
} |
|
} |
|
} |
|
} |
|
if (usrfieldsets.length) { |
|
for (var j=0; j<usrfieldsets.length; j++) { |
|
if (setvis) { |
|
usrfieldsets[j].style.display = 'block'; |
|
} else { |
|
usrfieldsets[j].style.display = 'none'; |
|
} |
|
} |
|
} |
|
var crsfieldsets = document.getElementsByClassName('ltioption_crs_'+item); |
|
if (crsfieldsets.length) { |
|
radioname = 'lti_crsinc_'+item; |
var num = form.elements[radioname].length; |
var num = form.elements[radioname].length; |
if (num) { |
if (num) { |
var setvis = ''; |
var crsvis = ''; |
for (var i=0; i<num; i++) { |
for (var i=0; i<num; i++) { |
if (form.elements[radioname][i].checked) { |
if (form.elements[radioname][i].checked) { |
if (form.elements[radioname][i].value == '1') { |
if (form.elements[radioname][i].value == '1') { |
setvis = 1; |
if (setvis == '') { |
break; |
if (setting == 'crsinc'){ |
|
alert("$crsincalert"); |
|
form.elements[radioname][0].checked = true; |
|
} |
|
} else { |
|
crsvis = 1; |
|
} |
|
break; |
} |
} |
} |
} |
} |
} |
for (var j=0; j<fieldsets.length; j++) { |
setvis = crsvis; |
if (setvis) { |
} |
fieldsets[j].style.display = 'block'; |
for (var j=0; j<crsfieldsets.length; j++) { |
} else { |
if (setvis) { |
fieldsets[j].style.display = 'none'; |
crsfieldsets[j].style.display = 'block'; |
} |
} else { |
|
crsfieldsets[j].style.display = 'none'; |
} |
} |
} |
} |
} |
} |
Line 5954 sub print_lti {
|
Line 5987 sub print_lti {
|
for (my $i=0; $i<@items; $i++) { |
for (my $i=0; $i<@items; $i++) { |
$css_class = $itemcount%2?' class="LC_odd_row"':''; |
$css_class = $itemcount%2?' class="LC_odd_row"':''; |
my $item = $ordered{$items[$i]}; |
my $item = $ordered{$items[$i]}; |
my ($key,$secret,$lifetime,$consumer,$requser,$current); |
my ($key,$secret,$lifetime,$consumer,$requser,$crsinc,$current); |
if (ref($settings->{$item}) eq 'HASH') { |
if (ref($settings->{$item}) eq 'HASH') { |
$key = $settings->{$item}->{'key'}; |
$key = $settings->{$item}->{'key'}; |
$secret = $settings->{$item}->{'secret'}; |
$secret = $settings->{$item}->{'secret'}; |
$lifetime = $settings->{$item}->{'lifetime'}; |
$lifetime = $settings->{$item}->{'lifetime'}; |
$consumer = $settings->{$item}->{'consumer'}; |
$consumer = $settings->{$item}->{'consumer'}; |
$requser = $settings->{$item}->{'requser'}; |
$requser = $settings->{$item}->{'requser'}; |
|
$crsinc = $settings->{$item}->{'crsinc'}; |
$current = $settings->{$item}; |
$current = $settings->{$item}; |
} |
} |
my $onclickrequser = ' onclick="toggleLTI(this.form,'."'requser','$i'".');"'; |
my $onclickrequser = ' onclick="toggleLTI(this.form,'."'requser','$i'".');"'; |
Line 5972 sub print_lti {
|
Line 6006 sub print_lti {
|
$checkedrequser{'no'} = $checkedrequser{'yes'}; |
$checkedrequser{'no'} = $checkedrequser{'yes'}; |
$checkedrequser{'yes'} = ''; |
$checkedrequser{'yes'} = ''; |
} |
} |
|
my $onclickcrsinc = ' onclick="toggleLTI(this.form,'."'crsinc','$i'".');"'; |
|
my %checkedcrsinc = ( |
|
yes => ' checked="checked"', |
|
no => '', |
|
); |
|
if (!$crsinc) { |
|
$checkedcrsinc{'no'} = $checkedcrsinc{'yes'}; |
|
$checkedcrsinc{'yes'} = ''; |
|
} |
my $chgstr = ' onchange="javascript:reorderLTI(this.form,'."'lti_pos_".$item."'".');"'; |
my $chgstr = ' onchange="javascript:reorderLTI(this.form,'."'lti_pos_".$item."'".');"'; |
$datatable .= '<tr '.$css_class.'><td><span class="LC_nobreak">' |
$datatable .= '<tr '.$css_class.'><td><span class="LC_nobreak">' |
.'<select name="lti_pos_'.$item.'"'.$chgstr.'>'; |
.'<select name="lti_pos_'.$item.'"'.$chgstr.'>'; |
Line 6001 sub print_lti {
|
Line 6044 sub print_lti {
|
'<label><input type="radio" name="lti_requser_'.$i.'" value="1"'.$onclickrequser.$checkedrequser{yes}.' />'.&mt('Yes').'</label> '."\n". |
'<label><input type="radio" name="lti_requser_'.$i.'" value="1"'.$onclickrequser.$checkedrequser{yes}.' />'.&mt('Yes').'</label> '."\n". |
'<label><input type="radio" name="lti_requser_'.$i.'" value="0"'.$onclickrequser.$checkedrequser{no}.' />'.&mt('No').'</label></span>'."\n". |
'<label><input type="radio" name="lti_requser_'.$i.'" value="0"'.$onclickrequser.$checkedrequser{no}.' />'.&mt('No').'</label></span>'."\n". |
'<br /><br />'. |
'<br /><br />'. |
|
'<span class="LC_nobreak">'.$lt{'crsinc'}.':'. |
|
'<label><input type="radio" name="lti_crsinc_'.$i.'" value="1"'.$onclickcrsinc.$checkedcrsinc{yes}.' />'.&mt('Yes').'</label> '."\n". |
|
'<label><input type="radio" name="lti_crsinc_'.$i.'" value="0"'.$onclickcrsinc.$checkedcrsinc{no}.' />'.&mt('No').'</label></span>'."\n". |
|
(' 'x4). |
'<span class="LC_nobreak">'.$lt{'key'}. |
'<span class="LC_nobreak">'.$lt{'key'}. |
':<input type="text" size="25" name="lti_key_'.$i.'" value="'.$key.'" /></span> '. |
':<input type="text" size="25" name="lti_key_'.$i.'" value="'.$key.'" /></span> '. |
(' 'x2). |
(' 'x2). |
Line 6041 sub print_lti {
|
Line 6088 sub print_lti {
|
'<label><input type="radio" name="lti_requser_add" value="1" onclick="toggleLTI(this.form,'."'requser','add'".');" checked="checked" />'.&mt('Yes').'</label> '."\n". |
'<label><input type="radio" name="lti_requser_add" value="1" onclick="toggleLTI(this.form,'."'requser','add'".');" checked="checked" />'.&mt('Yes').'</label> '."\n". |
'<label><input type="radio" name="lti_requser_add" value="0" onclick="toggleLTI(this.form,'."'requser','add'".');" />'.&mt('No').'</label></span>'."\n". |
'<label><input type="radio" name="lti_requser_add" value="0" onclick="toggleLTI(this.form,'."'requser','add'".');" />'.&mt('No').'</label></span>'."\n". |
'<br /><br />'. |
'<br /><br />'. |
|
'<span class="LC_nobreak">'.$lt{'crsinc'}.':'. |
|
'<label><input type="radio" name="lti_crsinc_add" value="1" onclick="toggleLTI(this.form,'."'crsinc','add'".');" checked="checked" />'.&mt('Yes').'</label> '."\n". |
|
'<label><input type="radio" name="lti_crsinc_add" value="0" onclick="toggleLTI(this.form,'."'crsinc','add'".');" />'.&mt('No').'</label></span>'."\n". |
|
(' 'x4). |
'<span class="LC_nobreak">'.$lt{'key'}.':<input type="text" size="25" name="lti_key_add" value="" /></span> '."\n". |
'<span class="LC_nobreak">'.$lt{'key'}.':<input type="text" size="25" name="lti_key_add" value="" /></span> '."\n". |
(' 'x2). |
(' 'x2). |
'<span class="LC_nobreak">'.$lt{'secret'}.':<input type="password" size="20" name="lti_secret_add" value="" />'. |
'<span class="LC_nobreak">'.$lt{'secret'}.':<input type="password" size="20" name="lti_secret_add" value="" />'. |
Line 6061 sub lti_names {
|
Line 6112 sub lti_names {
|
'consumer' => 'Consumer', |
'consumer' => 'Consumer', |
'secret' => 'Secret', |
'secret' => 'Secret', |
'requser' => "User's identity sent", |
'requser' => "User's identity sent", |
|
'crsinc' => "Course's identity sent", |
'email' => 'Email address', |
'email' => 'Email address', |
'sourcedid' => 'User ID', |
'sourcedid' => 'User ID', |
'other' => 'Other', |
'other' => 'Other', |
Line 6095 sub lti_options {
|
Line 6147 sub lti_options {
|
my $callbacksty = 'none'; |
my $callbacksty = 'none'; |
my $passbacksty = 'none'; |
my $passbacksty = 'none'; |
my $optionsty = 'block'; |
my $optionsty = 'block'; |
|
my $crssty = 'block'; |
my $lcauthparm; |
my $lcauthparm; |
my $lcauthparmstyle = 'display:none'; |
my $lcauthparmstyle = 'display:none'; |
my $lcauthparmtext; |
my $lcauthparmtext; |
Line 6105 sub lti_options {
|
Line 6158 sub lti_options {
|
if (ref($current) eq 'HASH') { |
if (ref($current) eq 'HASH') { |
if (!$current->{'requser'}) { |
if (!$current->{'requser'}) { |
$optionsty = 'none'; |
$optionsty = 'none'; |
|
$crssty = 'none'; |
|
} elsif (!$current->{'crsinc'}) { |
|
$crssty = 'none'; |
} |
} |
if (($current->{'mapuser'} ne '') && ($current->{'mapuser'} ne 'lis_person_sourcedid')) { |
if (($current->{'mapuser'} ne '') && ($current->{'mapuser'} ne 'lis_person_sourcedid')) { |
$checked{'mapuser'}{'sourcedid'} = ''; |
$checked{'mapuser'}{'sourcedid'} = ''; |
Line 6237 sub lti_options {
|
Line 6293 sub lti_options {
|
my $onclicksecsrc = ' onclick="toggleLTI(this.form,'."'secsrc','$num'".')"'; |
my $onclicksecsrc = ' onclick="toggleLTI(this.form,'."'secsrc','$num'".')"'; |
my $onclicklcauth = ' onclick="toggleLTI(this.form,'."'lcauth','$num'".')"'; |
my $onclicklcauth = ' onclick="toggleLTI(this.form,'."'lcauth','$num'".')"'; |
my $onclickmenu = ' onclick="toggleLTI(this.form,'."'lcmenu','$num'".');"'; |
my $onclickmenu = ' onclick="toggleLTI(this.form,'."'lcmenu','$num'".');"'; |
my $output = '<fieldset class="ltioption_'.$num.'" style="display:'.$optionsty.'"><legend>'.&mt('Mapping users').'</legend>'. |
my $output = '<fieldset class="ltioption_usr_'.$num.'" style="display:'.$optionsty.'"><legend>'.&mt('Logout options').'</legend>'. |
|
'<div class="LC_floatleft"><span class="LC_nobreak">'.&mt('Callback on logout').': '. |
|
'<label><input type="radio" name="lti_callback_'.$num.'" value="0"'. |
|
$checked{'callback'}{'N'}.$onclickcallback.' />'.&mt('No').'</label>'.(' 'x2). |
|
'<label><input type="radio" name="lti_callback_'.$num.'" value="1"'. |
|
$checked{'callback'}{'Y'}.$onclickcallback.' />'.&mt('Yes').'</label></span></div>'. |
|
'<div class="LC_floatleft" style="display:'.$callbacksty.';" id="lti_callbackfield_'.$num.'">'. |
|
'<span class="LC_nobreak">'.&mt('Parameter').': '. |
|
'<input type="text" name="lti_callbackparam_'.$num.'" value="'.$callback.'" /></span>'. |
|
'</div><div style="padding:0;clear:both;margin:0;border:0"></div></fieldset>'. |
|
'<fieldset class="ltioption_usr_'.$num.'" style="display:'.$optionsty.'"><legend>'.&mt('Mapping users').'</legend>'. |
'<div class="LC_floatleft"><span class="LC_nobreak">'.&mt('LON-CAPA username').': '; |
'<div class="LC_floatleft"><span class="LC_nobreak">'.&mt('LON-CAPA username').': '; |
foreach my $option ('sourcedid','email','other') { |
foreach my $option ('sourcedid','email','other') { |
$output .= '<label><input type="radio" name="lti_mapuser_'.$num.'" value="'.$option.'"'. |
$output .= '<label><input type="radio" name="lti_mapuser_'.$num.'" value="'.$option.'"'. |
Line 6248 sub lti_options {
|
Line 6314 sub lti_options {
|
'<div class="LC_floatleft" style="display:'.$userfieldsty.';" id="lti_userfield_'.$num.'">'. |
'<div class="LC_floatleft" style="display:'.$userfieldsty.';" id="lti_userfield_'.$num.'">'. |
'<input type="text" name="lti_customuser_'.$num.'" '. |
'<input type="text" name="lti_customuser_'.$num.'" '. |
'value="'.$userfield.'" /></div></fieldset>'. |
'value="'.$userfield.'" /></div></fieldset>'. |
'<fieldset class="ltioption_'.$num.'" style="display:'.$optionsty.'"><legend>'.&mt('Mapping course roles').'</legend><table><tr>'; |
'<fieldset class="ltioption_usr_'.$num.'" style="display:'.$optionsty.'"><legend>'.&mt('Roles which may create user accounts').'</legend>'; |
foreach my $ltirole (@lticourseroles) { |
|
my ($selected,$selectnone); |
|
if ($rolemaps{$ltirole} eq '') { |
|
$selectnone = ' selected="selected"'; |
|
} |
|
$output .= '<td style="text-align: center">'.$ltirole.'<br />'. |
|
'<select name="lti_maprole_'.$ltirole.'_'.$num.'">'. |
|
'<option value=""'.$selectnone.'>'.&mt('Select').'</option>'; |
|
foreach my $role (@courseroles) { |
|
unless ($selectnone) { |
|
if ($rolemaps{$ltirole} eq $role) { |
|
$selected = ' selected="selected"'; |
|
} else { |
|
$selected = ''; |
|
} |
|
} |
|
$output .= '<option value="'.$role.'"'.$selected.'>'. |
|
&Apache::lonnet::plaintext($role,'Course'). |
|
'</option>'; |
|
} |
|
$output .= '</select></td>'; |
|
} |
|
$output .= '</tr></table></fieldset>'. |
|
'<fieldset class="ltioption_'.$num.'" style="display:'.$optionsty.'"><legend>'.&mt('Roles which may create user accounts').'</legend>'; |
|
foreach my $ltirole (@ltiroles) { |
foreach my $ltirole (@ltiroles) { |
$output .= '<span class="LC_nobreak"><label><input type="checkbox" name="lti_makeuser_'.$num.'" value="'.$ltirole.'"'. |
$output .= '<span class="LC_nobreak"><label><input type="checkbox" name="lti_makeuser_'.$num.'" value="'.$ltirole.'"'. |
$checked{'makeuser'}{$ltirole}.' />'.$ltirole.'</label> </span> '; |
$checked{'makeuser'}{$ltirole}.' />'.$ltirole.'</label> </span> '; |
} |
} |
$output .= '</fieldset>'. |
$output .= '</fieldset>'. |
'<fieldset class="ltioption_'.$num.'" style="display:'.$optionsty.'"><legend>'.&mt('New user accounts created for LTI users').'</legend>'. |
'<fieldset class="ltioption_usr_'.$num.'" style="display:'.$optionsty.'"><legend>'.&mt('New user accounts created for LTI users').'</legend>'. |
'<table>'. |
'<table>'. |
&modifiable_userdata_row('lti','instdata_'.$num,$current,$numinrow,$itemcount). |
&modifiable_userdata_row('lti','instdata_'.$num,$current,$numinrow,$itemcount). |
'</table>'. |
'</table>'. |
Line 6301 sub lti_options {
|
Line 6343 sub lti_options {
|
'<span id="lti_lcauth_parmtext_'.$num.'">'.$lcauthparmtext.'</span>'. |
'<span id="lti_lcauth_parmtext_'.$num.'">'.$lcauthparmtext.'</span>'. |
'<input type="text" name="lti_lcauthparm_'.$num.'" value="" /></span></td></tr>'. |
'<input type="text" name="lti_lcauthparm_'.$num.'" value="" /></span></td></tr>'. |
'</table></fieldset>'. |
'</table></fieldset>'. |
'<fieldset class="ltioption_'.$num.'" style="display:'.$optionsty.'"><legend>'.&mt('Mapping courses').'</legend>'. |
'<fieldset class="ltioption_usr_'.$num.'" style="display:'.$optionsty.'"><legend>'. |
|
&mt('LON-CAPA menu items (Course Coordinator can override)').'</legend>'. |
|
'<div class="LC_floatleft"><span class="LC_nobreak">'.$lt{'topmenu'}.': '. |
|
'<label><input type="radio" name="lti_topmenu_'.$num.'" value="0"'. |
|
$checked{'topmenu'}{'N'}.$onclickmenu.' />'.&mt('No').'</label>'.(' 'x2). |
|
'<label><input type="radio" name="lti_topmenu_'.$num.'" value="1"'. |
|
$checked{'topmenu'}{'Y'}.$onclickmenu.' />'.&mt('Yes').'</label></span></div>'. |
|
'<div style="padding:0;clear:both;margin:0;border:0"></div>'. |
|
'<div class="LC_floatleft"><span class="LC_nobreak">'.$lt{'inlinemenu'}.': '. |
|
'<label><input type="radio" name="lti_inlinemenu_'.$num.'" value="0"'. |
|
$checked{'inlinemenu'}{'N'}.$onclickmenu.' />'.&mt('No').'</label>'.(' 'x2). |
|
'<label><input type="radio" name="lti_inlinemenu_'.$num.'" value="1"'. |
|
$checked{'inlinemenu'}{'Y'}.$onclickmenu.' />'.&mt('Yes').'</label></span></div>'; |
|
$output .='<div style="padding:0;clear:both;margin:0;border:0"></div>'. |
|
'<div class="LC_floatleft" style="display:'.$menusty.';" id="lti_menufield_'.$num.'">'. |
|
'<span class="LC_nobreak">'.&mt('Menu items').': '; |
|
foreach my $type ('fullname','coursetitle','role','logout','grades') { |
|
$output .= '<label><input type="checkbox" name="lti_menuitem_'.$num.'" value="'.$type.'"'. |
|
$checked{'menuitem'}{$type}.' />'.$menutitles{$type}.'</label>'. |
|
(' 'x2); |
|
} |
|
$output .= '</span></div></fieldset>'. |
|
'<fieldset class="ltioption_crs_'.$num.'" style="display:'.$crssty.'"><legend>'.&mt('Mapping courses').'</legend>'. |
'<div class="LC_floatleft"><span class="LC_nobreak">'. |
'<div class="LC_floatleft"><span class="LC_nobreak">'. |
&mt('Unique course identifier').': '; |
&mt('Unique course identifier').': '; |
foreach my $option ('course_offering_sourcedid','context_id','other') { |
foreach my $option ('course_offering_sourcedid','context_id','other') { |
Line 6319 sub lti_options {
|
Line 6383 sub lti_options {
|
(' 'x2); |
(' 'x2); |
} |
} |
$output .= '</span></fieldset>'. |
$output .= '</span></fieldset>'. |
'<fieldset class="ltioption_'.$num.'" style="display:'.$optionsty.'"><legend>'.&mt('Creating courses').'</legend>'. |
'<fieldset class="ltioption_crs_'.$num.'" style="display:'.$crssty.'"><legend>'.&mt('Mapping course roles').'</legend><table><tr>'; |
|
foreach my $ltirole (@lticourseroles) { |
|
my ($selected,$selectnone); |
|
if ($rolemaps{$ltirole} eq '') { |
|
$selectnone = ' selected="selected"'; |
|
} |
|
$output .= '<td style="text-align: center">'.$ltirole.'<br />'. |
|
'<select name="lti_maprole_'.$ltirole.'_'.$num.'">'. |
|
'<option value=""'.$selectnone.'>'.&mt('Select').'</option>'; |
|
foreach my $role (@courseroles) { |
|
unless ($selectnone) { |
|
if ($rolemaps{$ltirole} eq $role) { |
|
$selected = ' selected="selected"'; |
|
} else { |
|
$selected = ''; |
|
} |
|
} |
|
$output .= '<option value="'.$role.'"'.$selected.'>'. |
|
&Apache::lonnet::plaintext($role,'Course'). |
|
'</option>'; |
|
} |
|
$output .= '</select></td>'; |
|
} |
|
$output .= '</tr></table></fieldset>'. |
|
'<fieldset class="ltioption_crs_'.$num.'" style="display:'.$crssty.'"><legend>'.&mt('Creating courses').'</legend>'. |
'<span class="LC_nobreak">'.&mt('Course created (if absent) on Instructor access').': '. |
'<span class="LC_nobreak">'.&mt('Course created (if absent) on Instructor access').': '. |
'<label><input type="radio" name="lti_makecrs_'.$num.'" value="0"'. |
'<label><input type="radio" name="lti_makecrs_'.$num.'" value="0"'. |
$checked{'makecrs'}{'N'}.' />'.&mt('No').'</label>'.(' 'x2). |
$checked{'makecrs'}{'N'}.' />'.&mt('No').'</label>'.(' 'x2). |
'<label><input type="radio" name="lti_makecrs_'.$num.'" value="1"'. |
'<label><input type="radio" name="lti_makecrs_'.$num.'" value="1"'. |
$checked{'makecrs'}{'Y'}.' />'.&mt('Yes').'</label></span>'. |
$checked{'makecrs'}{'Y'}.' />'.&mt('Yes').'</label></span>'. |
'</fieldset>'. |
'</fieldset>'. |
'<fieldset class="ltioption_'.$num.'" style="display:'.$optionsty.'"><legend>'.&mt('Roles which may self-enroll').'</legend>'; |
'<fieldset class="ltioption_crs_'.$num.'" style="display:'.$crssty.'"><legend>'.&mt('Roles which may self-enroll').'</legend>'; |
foreach my $lticrsrole (@lticourseroles) { |
foreach my $lticrsrole (@lticourseroles) { |
$output .= '<span class="LC_nobreak"><label><input type="checkbox" name="lti_selfenroll_'.$num.'" value="'.$lticrsrole.'"'. |
$output .= '<span class="LC_nobreak"><label><input type="checkbox" name="lti_selfenroll_'.$num.'" value="'.$lticrsrole.'"'. |
$checked{'selfenroll'}{$lticrsrole}.' />'.$lticrsrole.'</label> </span> '; |
$checked{'selfenroll'}{$lticrsrole}.' />'.$lticrsrole.'</label> </span> '; |
} |
} |
$output .= '</fieldset>'. |
$output .= '</fieldset>'. |
'<fieldset class="ltioption_'.$num.'" style="display:'.$optionsty.'"><legend>'.&mt('Course options').'</legend>'. |
'<fieldset class="ltioption_crs_'.$num.'" style="display:'.$crssty.'"><legend>'.&mt('Course options').'</legend>'. |
'<div class="LC_floatleft"><span class="LC_nobreak">'.&mt('Assign users to sections').': '. |
'<div class="LC_floatleft"><span class="LC_nobreak">'.&mt('Assign users to sections').': '. |
'<label><input type="radio" name="lti_crssec_'.$num.'" value="0"'. |
'<label><input type="radio" name="lti_crssec_'.$num.'" value="0"'. |
$checked{'crssec'}{'N'}.$onclicksec.' />'.&mt('No').'</label>'.(' 'x2). |
$checked{'crssec'}{'N'}.$onclicksec.' />'.&mt('No').'</label>'.(' 'x2). |
Line 6384 sub lti_options {
|
Line 6472 sub lti_options {
|
&mt('Outcomes Service (1.1)').'</label>'.(' 'x2). |
&mt('Outcomes Service (1.1)').'</label>'.(' 'x2). |
'<label><input type="radio" name="lti_passbackformat_'.$num.'" value="1.0"'.$pb1p0chk.'/>'. |
'<label><input type="radio" name="lti_passbackformat_'.$num.'" value="1.0"'.$pb1p0chk.'/>'. |
&mt('Outcomes Extension (1.0)').'</label></span></div>'. |
&mt('Outcomes Extension (1.0)').'</label></span></div>'. |
'<div style="padding:0;clear:both;margin:0;border:0"></div>'. |
'<div style="padding:0;clear:both;margin:0;border:0"></div></fieldset>'; |
'<div class="LC_floatleft"><span class="LC_nobreak">'.&mt('Callback on logout').': '. |
|
'<label><input type="radio" name="lti_callback_'.$num.'" value="0"'. |
|
$checked{'callback'}{'N'}.$onclickcallback.' />'.&mt('No').'</label>'.(' 'x2). |
|
'<label><input type="radio" name="lti_callback_'.$num.'" value="1"'. |
|
$checked{'callback'}{'Y'}.$onclickcallback.' />'.&mt('Yes').'</label></span></div>'. |
|
'<div class="LC_floatleft" style="display:'.$callbacksty.';" id="lti_callbackfield_'.$num.'">'. |
|
'<span class="LC_nobreak">'.&mt('Parameter').': '. |
|
'<input type="text" name="lti_callbackparam_'.$num.'" value="'.$callback.'" /></span>'. |
|
'</div><div style="padding:0;clear:both;margin:0;border:0"></div></fieldset>'. |
|
'<fieldset class="ltioption_'.$num.'" style="display:'.$optionsty.'"><legend>'.&mt('Course defaults (Course Coordinator can override)').'</legend>'. |
|
'<div class="LC_floatleft"><span class="LC_nobreak">'.$lt{'topmenu'}.': '. |
|
'<label><input type="radio" name="lti_topmenu_'.$num.'" value="0"'. |
|
$checked{'topmenu'}{'N'}.$onclickmenu.' />'.&mt('No').'</label>'.(' 'x2). |
|
'<label><input type="radio" name="lti_topmenu_'.$num.'" value="1"'. |
|
$checked{'topmenu'}{'Y'}.$onclickmenu.' />'.&mt('Yes').'</label></span></div>'. |
|
'<div style="padding:0;clear:both;margin:0;border:0"></div>'. |
|
'<div class="LC_floatleft"><span class="LC_nobreak">'.$lt{'inlinemenu'}.': '. |
|
'<label><input type="radio" name="lti_inlinemenu_'.$num.'" value="0"'. |
|
$checked{'inlinemenu'}{'N'}.$onclickmenu.' />'.&mt('No').'</label>'.(' 'x2). |
|
'<label><input type="radio" name="lti_inlinemenu_'.$num.'" value="1"'. |
|
$checked{'inlinemenu'}{'Y'}.$onclickmenu.' />'.&mt('Yes').'</label></span></div>'; |
|
$output .='<div style="padding:0;clear:both;margin:0;border:0"></div>'. |
|
'<div class="LC_floatleft" style="display:'.$menusty.';" id="lti_menufield_'.$num.'">'. |
|
'<span class="LC_nobreak">'.&mt('Menu items').': '; |
|
foreach my $type ('fullname','coursetitle','role','logout','grades') { |
|
$output .= '<label><input type="checkbox" name="lti_menuitem_'.$num.'" value="'.$type.'"'. |
|
$checked{'menuitem'}{$type}.' />'.$menutitles{$type}.'</label>'. |
|
(' 'x2); |
|
} |
|
$output .= '</span></div></fieldset>'; |
$output .= '</span></div></fieldset>'; |
# '<fieldset><legend>'.&mt('Assigning author roles').'</legend>'; |
# '<fieldset><legend>'.&mt('Assigning author roles').'</legend>'; |
# |
# |
Line 14773 sub modify_lti {
|
Line 14832 sub modify_lti {
|
if ($position ne '') { |
if ($position ne '') { |
$allpos[$position] = $itemid; |
$allpos[$position] = $itemid; |
} |
} |
foreach my $item ('consumer','key','secret','lifetime','requser') { |
foreach my $item ('consumer','key','secret','lifetime','requser','crsinc') { |
my $formitem = 'form.lti_'.$item.'_'.$idx; |
my $formitem = 'form.lti_'.$item.'_'.$idx; |
$env{$formitem} =~ s/(`)/'/g; |
$env{$formitem} =~ s/(`)/'/g; |
if ($item eq 'lifetime') { |
if ($item eq 'lifetime') { |
Line 14806 sub modify_lti {
|
Line 14865 sub modify_lti {
|
$mapuser =~ s/^\s+|\s+$//g; |
$mapuser =~ s/^\s+|\s+$//g; |
$confhash{$itemid}{'mapuser'} = $mapuser; |
$confhash{$itemid}{'mapuser'} = $mapuser; |
} |
} |
foreach my $ltirole (@lticourseroles) { |
|
my $possrole = $env{'form.lti_maprole_'.$ltirole.'_'.$idx}; |
|
if (grep(/^\Q$possrole\E$/,@courseroles)) { |
|
$confhash{$itemid}{'maproles'}{$ltirole} = $possrole; |
|
} |
|
} |
|
my @possmakeuser = &Apache::loncommon::get_env_multiple('form.lti_makeuser_'.$idx); |
my @possmakeuser = &Apache::loncommon::get_env_multiple('form.lti_makeuser_'.$idx); |
my @makeuser; |
my @makeuser; |
foreach my $ltirole (sort(@possmakeuser)) { |
foreach my $ltirole (sort(@possmakeuser)) { |
Line 14844 sub modify_lti {
|
Line 14897 sub modify_lti {
|
} |
} |
} |
} |
} |
} |
if (($env{'form.lti_mapcrs_'.$idx} eq 'course_offering_sourcedid') || |
|
($env{'form.lti_mapcrs_'.$idx} eq 'context_id')) { |
|
$confhash{$itemid}{'mapcrs'} = $env{'form.lti_mapcrs_'.$idx}; |
|
} elsif ($env{'form.lti_mapcrs_'.$idx} eq 'other') { |
|
my $mapcrs = $env{'form.lti_mapcrsfield_'.$idx}; |
|
$mapcrs =~ s/(`)/'/g; |
|
$mapcrs =~ s/^\s+|\s+$//g; |
|
$confhash{$itemid}{'mapcrs'} = $mapcrs; |
|
} |
|
my @posstypes = &Apache::loncommon::get_env_multiple('form.lti_mapcrstype_'.$idx); |
|
my @crstypes; |
|
foreach my $type (sort(@posstypes)) { |
|
if ($posscrstype{$type}) { |
|
push(@crstypes,$type); |
|
} |
|
} |
|
$confhash{$itemid}{'mapcrstype'} = \@crstypes; |
|
if ($env{'form.lti_makecrs_'.$idx}) { |
|
$confhash{$itemid}{'makecrs'} = 1; |
|
} |
|
my @possenroll = &Apache::loncommon::get_env_multiple('form.lti_selfenroll_'.$idx); |
|
my @selfenroll; |
|
foreach my $type (sort(@possenroll)) { |
|
if ($posslticrs{$type}) { |
|
push(@selfenroll,$type); |
|
} |
|
} |
|
$confhash{$itemid}{'selfenroll'} = \@selfenroll; |
|
if ($env{'form.lti_crssec_'.$idx}) { |
|
if ($env{'form.lti_crssecsrc_'.$idx} eq 'course_section_sourcedid') { |
|
$confhash{$itemid}{'section'} = $env{'form.lti_crssecsrc_'.$idx}; |
|
} elsif ($env{'form.lti_crssecsrc_'.$idx} eq 'other') { |
|
my $section = $env{'form.lti_customsection_'.$idx}; |
|
$section =~ s/(`)/'/g; |
|
$section =~ s/^\s+|\s+$//g; |
|
if ($section ne '') { |
|
$confhash{$itemid}{'section'} = $section; |
|
} |
|
} |
|
} |
|
if ($env{'form.lti_callback_'.$idx}) { |
if ($env{'form.lti_callback_'.$idx}) { |
if ($env{'form.lti_callbackparam_'.$idx}) { |
if ($env{'form.lti_callbackparam_'.$idx}) { |
my $callback = $env{'form.lti_callbackparam_'.$idx}; |
my $callback = $env{'form.lti_callbackparam_'.$idx}; |
Line 14891 sub modify_lti {
|
Line 14904 sub modify_lti {
|
$confhash{$itemid}{'callback'} = $callback; |
$confhash{$itemid}{'callback'} = $callback; |
} |
} |
} |
} |
foreach my $field ('passback','roster','topmenu','inlinemenu') { |
foreach my $field ('topmenu','inlinemenu') { |
if ($env{'form.lti_'.$field.'_'.$idx}) { |
if ($env{'form.lti_'.$field.'_'.$idx}) { |
$confhash{$itemid}{$field} = 1; |
$confhash{$itemid}{$field} = 1; |
} |
} |
} |
} |
if ($env{'form.lti_passback_'.$idx}) { |
|
if ($env{'form.lti_passbackformat_'.$idx} eq '1.0') { |
|
$confhash{$itemid}{'passbackformat'} = '1.0'; |
|
} else { |
|
$confhash{$itemid}{'passbackformat'} = '1.1'; |
|
} |
|
} |
|
if ($env{'form.lti_topmenu_'.$idx} || $env{'form.lti_inlinemenu_'.$idx}) { |
if ($env{'form.lti_topmenu_'.$idx} || $env{'form.lti_inlinemenu_'.$idx}) { |
$confhash{$itemid}{lcmenu} = []; |
$confhash{$itemid}{lcmenu} = []; |
my @possmenu = &Apache::loncommon::get_env_multiple('form.lti_menuitem_'.$idx); |
my @possmenu = &Apache::loncommon::get_env_multiple('form.lti_menuitem_'.$idx); |
Line 14915 sub modify_lti {
|
Line 14921 sub modify_lti {
|
} |
} |
} |
} |
} |
} |
unless (($idx eq 'add') || ($changes{$itemid})) { |
if ($confhash{$itemid}{'crsinc'}) { |
foreach my $field ('mapuser','mapcrs','makecrs','section','passback','roster','lcauth','lcauthparm','topmenu','inlinemenu','callback') { |
if (($env{'form.lti_mapcrs_'.$idx} eq 'course_offering_sourcedid') || |
if ($domconfig{$action}{$itemid}{$field} ne $confhash{$itemid}{$field}) { |
($env{'form.lti_mapcrs_'.$idx} eq 'context_id')) { |
$changes{$itemid} = 1; |
$confhash{$itemid}{'mapcrs'} = $env{'form.lti_mapcrs_'.$idx}; |
|
} elsif ($env{'form.lti_mapcrs_'.$idx} eq 'other') { |
|
my $mapcrs = $env{'form.lti_mapcrsfield_'.$idx}; |
|
$mapcrs =~ s/(`)/'/g; |
|
$mapcrs =~ s/^\s+|\s+$//g; |
|
$confhash{$itemid}{'mapcrs'} = $mapcrs; |
|
} |
|
my @posstypes = &Apache::loncommon::get_env_multiple('form.lti_mapcrstype_'.$idx); |
|
my @crstypes; |
|
foreach my $type (sort(@posstypes)) { |
|
if ($posscrstype{$type}) { |
|
push(@crstypes,$type); |
|
} |
|
} |
|
$confhash{$itemid}{'mapcrstype'} = \@crstypes; |
|
if ($env{'form.lti_makecrs_'.$idx}) { |
|
$confhash{$itemid}{'makecrs'} = 1; |
|
} |
|
foreach my $ltirole (@lticourseroles) { |
|
my $possrole = $env{'form.lti_maprole_'.$ltirole.'_'.$idx}; |
|
if (grep(/^\Q$possrole\E$/,@courseroles)) { |
|
$confhash{$itemid}{'maproles'}{$ltirole} = $possrole; |
|
} |
|
} |
|
my @possenroll = &Apache::loncommon::get_env_multiple('form.lti_selfenroll_'.$idx); |
|
my @selfenroll; |
|
foreach my $type (sort(@possenroll)) { |
|
if ($posslticrs{$type}) { |
|
push(@selfenroll,$type); |
|
} |
|
} |
|
$confhash{$itemid}{'selfenroll'} = \@selfenroll; |
|
if ($env{'form.lti_crssec_'.$idx}) { |
|
if ($env{'form.lti_crssecsrc_'.$idx} eq 'course_section_sourcedid') { |
|
$confhash{$itemid}{'section'} = $env{'form.lti_crssecsrc_'.$idx}; |
|
} elsif ($env{'form.lti_crssecsrc_'.$idx} eq 'other') { |
|
my $section = $env{'form.lti_customsection_'.$idx}; |
|
$section =~ s/(`)/'/g; |
|
$section =~ s/^\s+|\s+$//g; |
|
if ($section ne '') { |
|
$confhash{$itemid}{'section'} = $section; |
|
} |
} |
} |
} |
} |
unless ($changes{$itemid}) { |
foreach my $field ('passback','roster') { |
if ($domconfig{$action}{$itemid}{'passback'} eq $confhash{$itemid}{'passback'}) { |
if ($env{'form.lti_'.$field.'_'.$idx}) { |
if ($domconfig{$action}{$itemid}{'passbackformat'} ne $confhash{$itemid}{'passbackformat'}) { |
$confhash{$itemid}{$field} = 1; |
|
} |
|
} |
|
if ($env{'form.lti_passback_'.$idx}) { |
|
if ($env{'form.lti_passbackformat_'.$idx} eq '1.0') { |
|
$confhash{$itemid}{'passbackformat'} = '1.0'; |
|
} else { |
|
$confhash{$itemid}{'passbackformat'} = '1.1'; |
|
} |
|
} |
|
} |
|
unless (($idx eq 'add') || ($changes{$itemid})) { |
|
if ($confhash{$itemid}{'crsinc'}) { |
|
foreach my $field ('mapcrs','makecrs','section','passback','roster') { |
|
if ($domconfig{$action}{$itemid}{$field} ne $confhash{$itemid}{$field}) { |
$changes{$itemid} = 1; |
$changes{$itemid} = 1; |
} |
} |
} |
} |
} |
|
foreach my $field ('makeuser','mapcrstype','selfenroll','instdata','lcmenu') { |
|
unless ($changes{$itemid}) { |
unless ($changes{$itemid}) { |
if (ref($domconfig{$action}{$itemid}{$field}) eq 'ARRAY') { |
if ($domconfig{$action}{$itemid}{'passback'} eq $confhash{$itemid}{'passback'}) { |
if (ref($confhash{$itemid}{$field}) eq 'ARRAY') { |
if ($domconfig{$action}{$itemid}{'passbackformat'} ne $confhash{$itemid}{'passbackformat'}) { |
my @diffs = &Apache::loncommon::compare_arrays($domconfig{$action}{$itemid}{$field}, |
|
$confhash{$itemid}{$field}); |
|
if (@diffs) { |
|
$changes{$itemid} = 1; |
|
} |
|
} elsif (@{$domconfig{$action}{$itemid}{$field}} > 0) { |
|
$changes{$itemid} = 1; |
|
} |
|
} elsif (ref($confhash{$itemid}{$field}) eq 'ARRAY') { |
|
if (@{$confhash{$itemid}{$field}} > 0) { |
|
$changes{$itemid} = 1; |
$changes{$itemid} = 1; |
} |
} |
} |
} |
} |
} |
} |
foreach my $field ('mapcrstype','selfenroll') { |
unless ($changes{$itemid}) { |
unless ($changes{$itemid}) { |
if (ref($domconfig{$action}{$itemid}{'maproles'}) eq 'HASH') { |
if (ref($domconfig{$action}{$itemid}{$field}) eq 'ARRAY') { |
if (ref($confhash{$itemid}{'maproles'}) eq 'HASH') { |
if (ref($confhash{$itemid}{$field}) eq 'ARRAY') { |
foreach my $ltirole (keys(%{$domconfig{$action}{$itemid}{'maproles'}})) { |
my @diffs = &Apache::loncommon::compare_arrays($domconfig{$action}{$itemid}{$field}, |
if ($domconfig{$action}{$itemid}{'maproles'}{$ltirole} ne |
$confhash{$itemid}{$field}); |
$confhash{$itemid}{'maproles'}{$ltirole}) { |
if (@diffs) { |
|
$changes{$itemid} = 1; |
|
} |
|
} elsif (@{$domconfig{$action}{$itemid}{$field}} > 0) { |
|
$changes{$itemid} = 1; |
|
} |
|
} elsif (ref($confhash{$itemid}{$field}) eq 'ARRAY') { |
|
if (@{$confhash{$itemid}{$field}} > 0) { |
$changes{$itemid} = 1; |
$changes{$itemid} = 1; |
last; |
|
} |
} |
} |
} |
unless ($changes{$itemid}) { |
} |
foreach my $ltirole (keys(%{$confhash{$itemid}{'maproles'}})) { |
} |
if ($confhash{$itemid}{'maproles'}{$ltirole} ne |
unless ($changes{$itemid}) { |
$domconfig{$action}{$itemid}{'maproles'}{$ltirole}) { |
if (ref($domconfig{$action}{$itemid}{'maproles'}) eq 'HASH') { |
|
if (ref($confhash{$itemid}{'maproles'}) eq 'HASH') { |
|
foreach my $ltirole (keys(%{$domconfig{$action}{$itemid}{'maproles'}})) { |
|
if ($domconfig{$action}{$itemid}{'maproles'}{$ltirole} ne |
|
$confhash{$itemid}{'maproles'}{$ltirole}) { |
$changes{$itemid} = 1; |
$changes{$itemid} = 1; |
last; |
last; |
} |
} |
} |
} |
|
unless ($changes{$itemid}) { |
|
foreach my $ltirole (keys(%{$confhash{$itemid}{'maproles'}})) { |
|
if ($confhash{$itemid}{'maproles'}{$ltirole} ne |
|
$domconfig{$action}{$itemid}{'maproles'}{$ltirole}) { |
|
$changes{$itemid} = 1; |
|
last; |
|
} |
|
} |
|
} |
|
} elsif (keys(%{$domconfig{$action}{$itemid}{'maproles'}}) > 0) { |
|
$changes{$itemid} = 1; |
|
} |
|
} elsif (ref($confhash{$itemid}{'maproles'}) eq 'HASH') { |
|
unless ($changes{$itemid}) { |
|
if (keys(%{$confhash{$itemid}{'maproles'}}) > 0) { |
|
$changes{$itemid} = 1; |
|
} |
} |
} |
} elsif (keys(%{$domconfig{$action}{$itemid}{'maproles'}}) > 0) { |
} |
|
} |
|
} |
|
unless ($changes{$itemid}) { |
|
foreach my $field ('mapuser','lcauth','lcauthparm','topmenu','inlinemenu','callback') { |
|
if ($domconfig{$action}{$itemid}{$field} ne $confhash{$itemid}{$field}) { |
$changes{$itemid} = 1; |
$changes{$itemid} = 1; |
} |
} |
} elsif (ref($confhash{$itemid}{'maproles'}) eq 'HASH') { |
} |
unless ($changes{$itemid}) { |
unless ($changes{$itemid}) { |
if (keys(%{$confhash{$itemid}{'maproles'}}) > 0) { |
foreach my $field ('makeuser','lcmenu') { |
$changes{$itemid} = 1; |
if (ref($domconfig{$action}{$itemid}{$field}) eq 'ARRAY') { |
|
if (ref($confhash{$itemid}{$field}) eq 'ARRAY') { |
|
my @diffs = &Apache::loncommon::compare_arrays($domconfig{$action}{$itemid}{$field}, |
|
$confhash{$itemid}{$field}); |
|
if (@diffs) { |
|
$changes{$itemid} = 1; |
|
} |
|
} elsif (@{$domconfig{$action}{$itemid}{$field}} > 0) { |
|
$changes{$itemid} = 1; |
|
} |
|
} elsif (ref($confhash{$itemid}{$field}) eq 'ARRAY') { |
|
if (@{$confhash{$itemid}{$field}} > 0) { |
|
$changes{$itemid} = 1; |
|
} |
} |
} |
} |
} |
} |
} |
Line 15048 sub modify_lti {
|
Line 15142 sub modify_lti {
|
$resulttext .= ('*'x$num).'</li>'; |
$resulttext .= ('*'x$num).'</li>'; |
} |
} |
if ($confhash{$itemid}{'requser'}) { |
if ($confhash{$itemid}{'requser'}) { |
|
if ($confhash{$itemid}{'callback'}) { |
|
$resulttext .= '<li>'.&mt('Callback setting').': '.$confhash{$itemid}{'callback'}.'</li>'; |
|
} else { |
|
$resulttext .= '<li>'.&mt('No callback to logout LON-CAPA session when user logs out of Comsumer').'</li>'; |
|
} |
if ($confhash{$itemid}{'mapuser'}) { |
if ($confhash{$itemid}{'mapuser'}) { |
my $shownmapuser; |
my $shownmapuser; |
if ($confhash{$itemid}{'mapuser'} eq 'lis_person_sourcedid') { |
if ($confhash{$itemid}{'mapuser'} eq 'lis_person_sourcedid') { |
Line 15059 sub modify_lti {
|
Line 15158 sub modify_lti {
|
} |
} |
$resulttext .= '<li>'.&mt('LON-CAPA username').': '.$shownmapuser.'</li>'; |
$resulttext .= '<li>'.&mt('LON-CAPA username').': '.$shownmapuser.'</li>'; |
} |
} |
if (ref($confhash{$itemid}{'maproles'}) eq 'HASH') { |
|
my $rolemaps; |
|
foreach my $role (@ltiroles) { |
|
if ($confhash{$itemid}{'maproles'}{$role}) { |
|
$rolemaps .= (' 'x2).$role.'='. |
|
&Apache::lonnet::plaintext($confhash{$itemid}{'maproles'}{$role}, |
|
'Course').','; |
|
} |
|
} |
|
if ($rolemaps) { |
|
$rolemaps =~ s/,$//; |
|
$resulttext .= '<li>'.&mt('Role mapping:').$rolemaps.'</li>'; |
|
} |
|
} |
|
if (ref($confhash{$itemid}{'makeuser'}) eq 'ARRAY') { |
if (ref($confhash{$itemid}{'makeuser'}) eq 'ARRAY') { |
if (@{$confhash{$itemid}{'makeuser'}} > 0) { |
if (@{$confhash{$itemid}{'makeuser'}} > 0) { |
$resulttext .= '<li>'.&mt('Following roles may create user accounts: [_1]', |
$resulttext .= '<li>'.&mt('Following roles may create user accounts: [_1]', |
Line 15105 sub modify_lti {
|
Line 15190 sub modify_lti {
|
$resulttext .= '<li>'.&mt('No institutional data used when creating a new user.').'</li>'; |
$resulttext .= '<li>'.&mt('No institutional data used when creating a new user.').'</li>'; |
} |
} |
} |
} |
if ($confhash{$itemid}{'mapcrs'}) { |
foreach my $item ('topmenu','inlinemenu') { |
$resulttext .= '<li>'.&mt('Unique course identifier').': '.$confhash{$itemid}{'mapcrs'}.'</li>'; |
|
} |
|
if (ref($confhash{$itemid}{'mapcrstype'}) eq 'ARRAY') { |
|
if (@{$confhash{$itemid}{'mapcrstype'}} > 0) { |
|
$resulttext .= '<li>'.&mt('Mapping for the following LON-CAPA course types: [_1]', |
|
join(', ',map { $coursetypetitles{$_}; } @coursetypes)). |
|
'</li>'; |
|
} else { |
|
$resulttext .= '<li>'.&mt('No mapping to LON-CAPA courses').'</li>'; |
|
} |
|
} |
|
if ($confhash{$itemid}{'makecrs'}) { |
|
$resulttext .= '<li>'.&mt('Instructor may create course (if absent).').'</li>'; |
|
} else { |
|
$resulttext .= '<li>'.&mt('Instructor may not create course (if absent).').'</li>'; |
|
} |
|
if (ref($confhash{$itemid}{'selfenroll'}) eq 'ARRAY') { |
|
if (@{$confhash{$itemid}{'selfenroll'}} > 0) { |
|
$resulttext .= '<li>'.&mt('Self-enrollment for following roles: [_1]', |
|
join(', ',@{$confhash{$itemid}{'selfenroll'}})). |
|
'</li>'; |
|
} else { |
|
$resulttext .= '<li>'.&mt('Self-enrollment not permitted').'</li>'; |
|
} |
|
} |
|
if ($confhash{$itemid}{'section'}) { |
|
if ($confhash{$itemid}{'section'} eq 'course_section_sourcedid') { |
|
$resulttext .= '<li>'.&mt('User section from standard field:'). |
|
' (course_section_sourcedid)'.'</li>'; |
|
} else { |
|
$resulttext .= '<li>'.&mt('User section from:').' '. |
|
$confhash{$itemid}{'section'}.'</li>'; |
|
} |
|
} else { |
|
$resulttext .= '<li>'.&mt('No section assignment').'</li>'; |
|
} |
|
if ($confhash{$itemid}{'callback'}) { |
|
$resulttext .= '<li>'.&mt('Callback setting').': '.$confhash{$itemid}{'callback'}.'</li>'; |
|
} else { |
|
$resulttext .= '<li>'.&mt('No callback to logout LON-CAPA session when user logs out of Comsumer'); |
|
} |
|
foreach my $item ('passback','roster','topmenu','inlinemenu') { |
|
$resulttext .= '<li>'.$lt{$item}.': '; |
$resulttext .= '<li>'.$lt{$item}.': '; |
if ($confhash{$itemid}{$item}) { |
if ($confhash{$itemid}{$item}) { |
$resulttext .= &mt('Yes'); |
$resulttext .= &mt('Yes'); |
if ($item eq 'passback') { |
|
if ($confhash{$itemid}{'passbackformat'} eq '1.0') { |
|
$resulttext .= ' ('.&mt('Outcomes Extension (1.0)').')'; |
|
} elsif ($confhash{$itemid}{'passbackformat'} eq '1.1') { |
|
$resulttext .= ' ('.&mt('Outcomes Service (1.1)').')'; |
|
} |
|
} |
|
} else { |
} else { |
$resulttext .= &mt('No'); |
$resulttext .= &mt('No'); |
} |
} |
Line 15166 sub modify_lti {
|
Line 15202 sub modify_lti {
|
if (ref($confhash{$itemid}{'lcmenu'}) eq 'ARRAY') { |
if (ref($confhash{$itemid}{'lcmenu'}) eq 'ARRAY') { |
if (@{$confhash{$itemid}{'lcmenu'}} > 0) { |
if (@{$confhash{$itemid}{'lcmenu'}} > 0) { |
$resulttext .= '<li>'.&mt('Menu items:').' '. |
$resulttext .= '<li>'.&mt('Menu items:').' '. |
join(', ', map { $menutitles{$_}; } (@{$confhash{$itemid}{'lcmenu'}})).'</li>'; |
join(', ', map { $menutitles{$_}; } (@{$confhash{$itemid}{'lcmenu'}})).'</li>'; |
|
} else { |
|
$resulttext .= '<li>'.&mt('No menu items displayed in header or online menu').'</li>'; |
|
} |
|
} |
|
if ($confhash{$itemid}{'crsinc'}) { |
|
if (ref($confhash{$itemid}{'maproles'}) eq 'HASH') { |
|
my $rolemaps; |
|
foreach my $role (@ltiroles) { |
|
if ($confhash{$itemid}{'maproles'}{$role}) { |
|
$rolemaps .= (' 'x2).$role.'='. |
|
&Apache::lonnet::plaintext($confhash{$itemid}{'maproles'}{$role}, |
|
'Course').','; |
|
} |
|
} |
|
if ($rolemaps) { |
|
$rolemaps =~ s/,$//; |
|
$resulttext .= '<li>'.&mt('Role mapping:').$rolemaps.'</li>'; |
|
} |
|
} |
|
if ($confhash{$itemid}{'mapcrs'}) { |
|
$resulttext .= '<li>'.&mt('Unique course identifier').': '.$confhash{$itemid}{'mapcrs'}.'</li>'; |
|
} |
|
if (ref($confhash{$itemid}{'mapcrstype'}) eq 'ARRAY') { |
|
if (@{$confhash{$itemid}{'mapcrstype'}} > 0) { |
|
$resulttext .= '<li>'.&mt('Mapping for the following LON-CAPA course types: [_1]', |
|
join(', ',map { $coursetypetitles{$_}; } @coursetypes)). |
|
'</li>'; |
|
} else { |
|
$resulttext .= '<li>'.&mt('No mapping to LON-CAPA courses').'</li>'; |
|
} |
|
} |
|
if ($confhash{$itemid}{'makecrs'}) { |
|
$resulttext .= '<li>'.&mt('Instructor may create course (if absent).').'</li>'; |
|
} else { |
|
$resulttext .= '<li>'.&mt('Instructor may not create course (if absent).').'</li>'; |
|
} |
|
if (ref($confhash{$itemid}{'selfenroll'}) eq 'ARRAY') { |
|
if (@{$confhash{$itemid}{'selfenroll'}} > 0) { |
|
$resulttext .= '<li>'.&mt('Self-enrollment for following roles: [_1]', |
|
join(', ',@{$confhash{$itemid}{'selfenroll'}})). |
|
'</li>'; |
|
} else { |
|
$resulttext .= '<li>'.&mt('Self-enrollment not permitted').'</li>'; |
|
} |
|
} |
|
if ($confhash{$itemid}{'section'}) { |
|
if ($confhash{$itemid}{'section'} eq 'course_section_sourcedid') { |
|
$resulttext .= '<li>'.&mt('User section from standard field:'). |
|
' (course_section_sourcedid)'.'</li>'; |
|
} else { |
|
$resulttext .= '<li>'.&mt('User section from:').' '. |
|
$confhash{$itemid}{'section'}.'</li>'; |
|
} |
} else { |
} else { |
$resulttext .= '<li>'.&mt('No menu items displayed in header or online menu').'</li>'; |
$resulttext .= '<li>'.&mt('No section assignment').'</li>'; |
|
} |
|
foreach my $item ('passback','roster','topmenu','inlinemenu') { |
|
$resulttext .= '<li>'.$lt{$item}.': '; |
|
if ($confhash{$itemid}{$item}) { |
|
$resulttext .= &mt('Yes'); |
|
if ($item eq 'passback') { |
|
if ($confhash{$itemid}{'passbackformat'} eq '1.0') { |
|
$resulttext .= ' ('.&mt('Outcomes Extension (1.0)').')'; |
|
} elsif ($confhash{$itemid}{'passbackformat'} eq '1.1') { |
|
$resulttext .= ' ('.&mt('Outcomes Service (1.1)').')'; |
|
} |
|
} |
|
} else { |
|
$resulttext .= &mt('No'); |
|
} |
|
$resulttext .= '</li>'; |
|
} |
|
if (ref($confhash{$itemid}{'lcmenu'}) eq 'ARRAY') { |
|
if (@{$confhash{$itemid}{'lcmenu'}} > 0) { |
|
$resulttext .= '<li>'.&mt('Menu items:').' '. |
|
join(', ', map { $menutitles{$_}; } (@{$confhash{$itemid}{'lcmenu'}})).'</li>'; |
|
} else { |
|
$resulttext .= '<li>'.&mt('No menu items displayed in header or online menu').'</li>'; |
|
} |
} |
} |
} |
} |
} |
} |