version 1.336, 2018/07/26 14:59:48
|
version 1.337, 2018/08/14 21:42:39
|
Line 2817 sub lti_toggle_js {
|
Line 2817 sub lti_toggle_js {
|
// <![CDATA[ |
// <![CDATA[ |
|
|
function toggleLTI(form,setting,item) { |
function toggleLTI(form,setting,item) { |
if ((setting == 'user') || (setting == 'crs')) { |
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 { |
} else if (settings == 'crs') { |
radioname = 'lti_mapcrs_'+item; |
radioname = 'lti_mapcrs_'+item; |
divid = 'lti_crsfield_'+item; |
divid = 'lti_crsfield_'+item; |
|
} else { |
|
radioname = 'lti_passbackformat_'+item; |
|
divid = 'lti_passback_'+item; |
} |
} |
var num = form.elements[radioname].length; |
var num = form.elements[radioname].length; |
if (num) { |
if (num) { |
var setvis = ''; |
var setvis = ''; |
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 == 'other') { |
if (setting == 'passback') { |
if (document.getElementById(divid)) { |
if (form.elements[radioname][i].value == '1') { |
document.getElementById(divid).style.display = 'inline-block'; |
if (document.getElementById(divid)) { |
|
document.getElementById(divid).style.display = 'inline-block'; |
|
} |
|
setvis = 1; |
|
break; |
|
} |
|
} else { |
|
if (form.elements[radioname][i].value == 'other') { |
|
if (document.getElementById(divid)) { |
|
document.getElementById(divid).style.display = 'inline-block'; |
|
} |
|
setvis = 1; |
|
break; |
} |
} |
setvis = 1; |
|
break; |
|
} |
} |
} |
} |
} |
} |
Line 4751 sub lti_options {
|
Line 4764 sub lti_options {
|
my $crsfieldsty = 'none'; |
my $crsfieldsty = 'none'; |
my $crssecfieldsty = 'none'; |
my $crssecfieldsty = 'none'; |
my $secsrcfieldsty = 'none'; |
my $secsrcfieldsty = 'none'; |
|
my $passbacksty = 'none'; |
my $lcauthparm; |
my $lcauthparm; |
my $lcauthparmstyle = 'display:none'; |
my $lcauthparmstyle = 'display:none'; |
my $lcauthparmtext; |
my $lcauthparmtext; |
Line 4991 sub lti_options {
|
Line 5005 sub lti_options {
|
$checked{'crssecsrc'}{'other'}.$onclicksecsrc.' />'.&mt('Other'). |
$checked{'crssecsrc'}{'other'}.$onclicksecsrc.' />'.&mt('Other'). |
'</label></span></div><div class="LC_floatleft" style="display:'.$secsrcfieldsty.';" id="lti_secsrcfield_'.$num.'">'. |
'</label></span></div><div class="LC_floatleft" style="display:'.$secsrcfieldsty.';" id="lti_secsrcfield_'.$num.'">'. |
'<input type="text" name="lti_customsection_'.$num.'" value="'.$crssecsrc.'" />'. |
'<input type="text" name="lti_customsection_'.$num.'" value="'.$crssecsrc.'" />'. |
'</div><div style="padding:0;clear:both;margin:0;border:0"></div>'; |
'</div><div style="padding:0;clear:both;margin:0;border:0"></div>'; |
foreach my $extra ('passback','roster') { |
my ($pb1p1chk,$pb1p0chk,$onclickpb); |
|
foreach my $extra ('roster','passback') { |
my $checkedon = ''; |
my $checkedon = ''; |
my $checkedoff = ' checked="checked"'; |
my $checkedoff = ' checked="checked"'; |
|
if ($extra eq 'passback') { |
|
$pb1p1chk = ' checked="checked"'; |
|
$pb1p0chk = ''; |
|
$onclickpb = ' onclick="toggleLTI(this.form,'."'passback','$num'".');"'; |
|
} else { |
|
$onclickpb = ''; |
|
} |
if (ref($current) eq 'HASH') { |
if (ref($current) eq 'HASH') { |
if (($current->{$extra})) { |
if (($current->{$extra})) { |
$checkedon = $checkedoff; |
$checkedon = $checkedoff; |
$checkedoff = ''; |
$checkedoff = ''; |
|
if ($extra eq 'passback') { |
|
$passbacksty = 'inline-block'; |
|
} |
|
if ($current->{'passbackformat'} eq '1.0') { |
|
$pb1p0chk = ' checked="checked"'; |
|
$pb1p1chk = ''; |
|
} |
} |
} |
} |
} |
$output .= $lt{$extra}.' '. |
$output .= $lt{$extra}.' '. |
'<label><input type="radio" name="lti_'.$extra.'_'.$num.'" value="0"'.$checkedoff.' />'. |
'<label><input type="radio" name="lti_'.$extra.'_'.$num.'" value="0"'.$checkedoff.$onclickpb.' />'. |
&mt('No').'</label>'.(' 'x2). |
&mt('No').'</label>'.(' 'x2). |
'<label><input type="radio" name="lti_'.$extra.'_'.$num.'" value="1"'.$checkedon.' />'. |
'<label><input type="radio" name="lti_'.$extra.'_'.$num.'" value="1"'.$checkedon.$onclickpb' />'. |
&mt('Yes').'</label><br />'; |
&mt('Yes').'</label><br />'; |
} |
} |
$output .= '</fieldset>'. |
$output .= '<div class="LC_floatleft" style="display:'.$passbacksty.';" id="lti_passback_'.$num.'">'. |
|
'<span class="LC_nobreak">'.&mt('Grade format'). |
|
'<label><input type="radio" name="lti_passbackformat_'.$num.'" value="1.1"'.$pb1p1chk.' />'. |
|
&mt('Outcomes Service (1.1)').'</label>'.(' 'x2). |
|
'<label><input type="radio" name="lti_passbackformat_'.$num.'" value="1.0"'.$pb1p0chk.'/>'. |
|
&mt('Outcomes Extension (1.0)').'</label></span></div></fieldset>'. |
'<fieldset><legend>'.&mt('Course defaults (Course Coordinator can override)').'</legend>'. |
'<fieldset><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"'. |
Line 11714 sub modify_lti {
|
Line 11748 sub modify_lti {
|
$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 11733 sub modify_lti {
|
Line 11773 sub modify_lti {
|
$changes{$itemid} = 1; |
$changes{$itemid} = 1; |
} |
} |
} |
} |
|
unless ($changes{$itemid}) { |
|
if ($domconfig{$action}{$itemid}{'passback'} eq $confhash{$itemid}{'passback'}) { |
|
if ($domconfig{$action}{$itemid}{'passbackformat'} ne $confhash{$itemid}{'passbackformat'}) { |
|
$changes{$itemid} = 1; |
|
} |
|
} |
|
} |
foreach my $field ('makeuser','mapcrstype','selfenroll','instdata','lcmenu') { |
foreach my $field ('makeuser','mapcrstype','selfenroll','instdata','lcmenu') { |
unless ($changes{$itemid}) { |
unless ($changes{$itemid}) { |
if (ref($domconfig{$action}{$itemid}{$field}) eq 'ARRAY') { |
if (ref($domconfig{$action}{$itemid}{$field}) eq 'ARRAY') { |
Line 11949 sub modify_lti {
|
Line 11996 sub modify_lti {
|
$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'); |
} |
} |