version 1.341, 2018/11/18 22:50:52
|
version 1.346, 2019/01/27 14:39:48
|
Line 394 sub handler {
|
Line 394 sub handler {
|
modify => \&modify_usermodification, |
modify => \&modify_usermodification, |
}, |
}, |
'scantron' => |
'scantron' => |
{ text => 'Bubblesheet format file', |
{ text => 'Bubblesheet format', |
help => 'Domain_Configuration_Scantron_Format', |
help => 'Domain_Configuration_Scantron_Format', |
header => [ {col1 => 'Item', |
header => [ {col1 => 'Bubblesheet format file', |
col2 => '', |
col2 => ''}, |
}], |
{col1 => 'Bubblesheet data upload formats', |
|
col2 => 'Settings'}], |
print => \&print_scantron, |
print => \&print_scantron, |
modify => \&modify_scantron, |
modify => \&modify_scantron, |
}, |
}, |
Line 627 END
|
Line 628 END
|
if (grep(/^contacts$/,@actions)) { |
if (grep(/^contacts$/,@actions)) { |
$js .= &contacts_javascript(); |
$js .= &contacts_javascript(); |
} |
} |
|
if (grep(/^scantron$/,@actions)) { |
|
$js .= &scantron_javascript(); |
|
} |
&Apache::lonconfigsettings::display_settings($r,$dom,$phase,$context,\@prefs_order,\%prefs,\%domconfig,$confname,$js); |
&Apache::lonconfigsettings::display_settings($r,$dom,$phase,$context,\@prefs_order,\%prefs,\%domconfig,$confname,$js); |
} else { |
} else { |
# check if domconfig user exists for the domain. |
# check if domconfig user exists for the domain. |
Line 828 sub print_config_box {
|
Line 832 sub print_config_box {
|
$output .= $item->{'print'}->('top',$dom,$settings,\$rowtotal); |
$output .= $item->{'print'}->('top',$dom,$settings,\$rowtotal); |
} elsif ($action eq 'coursecategories') { |
} elsif ($action eq 'coursecategories') { |
$output .= $item->{'print'}->('top',$dom,$item,$settings,\$rowtotal); |
$output .= $item->{'print'}->('top',$dom,$item,$settings,\$rowtotal); |
|
} elsif ($action eq 'scantron') { |
|
$output .= $item->{'print'}->($r,'top',$dom,$confname,$settings,\$rowtotal); |
} elsif ($action eq 'login') { |
} elsif ($action eq 'login') { |
if ($numheaders == 4) { |
if ($numheaders == 4) { |
$colspan = ' colspan="2"'; |
$colspan = ' colspan="2"'; |
Line 932 sub print_config_box {
|
Line 938 sub print_config_box {
|
($action eq 'defaults') || ($action eq 'directorysrch') || |
($action eq 'defaults') || ($action eq 'directorysrch') || |
($action eq 'helpsettings')) { |
($action eq 'helpsettings')) { |
$output .= $item->{'print'}->('bottom',$dom,$settings,\$rowtotal); |
$output .= $item->{'print'}->('bottom',$dom,$settings,\$rowtotal); |
|
} elsif ($action eq 'scantron') { |
|
$output .= $item->{'print'}->($r,'bottom',$dom,$confname,$settings,\$rowtotal); |
} elsif ($action eq 'ssl') { |
} elsif ($action eq 'ssl') { |
$output .= $item->{'print'}->('connto',$dom,$settings,\$rowtotal).' |
$output .= $item->{'print'}->('connto',$dom,$settings,\$rowtotal).' |
</table> |
</table> |
Line 1113 sub print_config_box {
|
Line 1121 sub print_config_box {
|
($action eq 'serverstatuses') || ($action eq 'loadbalancing') || |
($action eq 'serverstatuses') || ($action eq 'loadbalancing') || |
($action eq 'ltitools') || ($action eq 'lti')) { |
($action eq 'ltitools') || ($action eq 'lti')) { |
$output .= $item->{'print'}->($dom,$settings,\$rowtotal); |
$output .= $item->{'print'}->($dom,$settings,\$rowtotal); |
} elsif ($action eq 'scantron') { |
|
$output .= &print_scantronformat($r,$dom,$confname,$settings,\$rowtotal); |
|
} |
} |
} |
} |
$output .= ' |
$output .= ' |
Line 2836 sub lti_toggle_js {
|
Line 2842 sub lti_toggle_js {
|
// <![CDATA[ |
// <![CDATA[ |
|
|
function toggleLTI(form,setting,item) { |
function toggleLTI(form,setting,item) { |
if ((setting == 'user') || (setting == 'crs') || (setting == 'passback')) { |
if (setting == 'requser') { |
|
var fieldsets = document.getElementsByClassName('ltioption_'+item); |
|
if (fieldsets.length) { |
|
var radioname = 'lti_'+setting+'_'+item; |
|
var num = form.elements[radioname].length; |
|
if (num) { |
|
var setvis = ''; |
|
for (var i=0; i<num; i++) { |
|
if (form.elements[radioname][i].checked) { |
|
if (form.elements[radioname][i].value == '1') { |
|
setvis = 1; |
|
break; |
|
} |
|
} |
|
} |
|
for (var j=0; j<fieldsets.length; j++) { |
|
if (setvis) { |
|
fieldsets[j].style.display = 'block'; |
|
} else { |
|
fieldsets[j].style.display = 'none'; |
|
} |
|
} |
|
} |
|
} |
|
} else if ((setting == 'user') || (setting == 'crs') || (setting == 'passback')) { |
var radioname = ''; |
var radioname = ''; |
var divid = ''; |
var divid = ''; |
if (setting == 'user') { |
if (setting == 'user') { |
radioname = 'lti_mapuser_'+item; |
radioname = 'lti_mapuser_'+item; |
divid = 'lti_userfield_'+item; |
divid = 'lti_userfield_'+item; |
} else if (settings == 'crs') { |
} else if (setting == 'crs') { |
radioname = 'lti_mapcrs_'+item; |
radioname = 'lti_mapcrs_'+item; |
divid = 'lti_crsfield_'+item; |
divid = 'lti_crsfield_'+item; |
} else { |
} else { |
Line 4767 sub print_lti {
|
Line 4797 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,$current); |
my ($key,$secret,$lifetime,$consumer,$requser,$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'}; |
$current = $settings->{$item}; |
$current = $settings->{$item}; |
} |
} |
|
my $onclickrequser = ' onclick="toggleLTI(this.form,'."'requser','$i'".');"'; |
|
my %checkedrequser = ( |
|
yes => ' checked="checked"', |
|
no => '', |
|
); |
|
if (!$requser) { |
|
$checkedrequser{'no'} = $checkedrequser{'yes'}; |
|
$checkedrequser{'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 4792 sub print_lti {
|
Line 4832 sub print_lti {
|
'<td colspan="2">'. |
'<td colspan="2">'. |
'<fieldset><legend>'.&mt('Required settings').'</legend>'. |
'<fieldset><legend>'.&mt('Required settings').'</legend>'. |
'<span class="LC_nobreak">'.$lt{'consumer'}. |
'<span class="LC_nobreak">'.$lt{'consumer'}. |
':<input type="text" size="20" name="lti_consumer_'.$i.'" value="'.$consumer.'" /></span> '. |
':<input type="text" size="15" name="lti_consumer_'.$i.'" value="'.$consumer.'" /></span> '. |
(' 'x2). |
(' 'x2). |
'<span class="LC_nobreak">'.$lt{'version'}.':<select name="lti_version_'.$i.'">'. |
'<span class="LC_nobreak">'.$lt{'version'}.':<select name="lti_version_'.$i.'">'. |
'<option value="LTI-1p0" selected="selected">1.1</option></select></span> '. |
'<option value="LTI-1p0" selected="selected">1.1</option></select></span> '. |
(' 'x2). |
(' 'x2). |
'<span class="LC_nobreak">'.$lt{'lifetime'}.':<input type="text" name="lti_lifetime_'.$i.'"'. |
'<span class="LC_nobreak">'.$lt{'lifetime'}.':<input type="text" name="lti_lifetime_'.$i.'"'. |
'value="'.$lifetime.'" size="5" /></span>'. |
'value="'.$lifetime.'" size="3" /></span>'. |
|
(' 'x2). |
|
'<span class="LC_nobreak">'.$lt{'requser'}.':'. |
|
'<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". |
'<br /><br />'. |
'<br /><br />'. |
'<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> '. |
Line 4829 sub print_lti {
|
Line 4873 sub print_lti {
|
'<td colspan="2">'. |
'<td colspan="2">'. |
'<fieldset><legend>'.&mt('Required settings').'</legend>'. |
'<fieldset><legend>'.&mt('Required settings').'</legend>'. |
'<span class="LC_nobreak">'.$lt{'consumer'}. |
'<span class="LC_nobreak">'.$lt{'consumer'}. |
':<input type="text" size="20" name="lti_consumer_add" value="" /></span> '."\n". |
':<input type="text" size="15" name="lti_consumer_add" value="" /></span> '."\n". |
(' 'x2). |
(' 'x2). |
'<span class="LC_nobreak">'.$lt{'version'}.':<select name="lti_version_add">'. |
'<span class="LC_nobreak">'.$lt{'version'}.':<select name="lti_version_add">'. |
'<option value="LTI-1p0" selected="selected">1.1</option></select></span> '."\n". |
'<option value="LTI-1p0" selected="selected">1.1</option></select></span> '."\n". |
(' 'x2). |
(' 'x2). |
'<span class="LC_nobreak">'.$lt{'lifetime'}.':<input type="text" size="5" name="lti_lifetime_add" value="300" /></span> '."\n". |
'<span class="LC_nobreak">'.$lt{'lifetime'}.':<input type="text" size="3" name="lti_lifetime_add" value="300" /></span> '."\n". |
|
(' 'x2). |
|
'<span class="LC_nobreak">'.$lt{'requser'}.':'. |
|
'<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". |
'<br /><br />'. |
'<br /><br />'. |
'<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). |
Line 4853 sub lti_names {
|
Line 4901 sub lti_names {
|
'url' => 'URL', |
'url' => 'URL', |
'key' => 'Key', |
'key' => 'Key', |
'lifetime' => 'Nonce lifetime (s)', |
'lifetime' => 'Nonce lifetime (s)', |
'consumer' => 'LTI Consumer', |
'consumer' => 'Consumer', |
'secret' => 'Secret', |
'secret' => 'Secret', |
|
'requser' => "User's identity sent", |
'email' => 'Email address', |
'email' => 'Email address', |
'sourcedid' => 'User ID', |
'sourcedid' => 'User ID', |
'other' => 'Other', |
'other' => 'Other', |
'passback' => 'Can return grades to Consumer:', |
'passback' => 'Can return grades to Consumer:', |
'roster' => 'Can retrieve roster from Consumer:', |
'roster' => 'Can retrieve roster from Consumer:', |
'topmenu' => 'Display LON-CAPA page header', |
'topmenu' => 'Display LON-CAPA page header', |
'inlinemenu'=> 'Display LON-CAPA inline menu', |
'inlinemenu'=> 'Display LON-CAPA inline menu', |
); |
); |
return %lt; |
return %lt; |
} |
} |
Line 4887 sub lti_options {
|
Line 4936 sub lti_options {
|
my $crssecfieldsty = 'none'; |
my $crssecfieldsty = 'none'; |
my $secsrcfieldsty = 'none'; |
my $secsrcfieldsty = 'none'; |
my $passbacksty = 'none'; |
my $passbacksty = 'none'; |
|
my $optionsty = 'block'; |
my $lcauthparm; |
my $lcauthparm; |
my $lcauthparmstyle = 'display:none'; |
my $lcauthparmstyle = 'display:none'; |
my $lcauthparmtext; |
my $lcauthparmtext; |
Line 4895 sub lti_options {
|
Line 4945 sub lti_options {
|
my %menutitles = <imenu_titles(); |
my %menutitles = <imenu_titles(); |
|
|
if (ref($current) eq 'HASH') { |
if (ref($current) eq 'HASH') { |
|
if (!$current->{'requser'}) { |
|
$optionsty = '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'} = ''; |
if ($current->{'mapuser'} eq 'lis_person_contact_email_primary') { |
if ($current->{'mapuser'} eq 'lis_person_contact_email_primary') { |
Line 4920 sub lti_options {
|
Line 4973 sub lti_options {
|
$checked{'mapcrstype'}{$type} = ' checked="checked"'; |
$checked{'mapcrstype'}{$type} = ' checked="checked"'; |
} |
} |
} |
} |
if ($current->{'makecrs'}) { |
if ($current->{'makecrs'}) { |
$checked{'makecrs'}{'Y'} = ' checked="checked"'; |
$checked{'makecrs'}{'Y'} = ' checked="checked"'; |
} |
} |
if (ref($current->{'makeuser'}) eq 'ARRAY') { |
if (ref($current->{'makeuser'}) eq 'ARRAY') { |
Line 5017 sub lti_options {
|
Line 5070 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><legend>'.&mt('Mapping users').'</legend>'. |
my $output = '<fieldset class="ltioption_'.$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 5028 sub lti_options {
|
Line 5081 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><legend>'.&mt('Mapping course roles').'</legend><table><tr>'; |
'<fieldset class="ltioption_'.$num.'" style="display:'.$optionsty.'"><legend>'.&mt('Mapping course roles').'</legend><table><tr>'; |
foreach my $ltirole (@lticourseroles) { |
foreach my $ltirole (@lticourseroles) { |
my ($selected,$selectnone); |
my ($selected,$selectnone); |
if ($rolemaps{$ltirole} eq '') { |
if ($rolemaps{$ltirole} eq '') { |
Line 5052 sub lti_options {
|
Line 5105 sub lti_options {
|
$output .= '</select></td>'; |
$output .= '</select></td>'; |
} |
} |
$output .= '</tr></table></fieldset>'. |
$output .= '</tr></table></fieldset>'. |
'<fieldset><legend>'.&mt('Roles which may create user accounts').'</legend>'; |
'<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><legend>'.&mt('New user accounts created for LTI users').'</legend>'. |
'<fieldset class="ltioption_'.$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 5081 sub lti_options {
|
Line 5134 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><legend>'.&mt('Mapping courses').'</legend>'. |
'<fieldset class="ltioption_'.$num.'" style="display:'.$optionsty.'"><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 5099 sub lti_options {
|
Line 5152 sub lti_options {
|
(' 'x2); |
(' 'x2); |
} |
} |
$output .= '</span></fieldset>'. |
$output .= '</span></fieldset>'. |
'<fieldset><legend>'.&mt('Creating courses').'</legend>'. |
'<fieldset class="ltioption_'.$num.'" style="display:'.$optionsty.'"><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><legend>'.&mt('Roles which may self-enroll').'</legend>'; |
'<fieldset class="ltioption_'.$num.'" style="display:'.$optionsty.'"><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><legend>'.&mt('Course options').'</legend>'. |
'<fieldset class="ltioption_'.$num.'" style="display:'.$optionsty.'"><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 5164 sub lti_options {
|
Line 5217 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></fieldset>'. |
&mt('Outcomes Extension (1.0)').'</label></span></div></fieldset>'. |
'<fieldset><legend>'.&mt('Course defaults (Course Coordinator can override)').'</legend>'. |
'<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'}.': '. |
'<div class="LC_floatleft"><span class="LC_nobreak">'.$lt{'topmenu'}.': '. |
'<label><input type="radio" name="lti_topmenu_'.$num.'" value="0"'. |
'<label><input type="radio" name="lti_topmenu_'.$num.'" value="0"'. |
$checked{'topmenu'}{'N'}.$onclickmenu.' />'.&mt('No').'</label>'.(' 'x2). |
$checked{'topmenu'}{'N'}.$onclickmenu.' />'.&mt('No').'</label>'.(' 'x2). |
Line 6339 sub print_loadbalancing {
|
Line 6392 sub print_loadbalancing {
|
my $numinrow = 1; |
my $numinrow = 1; |
my $datatable; |
my $datatable; |
my %servers = &Apache::lonnet::internet_dom_servers($dom); |
my %servers = &Apache::lonnet::internet_dom_servers($dom); |
my (%currbalancer,%currtargets,%currrules,%existing); |
my (%currbalancer,%currtargets,%currrules,%existing,%currcookies); |
if (ref($settings) eq 'HASH') { |
if (ref($settings) eq 'HASH') { |
%existing = %{$settings}; |
%existing = %{$settings}; |
} |
} |
if ((keys(%servers) > 1) || (keys(%existing) > 0)) { |
if ((keys(%servers) > 1) || (keys(%existing) > 0)) { |
&get_loadbalancers_config(\%servers,\%existing,\%currbalancer, |
&get_loadbalancers_config(\%servers,\%existing,\%currbalancer, |
\%currtargets,\%currrules); |
\%currtargets,\%currrules,\%currcookies); |
} else { |
} else { |
return; |
return; |
} |
} |
Line 6422 sub print_loadbalancing {
|
Line 6475 sub print_loadbalancing {
|
my %hostherechecked = ( |
my %hostherechecked = ( |
no => ' checked="checked"', |
no => ' checked="checked"', |
); |
); |
|
my %balcookiechecked = ( |
|
no => ' checked="checked"', |
|
); |
foreach my $sparetype (@sparestypes) { |
foreach my $sparetype (@sparestypes) { |
my $targettable; |
my $targettable; |
for (my $i=0; $i<$numspares; $i++) { |
for (my $i=0; $i<$numspares; $i++) { |
Line 6477 sub print_loadbalancing {
|
Line 6533 sub print_loadbalancing {
|
} |
} |
} |
} |
} |
} |
|
if ($currcookies{$lonhost}) { |
|
%balcookiechecked = ( |
|
yes => ' checked="checked"', |
|
); |
|
} |
$datatable .= &mt('Hosting on balancer itself').'<br />'. |
$datatable .= &mt('Hosting on balancer itself').'<br />'. |
'<label><input type="radio" name="loadbalancing_target_'.$balnum.'_hosthere" value="no"'. |
'<label><input type="radio" name="loadbalancing_target_'.$balnum.'_hosthere" value="no"'. |
$hostherechecked{'no'}.' />'.&mt('No').'</label><br />'; |
$hostherechecked{'no'}.' />'.&mt('No').'</label><br />'; |
Line 6485 sub print_loadbalancing {
|
Line 6546 sub print_loadbalancing {
|
'value="'.$sparetype.'"'.$hostherechecked{$sparetype}.' /><i>'.$typetitles{$sparetype}. |
'value="'.$sparetype.'"'.$hostherechecked{$sparetype}.' /><i>'.$typetitles{$sparetype}. |
'</i></label><br />'; |
'</i></label><br />'; |
} |
} |
$datatable .= '</div></td></tr>'. |
$datatable .= &mt('Use balancer cookie').'<br />'. |
|
'<label><input type="radio" name="loadbalancing_cookie_'.$balnum.'" value="1"'. |
|
$balcookiechecked{'yes'}.' />'.&mt('Yes').'</label><br />'. |
|
'<label><input type="radio" name="loadbalancing_cookie_'.$balnum.'" value="0"'. |
|
$balcookiechecked{'no'}.' />'.&mt('No').'</label><br />'. |
|
'</div></td></tr>'. |
&loadbalancing_rules($dom,$intdom,$currrules{$lonhost}, |
&loadbalancing_rules($dom,$intdom,$currrules{$lonhost}, |
$othertitle,$usertypes,$types,\%servers, |
$othertitle,$usertypes,$types,\%servers, |
\%currbalancer,$lonhost, |
\%currbalancer,$lonhost, |
Line 6499 sub print_loadbalancing {
|
Line 6565 sub print_loadbalancing {
|
} |
} |
|
|
sub get_loadbalancers_config { |
sub get_loadbalancers_config { |
my ($servers,$existing,$currbalancer,$currtargets,$currrules) = @_; |
my ($servers,$existing,$currbalancer,$currtargets,$currrules,$currcookies) = @_; |
return unless ((ref($servers) eq 'HASH') && |
return unless ((ref($servers) eq 'HASH') && |
(ref($existing) eq 'HASH') && (ref($currbalancer) eq 'HASH') && |
(ref($existing) eq 'HASH') && (ref($currbalancer) eq 'HASH') && |
(ref($currtargets) eq 'HASH') && (ref($currrules) eq 'HASH')); |
(ref($currtargets) eq 'HASH') && (ref($currrules) eq 'HASH') && |
|
(ref($currcookies) eq 'HASH')); |
if (keys(%{$existing}) > 0) { |
if (keys(%{$existing}) > 0) { |
my $oldlonhost; |
my $oldlonhost; |
foreach my $key (sort(keys(%{$existing}))) { |
foreach my $key (sort(keys(%{$existing}))) { |
Line 6521 sub get_loadbalancers_config {
|
Line 6588 sub get_loadbalancers_config {
|
$currbalancer->{$key} = 1; |
$currbalancer->{$key} = 1; |
$currtargets->{$key} = $existing->{$key}{'targets'}; |
$currtargets->{$key} = $existing->{$key}{'targets'}; |
$currrules->{$key} = $existing->{$key}{'rules'}; |
$currrules->{$key} = $existing->{$key}{'rules'}; |
|
if ($existing->{$key}{'cookie'}) { |
|
$currcookies->{$key} = 1; |
|
} |
} |
} |
} |
} |
} else { |
} else { |
Line 7910 sub defaults_titles {
|
Line 7980 sub defaults_titles {
|
return (\%titles); |
return (\%titles); |
} |
} |
|
|
|
sub print_scantron { |
|
my ($r,$position,$dom,$confname,$settings,$rowtotal) = @_; |
|
if ($position eq 'top') { |
|
return &print_scantronformat($r,$dom,$confname,$settings,\$rowtotal); |
|
} else { |
|
return &print_scantronconfig($dom,$settings,\$rowtotal); |
|
} |
|
} |
|
|
|
sub scantron_javascript { |
|
return <<"ENDSCRIPT"; |
|
|
|
<script type="text/javascript"> |
|
// <![CDATA[ |
|
|
|
function toggleScantron(form) { |
|
if (document.getElementById('scantroncsv_cols')) { |
|
var csvfieldset = document.getElementById('scantroncsv_cols'); |
|
if (document.getElementById('scantronconfcsv')) { |
|
var scantroncsv = document.getElementById('scantronconfcsv'); |
|
if (scantroncsv.checked) { |
|
csvfieldset.style.display = 'inline-block'; |
|
} else { |
|
csvfieldset.style.display = 'none'; |
|
var csvselects = document.getElementsByClassName('scantronconfig_csv'); |
|
if (csvselects.length) { |
|
for (var j=0; j<csvselects.length; j++) { |
|
csvselects[j].selectedIndex = 0; |
|
} |
|
} |
|
} |
|
} |
|
} |
|
return; |
|
} |
|
// ]]> |
|
</script> |
|
|
|
ENDSCRIPT |
|
|
|
} |
|
|
sub print_scantronformat { |
sub print_scantronformat { |
my ($r,$dom,$confname,$settings,$rowtotal) = @_; |
my ($r,$dom,$confname,$settings,$rowtotal) = @_; |
my $itemcount = 1; |
my $itemcount = 1; |
Line 7936 sub print_scantronformat {
|
Line 8048 sub print_scantronformat {
|
if ($configuserok eq 'ok') { |
if ($configuserok eq 'ok') { |
if ($author_ok eq 'ok') { |
if ($author_ok eq 'ok') { |
my %legacyfile = ( |
my %legacyfile = ( |
default => $Apache::lonnet::perlvar{'lonTabDir'}.'/default_scantronformat.tab', |
default => $Apache::lonnet::perlvar{'lonTabDir'}.'/default_scantronformat.tab', |
custom => $Apache::lonnet::perlvar{'lonTabDir'}.'/scantronformat.tab', |
custom => $Apache::lonnet::perlvar{'lonTabDir'}.'/scantronformat.tab', |
); |
); |
my %md5chk; |
my %md5chk; |
foreach my $type (keys(%legacyfile)) { |
foreach my $type (keys(%legacyfile)) { |
Line 7946 sub print_scantronformat {
|
Line 8058 sub print_scantronformat {
|
} |
} |
if ($md5chk{'default'} ne $md5chk{'custom'}) { |
if ($md5chk{'default'} ne $md5chk{'custom'}) { |
foreach my $type (keys(%legacyfile)) { |
foreach my $type (keys(%legacyfile)) { |
($scantronurls{$type},my $error) = |
($scantronurls{$type},my $error) = |
&legacy_scantronformat($r,$dom,$confname, |
&legacy_scantronformat($r,$dom,$confname, |
$type,$legacyfile{$type}, |
$type,$legacyfile{$type}, |
$scantronurls{$type}, |
$scantronurls{$type}, |
Line 7957 sub print_scantronformat {
|
Line 8069 sub print_scantronformat {
|
} |
} |
if (keys(%error) == 0) { |
if (keys(%error) == 0) { |
$is_custom = 1; |
$is_custom = 1; |
$confhash{'scantron'}{'scantronformat'} = |
$confhash{'scantron'}{'scantronformat'} = |
$scantronurls{'custom'}; |
$scantronurls{'custom'}; |
my $putresult = |
my $putresult = |
&Apache::lonnet::put_dom('configuration', |
&Apache::lonnet::put_dom('configuration', |
\%confhash,$dom); |
\%confhash,$dom); |
if ($putresult ne 'ok') { |
if ($putresult ne 'ok') { |
$error{'custom'} = |
$error{'custom'} = |
'<span class="LC_error">'. |
'<span class="LC_error">'. |
&mt('An error occurred updating the domain configuration: [_1]',$putresult).'</span>'; |
&mt('An error occurred updating the domain configuration: [_1]',$putresult).'</span>'; |
} |
} |
Line 8083 sub legacy_scantronformat {
|
Line 8195 sub legacy_scantronformat {
|
return ($url,$error); |
return ($url,$error); |
} |
} |
|
|
|
sub print_scantronconfig { |
|
my ($dom,$settings,$rowtotal) = @_; |
|
my $itemcount = 2; |
|
my $is_checked = ' checked="checked"'; |
|
my $currcsvsty = 'none'; |
|
my ($datatable,%csvfields,%checked,%onclick); |
|
my @fields = &scantroncsv_fields(); |
|
my %titles = &scantronconfig_titles(); |
|
if (ref($settings) eq 'HASH') { |
|
if (ref($settings->{config}) eq 'HASH') { |
|
if ($settings->{config}->{dat}) { |
|
$checked{'dat'} = $is_checked; |
|
} |
|
if (ref($settings->{config}->{csv}) eq 'HASH') { |
|
%csvfields = %{$settings->{config}->{csv}}; |
|
if (keys(%csvfields) > 0) { |
|
$checked{'csv'} = $is_checked; |
|
$currcsvsty = 'inline-block'; |
|
} |
|
} |
|
} else { |
|
$checked{'dat'} = $is_checked; |
|
} |
|
} else { |
|
$checked{'dat'} = $is_checked; |
|
} |
|
$onclick{'csv'} = ' onclick="toggleScantron(this.form);"'; |
|
my $css_class = $itemcount%2? ' class="LC_odd_row"':''; |
|
$datatable = '<tr '.$css_class.'><td>'.&mt('Supported formats').'</td>'. |
|
'<td class="LC_left_item" valign="top"><span class="LC_nobreak">'; |
|
foreach my $item ('dat','csv') { |
|
my $id; |
|
if ($item eq 'csv') { |
|
$id = 'id="scantronconfcsv" '; |
|
} |
|
$datatable .= '<label><input type="checkbox" name="scantronconfig" '.$id.'value="'.$item.'"'.$checked{$item}.$onclick{$item}.' />'. |
|
$titles{$item}.'</label>'.(' 'x3); |
|
if ($item eq 'csv') { |
|
$datatable .= '<fieldset style="display:'.$currcsvsty.'" id="scantroncsv_cols">'. |
|
'<legend>'.&mt('CSV Column Mapping').'</legend>'. |
|
'<table><tr><th>'.&mt('Field').'</th><th>'.&mt('Location').'</th></tr>'."\n"; |
|
foreach my $col (@fields) { |
|
my $selnone; |
|
if ($csvfields{$col} eq '') { |
|
$selnone = ' selected="selected"'; |
|
} |
|
$datatable .= '<tr><td>'.$titles{$col}.'</td>'. |
|
'<td><select name="scantronconfig_csv_'.$col.'" class="scantronconfig_csv">'. |
|
'<option value=""'.$selnone.'></option>'; |
|
for (my $i=0; $i<20; $i++) { |
|
my $shown = $i+1; |
|
my $sel; |
|
unless ($selnone) { |
|
if (exists($csvfields{$col})) { |
|
if ($csvfields{$col} == $i) { |
|
$sel = ' selected="selected"'; |
|
} |
|
} |
|
} |
|
$datatable .= '<option value="'.$i.'"'.$sel.'>'.$shown.'</option>'; |
|
} |
|
$datatable .= '</select></td></tr>'; |
|
} |
|
$datatable .= '</table></fieldset>'; |
|
$itemcount ++; |
|
} |
|
} |
|
$datatable .= '</td></tr>'; |
|
$$rowtotal ++; |
|
return $datatable; |
|
} |
|
|
|
sub scantronconfig_titles { |
|
return &Apache::lonlocal::texthash( |
|
dat => 'Standard format (.dat)', |
|
csv => 'Comma separated values (.csv)', |
|
CODE => 'CODE', |
|
ID => 'Student ID', |
|
PaperID => 'Paper ID', |
|
FirstName => 'First Name', |
|
LastName => 'Last Name', |
|
FirstQuestion => 'First Question Response', |
|
Section => 'Section', |
|
); |
|
} |
|
|
|
sub scantroncsv_fields { |
|
return ('PaperID','LastName','FirstName','ID','Section','CODE','FirstQuestion'); |
|
} |
|
|
sub print_coursecategories { |
sub print_coursecategories { |
my ($position,$dom,$hdritem,$settings,$rowtotal) = @_; |
my ($position,$dom,$hdritem,$settings,$rowtotal) = @_; |
my $datatable; |
my $datatable; |
Line 11759 sub modify_lti {
|
Line 11961 sub modify_lti {
|
if ($position ne '') { |
if ($position ne '') { |
$allpos[$position] = $itemid; |
$allpos[$position] = $itemid; |
} |
} |
foreach my $item ('consumer','key','secret','lifetime') { |
foreach my $item ('consumer','key','secret','lifetime','requser') { |
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 11781 sub modify_lti {
|
Line 11983 sub modify_lti {
|
if ($env{'form.lti_version_'.$idx} eq 'LTI-1p0') { |
if ($env{'form.lti_version_'.$idx} eq 'LTI-1p0') { |
$confhash{$itemid}{'version'} = $env{'form.lti_version_'.$idx}; |
$confhash{$itemid}{'version'} = $env{'form.lti_version_'.$idx}; |
} |
} |
if ($env{'form.lti_mapuser_'.$idx} eq 'sourcedid') { |
if ($confhash{$itemid}{'requser'}) { |
$confhash{$itemid}{'mapuser'} = 'lis_person_sourcedid'; |
if ($env{'form.lti_mapuser_'.$idx} eq 'sourcedid') { |
} elsif ($env{'form.lti_mapuser_'.$idx} eq 'email') { |
$confhash{$itemid}{'mapuser'} = 'lis_person_sourcedid'; |
$confhash{$itemid}{'mapuser'} = 'lis_person_contact_email_primary'; |
} elsif ($env{'form.lti_mapuser_'.$idx} eq 'email') { |
} elsif ($env{'form.lti_mapuser_'.$idx} eq 'other') { |
$confhash{$itemid}{'mapuser'} = 'lis_person_contact_email_primary'; |
my $mapuser = $env{'form.lti_customuser_'.$idx}; |
} elsif ($env{'form.lti_mapuser_'.$idx} eq 'other') { |
$mapuser =~ s/(`)/'/g; |
my $mapuser = $env{'form.lti_customuser_'.$idx}; |
$mapuser =~ s/^\s+|\s+$//g; |
$mapuser =~ s/(`)/'/g; |
$confhash{$itemid}{'mapuser'} = $mapuser; |
$mapuser =~ s/^\s+|\s+$//g; |
} |
$confhash{$itemid}{'mapuser'} = $mapuser; |
foreach my $ltirole (@lticourseroles) { |
} |
my $possrole = $env{'form.lti_maprole_'.$ltirole.'_'.$idx}; |
foreach my $ltirole (@lticourseroles) { |
if (grep(/^\Q$possrole\E$/,@courseroles)) { |
my $possrole = $env{'form.lti_maprole_'.$ltirole.'_'.$idx}; |
$confhash{$itemid}{'maproles'}{$ltirole} = $possrole; |
if (grep(/^\Q$possrole\E$/,@courseroles)) { |
} |
$confhash{$itemid}{'maproles'}{$ltirole} = $possrole; |
} |
} |
my @possmakeuser = &Apache::loncommon::get_env_multiple('form.lti_makeuser_'.$idx); |
} |
my @makeuser; |
my @possmakeuser = &Apache::loncommon::get_env_multiple('form.lti_makeuser_'.$idx); |
foreach my $ltirole (sort(@possmakeuser)) { |
my @makeuser; |
if ($posslti{$ltirole}) { |
foreach my $ltirole (sort(@possmakeuser)) { |
push(@makeuser,$ltirole); |
if ($posslti{$ltirole}) { |
} |
push(@makeuser,$ltirole); |
} |
} |
$confhash{$itemid}{'makeuser'} = \@makeuser; |
} |
if (@makeuser) { |
$confhash{$itemid}{'makeuser'} = \@makeuser; |
my $lcauth = $env{'form.lti_lcauth_'.$idx}; |
if (@makeuser) { |
if ($lcauth =~ /^(internal|krb4|krb5|localauth)$/) { |
my $lcauth = $env{'form.lti_lcauth_'.$idx}; |
$confhash{$itemid}{'lcauth'} = $lcauth; |
if ($lcauth =~ /^(internal|krb4|krb5|localauth)$/) { |
if ($lcauth ne 'internal') { |
$confhash{$itemid}{'lcauth'} = $lcauth; |
my $lcauthparm = $env{'form.lti_lcauthparm_'.$idx}; |
if ($lcauth ne 'internal') { |
$lcauthparm =~ s/^(\s+|\s+)$//g; |
my $lcauthparm = $env{'form.lti_lcauthparm_'.$idx}; |
$lcauthparm =~ s/`//g; |
$lcauthparm =~ s/^(\s+|\s+)$//g; |
if ($lcauthparm ne '') { |
$lcauthparm =~ s/`//g; |
$confhash{$itemid}{'lcauthparm'} = $lcauthparm; |
if ($lcauthparm ne '') { |
|
$confhash{$itemid}{'lcauthparm'} = $lcauthparm; |
|
} |
} |
} |
|
} else { |
|
$confhash{$itemid}{'lcauth'} = 'lti'; |
} |
} |
} else { |
|
$confhash{$itemid}{'lcauth'} = 'lti'; |
|
} |
} |
} |
my @possinstdata = &Apache::loncommon::get_env_multiple('form.lti_instdata_'.$idx); |
my @possinstdata = &Apache::loncommon::get_env_multiple('form.lti_instdata_'.$idx); |
if (@possinstdata) { |
if (@possinstdata) { |
foreach my $field (@possinstdata) { |
foreach my $field (@possinstdata) { |
if (exists($fieldtitles{$field})) { |
if (exists($fieldtitles{$field})) { |
push(@{$confhash{$itemid}{'instdata'}}); |
push(@{$confhash{$itemid}{'instdata'}}); |
} |
} |
} |
} |
} |
} |
if (($env{'form.lti_mapcrs_'.$idx} eq 'course_offering_sourcedid') || |
if (($env{'form.lti_mapcrs_'.$idx} eq 'course_offering_sourcedid') || |
($env{'form.lti_mapcrs_'.$idx} eq 'context_id')) { |
($env{'form.lti_mapcrs_'.$idx} eq 'context_id')) { |
$confhash{$itemid}{'mapcrs'} = $env{'form.lti_mapcrs_'.$idx}; |
$confhash{$itemid}{'mapcrs'} = $env{'form.lti_mapcrs_'.$idx}; |
} elsif ($env{'form.lti_mapcrs_'.$idx} eq 'other') { |
} elsif ($env{'form.lti_mapcrs_'.$idx} eq 'other') { |
my $mapcrs = $env{'form.lti_mapcrsfield_'.$idx}; |
my $mapcrs = $env{'form.lti_mapcrsfield_'.$idx}; |
$mapcrs =~ s/(`)/'/g; |
$mapcrs =~ s/(`)/'/g; |
$mapcrs =~ s/^\s+|\s+$//g; |
$mapcrs =~ s/^\s+|\s+$//g; |
$confhash{$itemid}{'mapcrs'} = $mapcrs; |
$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); |
|
} |
} |
} |
my @posstypes = &Apache::loncommon::get_env_multiple('form.lti_mapcrstype_'.$idx); |
$confhash{$itemid}{'selfenroll'} = \@selfenroll; |
my @crstypes; |
if ($env{'form.lti_crssec_'.$idx}) { |
foreach my $type (sort(@posstypes)) { |
if ($env{'form.lti_crssecsrc_'.$idx} eq 'course_section_sourcedid') { |
if ($posscrstype{$type}) { |
$confhash{$itemid}{'section'} = $env{'form.lti_crssecsrc_'.$idx}; |
push(@crstypes,$type); |
} 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; |
|
} |
} |
} |
} |
} |
$confhash{$itemid}{'mapcrstype'} = \@crstypes; |
foreach my $field ('passback','roster','topmenu','inlinemenu') { |
if ($env{'form.lti_makecrs_'.$idx}) { |
if ($env{'form.lti_'.$field.'_'.$idx}) { |
$confhash{$itemid}{'makecrs'} = 1; |
$confhash{$itemid}{$field} = 1; |
|
} |
} |
} |
my @possenroll = &Apache::loncommon::get_env_multiple('form.lti_selfenroll_'.$idx); |
if ($env{'form.lti_passback_'.$idx}) { |
my @selfenroll; |
if ($env{'form.lti_passbackformat_'.$idx} eq '1.0') { |
foreach my $type (sort(@possenroll)) { |
$confhash{$itemid}{'passbackformat'} = '1.0'; |
if ($posslticrs{$type}) { |
} else { |
push(@selfenroll,$type); |
$confhash{$itemid}{'passbackformat'} = '1.1'; |
} |
} |
} |
} |
$confhash{$itemid}{'selfenroll'} = \@selfenroll; |
if ($env{'form.lti_topmenu_'.$idx} || $env{'form.lti_inlinemenu_'.$idx}) { |
if ($env{'form.lti_crssec_'.$idx}) { |
$confhash{$itemid}{lcmenu} = []; |
if ($env{'form.lti_crssecsrc_'.$idx} eq 'course_section_sourcedid') { |
my @possmenu = &Apache::loncommon::get_env_multiple('form.lti_menuitem_'.$idx); |
$confhash{$itemid}{'section'} = $env{'form.lti_crssecsrc_'.$idx}; |
foreach my $field (@possmenu) { |
} elsif ($env{'form.lti_crssecsrc_'.$idx} eq 'other') { |
if (exists($menutitles{$field})) { |
my $section = $env{'form.lti_customsection_'.$idx}; |
if ($field eq 'grades') { |
$section =~ s/(`)/'/g; |
next unless ($env{'form.lti_inlinemenu_'.$idx}); |
$section =~ s/^\s+|\s+$//g; |
|
if ($section ne '') { |
|
$confhash{$itemid}{'section'} = $section; |
} |
} |
push(@{$confhash{$itemid}{lcmenu}},$field); |
|
} |
} |
} |
} |
} |
foreach my $field ('passback','roster','topmenu','inlinemenu') { |
unless (($idx eq 'add') || ($changes{$itemid})) { |
if ($env{'form.lti_'.$field.'_'.$idx}) { |
foreach my $field ('mapuser','mapcrs','makecrs','section','passback','roster','lcauth','lcauthparm','topmenu','inlinemenu') { |
$confhash{$itemid}{$field} = 1; |
if ($domconfig{$action}{$itemid}{$field} ne $confhash{$itemid}{$field}) { |
|
$changes{$itemid} = 1; |
|
} |
} |
} |
} |
unless ($changes{$itemid}) { |
if ($env{'form.lti_passback_'.$idx}) { |
if ($domconfig{$action}{$itemid}{'passback'} eq $confhash{$itemid}{'passback'}) { |
if ($env{'form.lti_passbackformat_'.$idx} eq '1.0') { |
if ($domconfig{$action}{$itemid}{'passbackformat'} ne $confhash{$itemid}{'passbackformat'}) { |
$confhash{$itemid}{'passbackformat'} = '1.0'; |
$changes{$itemid} = 1; |
} else { |
|
$confhash{$itemid}{'passbackformat'} = '1.1'; |
|
} |
|
} |
|
if ($env{'form.lti_topmenu_'.$idx} || $env{'form.lti_inlinemenu_'.$idx}) { |
|
$confhash{$itemid}{lcmenu} = []; |
|
my @possmenu = &Apache::loncommon::get_env_multiple('form.lti_menuitem_'.$idx); |
|
foreach my $field (@possmenu) { |
|
if (exists($menutitles{$field})) { |
|
if ($field eq 'grades') { |
|
next unless ($env{'form.lti_inlinemenu_'.$idx}); |
|
} |
|
push(@{$confhash{$itemid}{lcmenu}},$field); |
} |
} |
} |
} |
} |
} |
foreach my $field ('makeuser','mapcrstype','selfenroll','instdata','lcmenu') { |
unless (($idx eq 'add') || ($changes{$itemid})) { |
|
foreach my $field ('mapuser','mapcrs','makecrs','section','passback','roster','lcauth','lcauthparm','topmenu','inlinemenu') { |
|
if ($domconfig{$action}{$itemid}{$field} ne $confhash{$itemid}{$field}) { |
|
$changes{$itemid} = 1; |
|
} |
|
} |
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 ('makeuser','mapcrstype','selfenroll','instdata','lcmenu') { |
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}) { |
} elsif (keys(%{$domconfig{$action}{$itemid}{'maproles'}}) > 0) { |
foreach my $ltirole (keys(%{$confhash{$itemid}{'maproles'}})) { |
$changes{$itemid} = 1; |
if ($confhash{$itemid}{'maproles'}{$ltirole} ne |
} |
$domconfig{$action}{$itemid}{'maproles'}{$ltirole}) { |
} elsif (ref($confhash{$itemid}{'maproles'}) eq 'HASH') { |
$changes{$itemid} = 1; |
unless ($changes{$itemid}) { |
last; |
if (keys(%{$confhash{$itemid}{'maproles'}}) > 0) { |
} |
|
} |
|
} |
|
} elsif (keys(%{$domconfig{$action}{$itemid}{'maproles'}}) > 0) { |
$changes{$itemid} = 1; |
$changes{$itemid} = 1; |
} |
} |
|
} elsif (ref($confhash{$itemid}{'maproles'}) eq 'HASH') { |
|
unless ($changes{$itemid}) { |
|
if (keys(%{$confhash{$itemid}{'maproles'}}) > 0) { |
|
$changes{$itemid} = 1; |
|
} |
|
} |
} |
} |
} |
} |
} |
} |
Line 12024 sub modify_lti {
|
Line 12228 sub modify_lti {
|
my $num = length($encconfig{$itemid}{'secret'}); |
my $num = length($encconfig{$itemid}{'secret'}); |
$resulttext .= ('*'x$num).'</li>'; |
$resulttext .= ('*'x$num).'</li>'; |
} |
} |
if ($confhash{$itemid}{'mapuser'}) { |
if ($confhash{$itemid}{'requser'}) { |
my $shownmapuser; |
if ($confhash{$itemid}{'mapuser'}) { |
if ($confhash{$itemid}{'mapuser'} eq 'lis_person_sourcedid') { |
my $shownmapuser; |
$shownmapuser = $lt{'sourcedid'}.' (lis_person_sourcedid)'; |
if ($confhash{$itemid}{'mapuser'} eq 'lis_person_sourcedid') { |
} elsif ($confhash{$itemid}{'mapuser'} eq 'lis_person_contact_email_primary') { |
$shownmapuser = $lt{'sourcedid'}.' (lis_person_sourcedid)'; |
$shownmapuser = $lt{'email'}.' (lis_person_contact_email_primary)'; |
} elsif ($confhash{$itemid}{'mapuser'} eq 'lis_person_contact_email_primary') { |
} else { |
$shownmapuser = $lt{'email'}.' (lis_person_contact_email_primary)'; |
$shownmapuser = &mt('Other').' ('.$confhash{$itemid}{'mapuser'}.')'; |
} else { |
} |
$shownmapuser = &mt('Other').' ('.$confhash{$itemid}{'mapuser'}.')'; |
$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').','; |
|
} |
} |
|
$resulttext .= '<li>'.&mt('LON-CAPA username').': '.$shownmapuser.'</li>'; |
} |
} |
if ($rolemaps) { |
if (ref($confhash{$itemid}{'maproles'}) eq 'HASH') { |
$rolemaps =~ s/,$//; |
my $rolemaps; |
$resulttext .= '<li>'.&mt('Role mapping:').$rolemaps.'</li>'; |
foreach my $role (@ltiroles) { |
} |
if ($confhash{$itemid}{'maproles'}{$role}) { |
} |
$rolemaps .= (' 'x2).$role.'='. |
if (ref($confhash{$itemid}{'makeuser'}) eq 'ARRAY') { |
&Apache::lonnet::plaintext($confhash{$itemid}{'maproles'}{$role}, |
if (@{$confhash{$itemid}{'makeuser'}} > 0) { |
'Course').','; |
$resulttext .= '<li>'.&mt('Following roles may create user accounts: [_1]', |
} |
join(', ',@{$confhash{$itemid}{'makeuser'}})).'<br />'; |
} |
if ($confhash{$itemid}{'lcauth'} eq 'lti') { |
if ($rolemaps) { |
$resulttext .= &mt('New users will only be able to authenticate via LTI').'</li>'; |
$rolemaps =~ s/,$//; |
} else { |
$resulttext .= '<li>'.&mt('Role mapping:').$rolemaps.'</li>'; |
$resulttext .= &mt('New users will be assigned LON-CAPA authentication: [_1]', |
} |
$confhash{$itemid}{'lcauth'}); |
} |
if ($confhash{$itemid}{'lcauth'} eq 'internal') { |
if (ref($confhash{$itemid}{'makeuser'}) eq 'ARRAY') { |
$resulttext .= '; '.&mt('a randomly generated password will be created'); |
if (@{$confhash{$itemid}{'makeuser'}} > 0) { |
} elsif ($confhash{$itemid}{'lcauth'} eq 'localauth') { |
$resulttext .= '<li>'.&mt('Following roles may create user accounts: [_1]', |
if ($confhash{$itemid}{'lcauthparm'} ne '') { |
join(', ',@{$confhash{$itemid}{'makeuser'}})).'<br />'; |
$resulttext .= ' '.&mt('with argument: [_1]',$confhash{$itemid}{'lcauthparm'}); |
if ($confhash{$itemid}{'lcauth'} eq 'lti') { |
} |
$resulttext .= &mt('New users will only be able to authenticate via LTI').'</li>'; |
} else { |
} else { |
$resulttext .= '; '.&mt('Kerberos domain: [_1]',$confhash{$itemid}{'lcauthparm'}); |
$resulttext .= &mt('New users will be assigned LON-CAPA authentication: [_1]', |
|
$confhash{$itemid}{'lcauth'}); |
|
if ($confhash{$itemid}{'lcauth'} eq 'internal') { |
|
$resulttext .= '; '.&mt('a randomly generated password will be created'); |
|
} elsif ($confhash{$itemid}{'lcauth'} eq 'localauth') { |
|
if ($confhash{$itemid}{'lcauthparm'} ne '') { |
|
$resulttext .= ' '.&mt('with argument: [_1]',$confhash{$itemid}{'lcauthparm'}); |
|
} |
|
} else { |
|
$resulttext .= '; '.&mt('Kerberos domain: [_1]',$confhash{$itemid}{'lcauthparm'}); |
|
} |
} |
} |
|
$resulttext .= '</li>'; |
|
} else { |
|
$resulttext .= '<li>'.&mt('User account creation not permitted.').'</li>'; |
} |
} |
$resulttext .= '</li>'; |
|
} else { |
|
$resulttext .= '<li>'.&mt('User account creation not permitted.').'</li>'; |
|
} |
} |
} |
if (ref($confhash{$itemid}{'instdata'}) eq 'ARRAY') { |
if (ref($confhash{$itemid}{'instdata'}) eq 'ARRAY') { |
if (@{$confhash{$itemid}{'instdata'}} > 0) { |
if (@{$confhash{$itemid}{'instdata'}} > 0) { |
$resulttext .= '<li>'.&mt('Institutional data will be used when creating a new user for: [_1]', |
$resulttext .= '<li>'.&mt('Institutional data will be used when creating a new user for: [_1]', |
join(', ',map { $fieldtitles{$_}; } @{$confhash{$itemid}{'instdata'}})).'</li>'; |
join(', ',map { $fieldtitles{$_}; } @{$confhash{$itemid}{'instdata'}})).'</li>'; |
} else { |
} else { |
$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'}) { |
if ($confhash{$itemid}{'mapcrs'}) { |
$resulttext .= '<li>'.&mt('Unique course identifier').': '.$confhash{$itemid}{'mapcrs'}.'</li>'; |
$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 (ref($confhash{$itemid}{'mapcrstype'}) eq 'ARRAY') { |
if ($confhash{$itemid}{'makecrs'}) { |
if (@{$confhash{$itemid}{'mapcrstype'}} > 0) { |
$resulttext .= '<li>'.&mt('Instructor may create course (if absent).').'</li>'; |
$resulttext .= '<li>'.&mt('Mapping for the following LON-CAPA course types: [_1]', |
} else { |
join(', ',map { $coursetypetitles{$_}; } @coursetypes)). |
$resulttext .= '<li>'.&mt('Instructor may not create course (if absent).').'</li>'; |
'</li>'; |
} |
} else { |
if (ref($confhash{$itemid}{'selfenroll'}) eq 'ARRAY') { |
$resulttext .= '<li>'.&mt('No mapping to LON-CAPA courses').'</li>'; |
if (@{$confhash{$itemid}{'selfenroll'}} > 0) { |
} |
$resulttext .= '<li>'.&mt('Self-enrollment for following roles: [_1]', |
} |
join(', ',@{$confhash{$itemid}{'selfenroll'}})). |
if ($confhash{$itemid}{'makecrs'}) { |
'</li>'; |
$resulttext .= '<li>'.&mt('Instructor may create course (if absent).').'</li>'; |
} else { |
} else { |
$resulttext .= '<li>'.&mt('Self-enrollment not permitted').'</li>'; |
$resulttext .= '<li>'.&mt('Instructor may not create course (if absent).').'</li>'; |
} |
} |
} |
if (ref($confhash{$itemid}{'selfenroll'}) eq 'ARRAY') { |
if ($confhash{$itemid}{'section'}) { |
if (@{$confhash{$itemid}{'selfenroll'}} > 0) { |
if ($confhash{$itemid}{'section'} eq 'course_section_sourcedid') { |
$resulttext .= '<li>'.&mt('Self-enrollment for following roles: [_1]', |
$resulttext .= '<li>'.&mt('User section from standard field:'). |
join(', ',@{$confhash{$itemid}{'selfenroll'}})). |
' (course_section_sourcedid)'.'</li>'; |
'</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('User section from:').' '. |
$resulttext .= '<li>'.&mt('No section assignment').'</li>'; |
$confhash{$itemid}{'section'}.'</li>'; |
|
} |
} |
} else { |
foreach my $item ('passback','roster','topmenu','inlinemenu') { |
$resulttext .= '<li>'.&mt('No section assignment').'</li>'; |
$resulttext .= '<li>'.$lt{$item}.': '; |
} |
if ($confhash{$itemid}{$item}) { |
foreach my $item ('passback','roster','topmenu','inlinemenu') { |
$resulttext .= &mt('Yes'); |
$resulttext .= '<li>'.$lt{$item}.': '; |
if ($item eq 'passback') { |
if ($confhash{$itemid}{$item}) { |
if ($confhash{$itemid}{'passbackformat'} eq '1.0') { |
$resulttext .= &mt('Yes'); |
$resulttext .= ' ('.&mt('Outcomes Extension (1.0)').')'; |
if ($item eq 'passback') { |
} elsif ($confhash{$itemid}{'passbackformat'} eq '1.1') { |
if ($confhash{$itemid}{'passbackformat'} eq '1.0') { |
$resulttext .= ' ('.&mt('Outcomes Service (1.1)').')'; |
$resulttext .= ' ('.&mt('Outcomes Extension (1.0)').')'; |
} |
} elsif ($confhash{$itemid}{'passbackformat'} eq '1.1') { |
|
$resulttext .= ' ('.&mt('Outcomes Service (1.1)').')'; |
|
} |
} |
|
} else { |
|
$resulttext .= &mt('No'); |
} |
} |
} else { |
$resulttext .= '</li>'; |
$resulttext .= &mt('No'); |
|
} |
} |
$resulttext .= '</li>'; |
if (ref($confhash{$itemid}{'lcmenu'}) eq 'ARRAY') { |
} |
if (@{$confhash{$itemid}{'lcmenu'}} > 0) { |
if (ref($confhash{$itemid}{'lcmenu'}) eq 'ARRAY') { |
$resulttext .= '<li>'.&mt('Menu items:').' '. |
if (@{$confhash{$itemid}{'lcmenu'}} > 0) { |
join(', ', map { $menutitles{$_}; } (@{$confhash{$itemid}{'lcmenu'}})).'</li>'; |
$resulttext .= '<li>'.&mt('Menu items:').' '. |
} else { |
join(', ', map { $menutitles{$_}; } (@{$confhash{$itemid}{'lcmenu'}})).'</li>'; |
$resulttext .= '<li>'.&mt('No menu items displayed in header or online menu').'</li>'; |
} else { |
} |
$resulttext .= '<li>'.&mt('No menu items displayed in header or online menu').'</li>'; |
|
} |
} |
} |
} |
$resulttext .= '</ul></li>'; |
$resulttext .= '</ul></li>'; |
Line 14896 sub modify_scantron {
|
Line 15102 sub modify_scantron {
|
my $custom = 'custom.tab'; |
my $custom = 'custom.tab'; |
my $default = 'default.tab'; |
my $default = 'default.tab'; |
my $servadm = $r->dir_config('lonAdmEMail'); |
my $servadm = $r->dir_config('lonAdmEMail'); |
my ($configuserok,$author_ok,$switchserver) = |
my ($configuserok,$author_ok,$switchserver) = |
&config_check($dom,$confname,$servadm); |
&config_check($dom,$confname,$servadm); |
if ($env{'form.scantronformat.filename'} ne '') { |
if ($env{'form.scantronformat.filename'} ne '') { |
my $error; |
my $error; |
Line 14934 sub modify_scantron {
|
Line 15140 sub modify_scantron {
|
} |
} |
} |
} |
} |
} |
|
my @fields = &scantroncsv_fields(); |
|
my %titles = &scantronconfig_titles(); |
|
my @formats = &Apache::loncommon::get_env_multiple('form.scantronformat'); |
|
my ($newdat,$currdat,%newcol,%currcol); |
|
if (grep(/^dat$/,@formats)) { |
|
$confhash{'scantron'}{config}{dat} = 1; |
|
$newdat = 1; |
|
} else { |
|
$confhash{'scantron'}{config}{dat} = 0; |
|
$newdat = 0; |
|
} |
|
if (grep(/^csv$/,@formats)) { |
|
my %bynum; |
|
foreach my $field (@fields) { |
|
if ($env{'form.scantronconfig_csv_'.$field} =~ /^(\d+)$/) { |
|
my $posscol = $1; |
|
if (($posscol < 20) && (!$bynum{$posscol})) { |
|
$confhash{'scantron'}{config}{csv}{$field} = $posscol; |
|
$bynum{$posscol} = $field; |
|
$newcol{$field} = $posscol; |
|
} |
|
} |
|
} |
|
} |
|
$currdat = 1; |
|
if (ref($domconfig{'scantron'}) eq 'HASH') { |
|
if (ref($domconfig{'scantron'}{'config'}) eq 'HASH') { |
|
if (!$domconfig{'scantron'}{'config'}{'dat'}) { |
|
$currdat = 0; |
|
} |
|
if (ref($domconfig{'scantron'}{'config'}{'csv'}) eq 'HASH') { |
|
%currcol = %{$domconfig{'scantron'}{'config'}{'csv'}}; |
|
} |
|
} |
|
} |
|
if ($currdat != $newdat) { |
|
$changes{'config'} = 1; |
|
} else { |
|
foreach my $field (@fields) { |
|
if ($currcol{$field} ne '') { |
|
if ($currcol{$field} ne $newcol{$field}) { |
|
$changes{'config'} = 1; |
|
last; |
|
} |
|
} elsif ($newcol{$field} ne '') { |
|
$changes{'config'} = 1; |
|
last; |
|
} |
|
} |
|
} |
if (keys(%confhash) > 0) { |
if (keys(%confhash) > 0) { |
my $putresult = &Apache::lonnet::put_dom('configuration',\%confhash, |
my $putresult = &Apache::lonnet::put_dom('configuration',\%confhash, |
$dom); |
$dom); |
Line 14941 sub modify_scantron {
|
Line 15197 sub modify_scantron {
|
if (keys(%changes) > 0) { |
if (keys(%changes) > 0) { |
if (ref($confhash{'scantron'}) eq 'HASH') { |
if (ref($confhash{'scantron'}) eq 'HASH') { |
$resulttext = &mt('Changes made:').'<ul>'; |
$resulttext = &mt('Changes made:').'<ul>'; |
if ($confhash{'scantron'}{'scantronformat'} eq '') { |
if ($changes{'scantronformat'}) { |
$resulttext .= '<li>'.&mt('[_1] bubblesheet format file removed; [_2] file will be used for courses in this domain.',$custom,$default).'</li>'; |
if ($confhash{'scantron'}{'scantronformat'} eq '') { |
} else { |
$resulttext .= '<li>'.&mt('[_1] bubblesheet format file removed; [_2] file will be used for courses in this domain.',$custom,$default).'</li>'; |
$resulttext .= '<li>'.&mt('Custom bubblesheet format file ([_1]) uploaded for use with courses in this domain.',$custom).'</li>'; |
} else { |
|
$resulttext .= '<li>'.&mt('Custom bubblesheet format file ([_1]) uploaded for use with courses in this domain.',$custom).'</li>'; |
|
} |
|
} |
|
if ($changes{'config'}) { |
|
if (ref($confhash{'scantron'}{'config'}) eq 'HASH') { |
|
if ($confhash{'scantron'}{'config'}{'dat'}) { |
|
$resulttext .= '<li>'.&mt('Bubblesheet data upload formats includes .dat format').'</li>'; |
|
} |
|
if (ref($confhash{'scantron'}{'config'}{'csv'}) eq 'HASH') { |
|
if (keys(%{$confhash{'scantron'}{'config'}{'csv'}})) { |
|
'<li>'.&mt('Bubblesheet data upload formats includes .csv format, with following fields/column numbers supported:').'<ul>'; |
|
foreach my $field (@fields) { |
|
if ($confhash{'scantron'}{'config'}{'csv'}{$field} ne '') { |
|
my $showcol = $confhash{'scantron'}{'config'}{'csv'}{$field} + 1; |
|
$resulttext .= '<li>'.$titles{$field}.': '.$showcol.'</li>'; |
|
} |
|
} |
|
$resulttext .= '</ul></li>'; |
|
} |
|
} |
|
} else { |
|
$resulttext .= '<li>'.&mt('No bubblesheet data upload formats set -- will default to assuming .dat format').'</li>'; |
|
} |
} |
} |
$resulttext .= '</ul>'; |
$resulttext .= '</ul>'; |
} else { |
} else { |
$resulttext = &mt('Changes made to bubblesheet format file.'); |
$resulttext = &mt('Changes made to bubblesheet format file.'); |
} |
} |
$resulttext .= '</ul>'; |
|
&Apache::loncommon::devalidate_domconfig_cache($dom); |
&Apache::loncommon::devalidate_domconfig_cache($dom); |
if (ref($lastactref) eq 'HASH') { |
if (ref($lastactref) eq 'HASH') { |
$lastactref->{'domainconfig'} = 1; |
$lastactref->{'domainconfig'} = 1; |
} |
} |
} else { |
} else { |
$resulttext = &mt('No changes made to bubblesheet format file'); |
$resulttext = &mt('No changes made to bubblesheet format settings'); |
} |
} |
} else { |
} else { |
$resulttext = '<span class="LC_error">'. |
$resulttext = '<span class="LC_error">'. |
Line 16625 sub modify_usersessions {
|
Line 16903 sub modify_usersessions {
|
} else { |
} else { |
foreach my $type (@{$types{$prefix}}) { |
foreach my $type (@{$types{$prefix}}) { |
if (defined($changes{$prefix}{$type})) { |
if (defined($changes{$prefix}{$type})) { |
my $newvalue; |
my ($newvalue,$notinuse); |
if (ref($defaultshash{'usersessions'}) eq 'HASH') { |
if (ref($defaultshash{'usersessions'}) eq 'HASH') { |
if (ref($defaultshash{'usersessions'}{$prefix})) { |
if (ref($defaultshash{'usersessions'}{$prefix})) { |
if ($type eq 'version') { |
if ($type eq 'version') { |
$newvalue = $defaultshash{'usersessions'}{$prefix}{$type}; |
$newvalue = $defaultshash{'usersessions'}{$prefix}{$type}; |
} elsif (ref($defaultshash{'usersessions'}{$prefix}{$type}) eq 'ARRAY') { |
} else { |
if (@{$defaultshash{'usersessions'}{$prefix}{$type}} > 0) { |
if (ref($defaultshash{'usersessions'}{$prefix}{$type}) eq 'ARRAY') { |
$newvalue = join(', ',@{$defaultshash{'usersessions'}{$prefix}{$type}}); |
if (@{$defaultshash{'usersessions'}{$prefix}{$type}} > 0) { |
|
$newvalue = join(', ',@{$defaultshash{'usersessions'}{$prefix}{$type}}); |
|
} |
|
} else { |
|
$notinuse = 1; |
} |
} |
} |
} |
} |
} |
Line 16640 sub modify_usersessions {
|
Line 16922 sub modify_usersessions {
|
if ($newvalue eq '') { |
if ($newvalue eq '') { |
if ($type eq 'version') { |
if ($type eq 'version') { |
$resulttext .= '<li>'.&mt('[_1] set to: off',$lt{$type}).'</li>'; |
$resulttext .= '<li>'.&mt('[_1] set to: off',$lt{$type}).'</li>'; |
|
} elsif ($notinuse) { |
|
$resulttext .= '<li>'.&mt('[_1] set to: not in use',$lt{$type}).'</li>'; |
} else { |
} else { |
$resulttext .= '<li>'.&mt('[_1] set to: none',$lt{$type}).'</li>'; |
$resulttext .= '<li>'.&mt('[_1] set to: none',$lt{$type}).'</li>'; |
} |
} |
} else { |
} else { |
if ($type eq 'version') { |
if ($type eq 'version') { |
$newvalue .= ' '.&mt('(or later)'); |
$newvalue .= ' '.&mt('(or later)'); |
} |
} |
$resulttext .= '<li>'.&mt('[_1] set to: [_2].',$lt{$type},$newvalue).'</li>'; |
$resulttext .= '<li>'.&mt('[_1] set to: [_2].',$lt{$type},$newvalue).'</li>'; |
} |
} |
Line 16833 sub modify_ssl {
|
Line 17117 sub modify_ssl {
|
$resulttext .= '<li>'.$titles{$prefix}.'<ul>'; |
$resulttext .= '<li>'.$titles{$prefix}.'<ul>'; |
foreach my $type (@{$types{$prefix}}) { |
foreach my $type (@{$types{$prefix}}) { |
if (defined($changes{$prefix}{$type})) { |
if (defined($changes{$prefix}{$type})) { |
my $newvalue; |
my ($newvalue,$notinuse); |
if (ref($defaultshash{$action}) eq 'HASH') { |
if (ref($defaultshash{$action}) eq 'HASH') { |
if (ref($defaultshash{$action}{$prefix})) { |
if (ref($defaultshash{$action}{$prefix})) { |
if (($prefix eq 'connto') || ($prefix eq 'connfrom')) { |
if (($prefix eq 'connto') || ($prefix eq 'connfrom')) { |
$newvalue = $titles{$defaultshash{$action}{$prefix}{$type}}; |
$newvalue = $titles{$defaultshash{$action}{$prefix}{$type}}; |
} elsif (ref($defaultshash{$action}{$prefix}{$type}) eq 'ARRAY') { |
} else { |
if (@{$defaultshash{$action}{$prefix}{$type}} > 0) { |
if (ref($defaultshash{$action}{$prefix}{$type}) eq 'ARRAY') { |
$newvalue = join(', ',@{$defaultshash{$action}{$prefix}{$type}}); |
if (@{$defaultshash{$action}{$prefix}{$type}} > 0) { |
|
$newvalue = join(', ',@{$defaultshash{$action}{$prefix}{$type}}); |
|
} |
|
} else { |
|
$notinuse = 1; |
} |
} |
} |
} |
} |
} |
if ($newvalue eq '') { |
if ($notinuse) { |
|
$resulttext .= '<li>'.&mt('[_1] set to: not in use',$titles{$type}).'</li>'; |
|
} elsif ($newvalue eq '') { |
$resulttext .= '<li>'.&mt('[_1] set to: none',$titles{$type}).'</li>'; |
$resulttext .= '<li>'.&mt('[_1] set to: none',$titles{$type}).'</li>'; |
} else { |
} else { |
$resulttext .= '<li>'.&mt('[_1] set to: [_2].',$titles{$type},$newvalue).'</li>'; |
$resulttext .= '<li>'.&mt('[_1] set to: [_2].',$titles{$type},$newvalue).'</li>'; |
Line 16958 sub modify_trust {
|
Line 17248 sub modify_trust {
|
$resulttext .= '<li>'.$lt{$prefix}.'<ul>'; |
$resulttext .= '<li>'.$lt{$prefix}.'<ul>'; |
foreach my $type (@types) { |
foreach my $type (@types) { |
if (defined($changes{$prefix}{$type})) { |
if (defined($changes{$prefix}{$type})) { |
my $newvalue; |
my ($newvalue,$notinuse); |
if (ref($defaultshash{'trust'}) eq 'HASH') { |
if (ref($defaultshash{'trust'}) eq 'HASH') { |
if (ref($defaultshash{'trust'}{$prefix})) { |
if (ref($defaultshash{'trust'}{$prefix})) { |
if (ref($defaultshash{'trust'}{$prefix}{$type}) eq 'ARRAY') { |
if (ref($defaultshash{'trust'}{$prefix}{$type}) eq 'ARRAY') { |
if (@{$defaultshash{'trust'}{$prefix}{$type}} > 0) { |
if (@{$defaultshash{'trust'}{$prefix}{$type}} > 0) { |
$newvalue = join(', ',@{$defaultshash{'trust'}{$prefix}{$type}}); |
$newvalue = join(', ',@{$defaultshash{'trust'}{$prefix}{$type}}); |
} |
} |
|
} else { |
|
$notinuse = 1; |
} |
} |
} |
} |
} |
} |
if ($newvalue eq '') { |
if ($notinuse) { |
|
$resulttext .= '<li>'.&mt('[_1] set to: not in use',$lt{$type}).'</li>'; |
|
} elsif ($newvalue eq '') { |
$resulttext .= '<li>'.&mt('[_1] set to: none',$lt{$type}).'</li>'; |
$resulttext .= '<li>'.&mt('[_1] set to: none',$lt{$type}).'</li>'; |
} else { |
} else { |
$resulttext .= '<li>'.&mt('[_1] set to: [_2].',$lt{$type},$newvalue).'</li>'; |
$resulttext .= '<li>'.&mt('[_1] set to: [_2].',$lt{$type},$newvalue).'</li>'; |
Line 17003 sub modify_loadbalancing {
|
Line 17297 sub modify_loadbalancing {
|
my @sparestypes = ('primary','default'); |
my @sparestypes = ('primary','default'); |
my %typetitles = &sparestype_titles(); |
my %typetitles = &sparestype_titles(); |
my $resulttext; |
my $resulttext; |
my (%currbalancer,%currtargets,%currrules,%existing); |
my (%currbalancer,%currtargets,%currrules,%existing,%currcookies); |
if (ref($domconfig{'loadbalancing'}) eq 'HASH') { |
if (ref($domconfig{'loadbalancing'}) eq 'HASH') { |
%existing = %{$domconfig{'loadbalancing'}}; |
%existing = %{$domconfig{'loadbalancing'}}; |
} |
} |
&get_loadbalancers_config(\%servers,\%existing,\%currbalancer, |
&get_loadbalancers_config(\%servers,\%existing,\%currbalancer, |
\%currtargets,\%currrules); |
\%currtargets,\%currrules,\%currcookies); |
my ($saveloadbalancing,%defaultshash,%changes); |
my ($saveloadbalancing,%defaultshash,%changes); |
my ($alltypes,$othertypes,$titles) = |
my ($alltypes,$othertypes,$titles) = |
&loadbalancing_titles($dom,$intdom,$usertypes,$types); |
&loadbalancing_titles($dom,$intdom,$usertypes,$types); |
Line 17060 sub modify_loadbalancing {
|
Line 17354 sub modify_loadbalancing {
|
} |
} |
$defaultshash{'loadbalancing'}{$balancer}{'targets'}{$sparetype} = \@offloadto; |
$defaultshash{'loadbalancing'}{$balancer}{'targets'}{$sparetype} = \@offloadto; |
} |
} |
|
if ($env{'form.loadbalancing_cookie_'.$i}) { |
|
$defaultshash{'loadbalancing'}{$balancer}{'cookie'} = 1; |
|
if (exists($currbalancer{$balancer})) { |
|
unless ($currcookies{$balancer}) { |
|
$changes{'curr'}{$balancer}{'cookie'} = 1; |
|
} |
|
} |
|
} elsif (exists($currbalancer{$balancer})) { |
|
if ($currcookies{$balancer}) { |
|
$changes{'curr'}{$balancer}{'cookie'} = 1; |
|
} |
|
} |
if (ref($currtargets{$balancer}) eq 'HASH') { |
if (ref($currtargets{$balancer}) eq 'HASH') { |
foreach my $sparetype (@sparestypes) { |
foreach my $sparetype (@sparestypes) { |
if (ref($currtargets{$balancer}{$sparetype}) eq 'ARRAY') { |
if (ref($currtargets{$balancer}{$sparetype}) eq 'ARRAY') { |
Line 17213 sub modify_loadbalancing {
|
Line 17519 sub modify_loadbalancing {
|
} |
} |
} |
} |
} |
} |
|
if ($changes{'curr'}{$balancer}{'cookie'}) { |
|
$resulttext .= '<li>'.&mt('Load Balancer: [_1] -- cookie use enabled', |
|
$balancer).'</li>'; |
|
} |
if (keys(%toupdate)) { |
if (keys(%toupdate)) { |
my %thismachine; |
my %thismachine; |
my $updatedhere; |
my $updatedhere; |
Line 17442 sub lonbalance_targets_js {
|
Line 17752 sub lonbalance_targets_js {
|
} |
} |
push(@alltypes,'default','_LC_adv','_LC_author','_LC_internetdom','_LC_external'); |
push(@alltypes,'default','_LC_adv','_LC_author','_LC_internetdom','_LC_external'); |
$allinsttypes = join("','",@alltypes); |
$allinsttypes = join("','",@alltypes); |
my (%currbalancer,%currtargets,%currrules,%existing); |
my (%currbalancer,%currtargets,%currrules,%existing,%currcookies); |
if (ref($settings) eq 'HASH') { |
if (ref($settings) eq 'HASH') { |
%existing = %{$settings}; |
%existing = %{$settings}; |
} |
} |
&get_loadbalancers_config($servers,\%existing,\%currbalancer, |
&get_loadbalancers_config($servers,\%existing,\%currbalancer, |
\%currtargets,\%currrules); |
\%currtargets,\%currrules,\%currcookies); |
my $balancers = join("','",sort(keys(%currbalancer))); |
my $balancers = join("','",sort(keys(%currbalancer))); |
return <<"END"; |
return <<"END"; |
|
|