version 1.126, 2023/09/02 12:51:32
|
version 1.133, 2025/01/07 16:19:19
|
Line 372 sub handler {
|
Line 372 sub handler {
|
|
|
my %values=&Apache::lonnet::dump('environment',$cdom,$cnum); |
my %values=&Apache::lonnet::dump('environment',$cdom,$cnum); |
my %linkprot=&Apache::lonnet::dump('lti',$cdom,$cnum,undef,undef,undef,1); |
my %linkprot=&Apache::lonnet::dump('lti',$cdom,$cnum,undef,undef,undef,1); |
|
my %domdefs = &Apache::lonnet::get_domain_defaults($cdom); |
|
unless ($phase eq 'process') { |
|
if (ref($domdefs{'linkprotsuggested'}) eq 'HASH') { |
|
$values{'suggested'} = $domdefs{'linkprotsuggested'}; |
|
} |
|
} |
my %ltienc = &Apache::lonnet::dump('nohist_ltienc',$cdom,$cnum,undef,undef,undef,1); |
my %ltienc = &Apache::lonnet::dump('nohist_ltienc',$cdom,$cnum,undef,undef,undef,1); |
my %ltitools = &Apache::lonnet::dump('ltitools',$cdom,$cnum,undef,undef,undef,1); |
my %ltitools = &Apache::lonnet::dump('ltitools',$cdom,$cnum,undef,undef,undef,1); |
my %ltitoolsenc = &Apache::lonnet::dump('nohist_toolsenc',$cdom,$cnum,undef,undef,undef,1); |
my %ltitoolsenc = &Apache::lonnet::dump('nohist_toolsenc',$cdom,$cnum,undef,undef,undef,1); |
Line 793 sub print_config_box {
|
Line 799 sub print_config_box {
|
<tr> |
<tr> |
<td> |
<td> |
<table class="LC_nested">'; |
<table class="LC_nested">'; |
|
if ($action eq 'linkprot') { |
|
if ((ref($settings) eq 'HASH') && (ref($settings->{'suggested'}) eq 'HASH')) { |
|
my $hints; |
|
my $hintcount = 0; |
|
foreach my $key (sort { $a <=> $b } keys(%{$settings->{'suggested'}})) { |
|
if ((ref($settings->{'suggested'}->{$key}) eq 'HASH')) { |
|
if (($settings->{'suggested'}->{$key}-{'name'} ne '') && |
|
($settings->{'suggested'}->{$key}-{'info'} ne '')) { |
|
my $css_class = $hintcount%2?' class="LC_odd_row"':' class="LC_even_row"'; |
|
$hints .= '<tr '.$css_class.'><td class="LC_left_item">'. |
|
$settings->{'suggested'}->{$key}->{'name'}.'</td>'. |
|
'<td class="LC_right_item"><pre>'. |
|
$settings->{'suggested'}->{$key}->{'info'}. |
|
'</pre></td></tr>'; |
|
$hintcount ++; |
|
} |
|
} |
|
} |
|
if ($hintcount) { |
|
$output .= '<tr class="LC_info_row">'. |
|
'<td colspan="2" class="LC_left_item">'.&mt('Recommendation(s) for specific launcher application(s)').'</td>'. |
|
'</tr>'."\n". |
|
'<tr class="LC_info_row">'. |
|
'<td class="LC_left_item"><span class="LC_nobreak">'.&mt('Launcher Application').'</span></td>'. |
|
'<td class="LC_right_item">'.&mt('Recommendation(s)').'</td></tr>'."\n". |
|
$hints; |
|
} |
|
} |
|
} |
if (exists $item->{'header'}->[0]->{'col1'} || |
if (exists $item->{'header'}->[0]->{'col1'} || |
exists $item->{'header'}->[0]->{'col2'}) { |
exists $item->{'header'}->[0]->{'col2'}) { |
$output .= ' |
$output .= ' |
<tr class="LC_info_row"> |
<tr class="LC_info_row"> |
<td class="LC_left_item" valign="top">'.&mt($item->{'header'}->[0]->{'col1'}).'</td>'; |
<td class="LC_left_item" valign="top">'.&mt($item->{'header'}->[0]->{'col1'}).'</td>'; |
if (($action eq 'courseinfo') || ($action eq 'localization') || |
if (($action eq 'courseinfo') || ($action eq 'localization') || |
Line 822 sub print_config_box {
|
Line 857 sub print_config_box {
|
} elsif ($action eq 'appearance') { |
} elsif ($action eq 'appearance') { |
$output .= &print_appearance($cdom,$settings,$ordered,$itemtext,\$rowtotal,$crstype,$noedit); |
$output .= &print_appearance($cdom,$settings,$ordered,$itemtext,\$rowtotal,$crstype,$noedit); |
} elsif ($action eq 'grading') { |
} elsif ($action eq 'grading') { |
$output .= &print_grading($cdom,$settings,$ordered,$itemtext,\$rowtotal,$crstype,$noedit); |
$output .= &print_grading($cdom,$cnum,$settings,$ordered,$itemtext,\$rowtotal,$crstype,$noedit); |
} elsif ($action eq 'printouts') { |
} elsif ($action eq 'printouts') { |
$output .= &print_printouts($cdom,$settings,$ordered,$itemtext,\$rowtotal,$crstype,$noedit); |
$output .= &print_printouts($cdom,$settings,$ordered,$itemtext,\$rowtotal,$crstype,$noedit); |
} elsif ($action eq 'spreadsheet') { |
} elsif ($action eq 'spreadsheet') { |
Line 1550 sub process_changes {
|
Line 1585 sub process_changes {
|
} elsif ($values->{$entry}) { |
} elsif ($values->{$entry}) { |
$changes->{$entry} = ''; |
$changes->{$entry} = ''; |
} |
} |
|
} elsif ($entry eq 'grading') { |
|
if ($env{'form.'.$entry} eq 'standard') { |
|
if ($env{'form.hidetotals'}) { |
|
my %sections = &Apache::loncommon::get_sections($cdom,$cnum); |
|
if (keys(%sections)) { |
|
my @secs = &Apache::loncommon::get_env_multiple('form.hidetotals_sections'); |
|
if (grep(/^all$/,@secs)) { |
|
$newvalues{'hidetotals'} = 'all'; |
|
} elsif (@secs) { |
|
$newvalues{'hidetotals'} = ''; |
|
foreach my $sec (sort {$a <=> $b} @secs) { |
|
if (exists($sections{$sec})) { |
|
$newvalues{'hidetotals'} .= $sec.',' |
|
} |
|
} |
|
$newvalues{'hidetotals'} =~ s/,$//; |
|
} |
|
} else { |
|
$newvalues{'hidetotals'} = 'all'; |
|
} |
|
} |
|
} |
|
if ($newvalues{'hidetotals'} ne $values->{'hidetotals'}) { |
|
$changes->{'hidetotals'} = $newvalues{'hidetotals'}; |
|
$changes->{'grading'} = $env{'form.'.$entry}; |
|
} |
|
$newvalues{$entry} = $env{'form.'.$entry}; |
} else { |
} else { |
$newvalues{$entry} = $env{'form.'.$entry}; |
$newvalues{$entry} = $env{'form.'.$entry}; |
} |
} |
Line 2631 sub store_changes {
|
Line 2693 sub store_changes {
|
unless (($key eq 'co-owners') || ($key eq 'discussion_post_fonts') || ($key eq 'extresource')) { |
unless (($key eq 'co-owners') || ($key eq 'discussion_post_fonts') || ($key eq 'extresource')) { |
$displayval = $changes->{$item}{$key}; |
$displayval = $changes->{$item}{$key}; |
} |
} |
|
if (($item eq 'grading') && ($key eq 'grading')) { |
|
if ($displayval eq 'standard') { |
|
my $hidetotals; |
|
if (exists($changes->{$item}{'hidetotals'})) { |
|
if ($changes->{$item}{'hidetotals'} eq '') { |
|
if (exists($values->{'hidetotals'})) { |
|
push(@delkeys,'hidetotals'); |
|
} |
|
} else { |
|
$hidetotals = $changes->{$item}{'hidetotals'}; |
|
} |
|
} elsif (exists($values->{'hidetotals'})) { |
|
$hidetotals = $values->{'hidetotals'}; |
|
} |
|
if ($hidetotals eq '') { |
|
$displayval = &mt('standard with "hide course totals" set to "No"'); |
|
if (exists($values->{'hidetotals'})) { |
|
push(@delkeys,'hidetotals'); |
|
} |
|
} elsif ($hidetotals =~ /^([\w,]+)$/) { |
|
my $secstr = $1; |
|
my @secs = split(/,/,$secstr); |
|
if (grep(/^all$/,@secs)) { |
|
$displayval = &mt('standard with "hide course totals" set to "Yes" for all users'); |
|
$hidetotals = 'all'; |
|
} else { |
|
$displayval = &mt('standard with "hide course totals" set to "Yes" for users in section(s): [_1]',join(', ',@secs)); |
|
} |
|
$storehash{'hidetotals'} = $hidetotals; |
|
} |
|
} elsif (exists($values->{'hidetotals'})) { |
|
push(@delkeys,'hidetotals'); |
|
} |
|
} |
if ($item eq 'feedback') { |
if ($item eq 'feedback') { |
if ($key =~ /^(question|policy|comment)(\.email)\.text$/) { |
if ($key =~ /^(question|policy|comment)(\.email)\.text$/) { |
$text = $prefs->{$item}->{'itemtext'}{$1.$2}; |
$text = $prefs->{$item}->{'itemtext'}{$1.$2}; |
Line 2639 sub store_changes {
|
Line 2735 sub store_changes {
|
$displayname = &mt('Recipients of '.$text.' questions'); |
$displayname = &mt('Recipients of '.$text.' questions'); |
} |
} |
} elsif ($item eq 'discussion') { |
} elsif ($item eq 'discussion') { |
if ($key =~ /^p(lc|ch)\.roles\.denied/) { |
if ($key =~ /^p(lc|ch|ac)\.roles\.denied/) { |
$displayname = &mt("$text (role-based)"); |
$displayname = &mt("$text (role-based)"); |
if ($displayval ne '') { |
if ($displayval ne '') { |
my @roles = split(',',$displayval); |
my @roles = split(',',$displayval); |
@roles = map { &Apache::lonnet::plaintext($_); } @roles; |
@roles = map { &Apache::lonnet::plaintext($_); } @roles; |
$displayval = join(', ',@roles); |
$displayval = join(', ',@roles); |
} |
} |
} elsif ($key =~ /^p(lc|ch)\.users\.denied/) { |
} elsif ($key =~ /^p(lc|ch|ac)\.users\.denied/) { |
$displayname = &mt("$text (specific user(s))"); |
$displayname = &mt("$text (specific user(s))"); |
} else { |
} else { |
if ($key eq 'allow_discussion_post_editing') { |
if ($key eq 'allow_discussion_post_editing') { |
Line 3224 sub store_ltitools {
|
Line 3320 sub store_ltitools {
|
} |
} |
} |
} |
} |
} |
$output .= '<li>'.&mt('Configurable in course:'); |
$output .= '<li>'; |
|
if ($context eq 'domain') { |
|
$output .= &mt('Configurable in course'); |
|
} else { |
|
$output .= &mt('Configurable for each instance of tool in course'); |
|
} |
|
$output .= ':'; |
my @possconfig = ('label','title','target','linktext','explanation','append'); |
my @possconfig = ('label','title','target','linktext','explanation','append'); |
my $numconfig = 0; |
my $numconfig = 0; |
if (ref($changes->{$itemid}{'crsconf'}) eq 'HASH') { |
if (ref($changes->{$itemid}{'crsconf'}) eq 'HASH') { |
Line 3591 function syllabusinfo() {
|
Line 3693 function syllabusinfo() {
|
} |
} |
} |
} |
ENDSCRIPT |
ENDSCRIPT |
my $menuitems_js; |
my ($menuitems_js,$grading_js); |
unless ($noedit) { |
unless ($noedit) { |
my $collections; |
my $collections; |
my $next = 1; |
my $next = 1; |
Line 3673 function toggleAddmenucoll() {
|
Line 3775 function toggleAddmenucoll() {
|
} |
} |
} |
} |
ENDSCRIPT |
ENDSCRIPT |
|
$grading_js = <<"ENDSCRIPT"; |
|
function toggleGrading(form) { |
|
if (document.getElementById('hidetotalsdiv')) { |
|
var totalsdivid = document.getElementById('hidetotalsdiv'); |
|
var selname = form.elements['grading']; |
|
if (selname) { |
|
var current = selname.options[selname.selectedIndex].value |
|
if (current == 'standard') { |
|
totalsdivid.style.display = 'inline-block'; |
|
} else { |
|
totalsdivid.style.display = 'none'; |
|
} |
|
} |
|
} |
|
return; |
|
} |
|
|
|
function toggleHiddenTotalsSec(form) { |
|
if (document.getElementById('sectotalsdiv')) { |
|
var sectotalsdivid = document.getElementById('sectotalsdiv'); |
|
var radioname = form.elements['hidetotals']; |
|
if (radioname) { |
|
if (radioname.length > 0) { |
|
var setvis; |
|
for (var i=0; i<radioname.length; i++) { |
|
if (radioname[i].checked == true) { |
|
if (radioname[i].value == 1) { |
|
sectotalsdivid.style.display = 'inline-block'; |
|
setvis = 1; |
|
} |
|
break; |
|
} |
|
} |
|
if (!setvis) { |
|
sectotalsdivid.style.display = 'none'; |
|
} |
|
} |
|
} |
|
} |
|
return; |
|
} |
|
ENDSCRIPT |
} |
} |
$extresource_js = <<"ENDSCRIPT"; |
$extresource_js = <<"ENDSCRIPT"; |
function toggleExtRes() { |
function toggleExtRes() { |
Line 3721 ENDSCRIPT
|
Line 3865 ENDSCRIPT
|
$browse_js."\n".$categorize_js."\n".$loncaparev_js."\n". |
$browse_js."\n".$categorize_js."\n".$loncaparev_js."\n". |
$cloners_js."\n".$instcode_js."\n".$localization_js."\n". |
$cloners_js."\n".$instcode_js."\n".$localization_js."\n". |
$syllabus_js."\n".$menuitems_js."\n".$extresource_js."\n". |
$syllabus_js."\n".$menuitems_js."\n".$extresource_js."\n". |
&linkprot_javascript()."\n".'//]]>'."\n". |
$grading_js."\n".&linkprot_javascript()."\n".'//]]>'."\n". |
'</script>'."\n".$stubrowse_js."\n".$ltitools_js."\n"; |
'</script>'."\n".$stubrowse_js."\n".$ltitools_js."\n"; |
return $jscript; |
return $jscript; |
} |
} |
Line 5154 sub update_releasereq {
|
Line 5298 sub update_releasereq {
|
} |
} |
$modified_courses = []; |
$modified_courses = []; |
} |
} |
undef($registered_cleanup); |
return OK; |
return; |
|
} |
} |
|
|
sub show_autocoowners { |
sub show_autocoowners { |
Line 5570 sub select_recipient {
|
Line 5713 sub select_recipient {
|
} |
} |
|
|
sub select_sections { |
sub select_sections { |
my ($item,$num,$sections,$selected,$noedit) = @_; |
my ($item,$num,$sections,$selected,$noedit,$allval) = @_; |
my ($output,@currsecs,$allsec,$disabled); |
my ($output,@currsecs,$allsec,$disabled); |
if (ref($selected) eq 'ARRAY') { |
if (ref($selected) eq 'ARRAY') { |
@currsecs = @{$selected}; |
@currsecs = @{$selected}; |
Line 5586 sub select_sections {
|
Line 5729 sub select_sections {
|
my $mult; |
my $mult; |
if (@{$sections} > 1) { |
if (@{$sections} > 1) { |
$mult = ' multiple="multiple"'; |
$mult = ' multiple="multiple"'; |
|
my $size; |
if (@{$sections} > 3) { |
if (@{$sections} > 3) { |
$mult .= ' size="4"'; |
$size = 4; |
|
} else { |
|
$size = 1 + scalar(@{$sections}); |
} |
} |
|
$mult .= ' size="'.$size.'"'; |
} |
} |
$output = '<select name="'.$item.'_sections_'.$num.'"'.$mult.$disabled.'>'. |
my $name = $item.'_sections'; |
' <option value=""'.$allsec.'>'.&mt('All').'</option>'; |
unless ($item eq 'hidetotals') { |
|
$name .= '_'.$num; |
|
} |
|
$output = '<select name="'.$name.'"'.$mult.$disabled.'>'. |
|
' <option value="'.$allval.'"'.$allsec.'>'.&mt('All').'</option>'; |
foreach my $sec (@{$sections}) { |
foreach my $sec (@{$sections}) { |
my $is_sel; |
my $is_sel; |
if ((@currsecs) && (grep(/^\Q$sec\E$/,@currsecs))) { |
if ((@currsecs) && (grep(/^\Q$sec\E$/,@currsecs))) { |
$is_sel = 'selected="selected"'; |
$is_sel = ' selected="selected"'; |
} |
} |
$output .= '<option value="'.$sec.'"'.$is_sel.'>'.$sec.'</option>'; |
$output .= '<option value="'.$sec.'"'.$is_sel.'>'.$sec.'</option>'; |
} |
} |
Line 6079 sub print_appearance {
|
Line 6230 sub print_appearance {
|
} |
} |
|
|
sub print_grading { |
sub print_grading { |
my ($cdom,$settings,$ordered,$itemtext,$rowtotal,$crstype,$noedit) = @_; |
my ($cdom,$cnum,$settings,$ordered,$itemtext,$rowtotal,$crstype,$noedit) = @_; |
unless ((ref($settings) eq 'HASH') && (ref($ordered) eq 'ARRAY') && (ref($itemtext) eq 'HASH')) { |
unless ((ref($settings) eq 'HASH') && (ref($ordered) eq 'ARRAY') && (ref($itemtext) eq 'HASH')) { |
return; |
return; |
} |
} |
Line 6099 sub print_grading {
|
Line 6250 sub print_grading {
|
}, |
}, |
'rndseed' => { |
'rndseed' => { |
text => '<b>'.&mt($itemtext->{'rndseed'}).'</b>'. |
text => '<b>'.&mt($itemtext->{'rndseed'}).'</b>'. |
'<span class="LC_warning">'.'<br />'. |
'<br /><span class="LC_warning LC_nobreak">'. |
&mt('Modifying this will make problems have different numbers and answers!'). |
&mt('Modifying this will make problems have different numbers and answers!'). |
'</span>', |
'</span>', |
input => 'selectbox', |
input => 'selectbox', |
Line 6131 sub print_grading {
|
Line 6282 sub print_grading {
|
input => 'radio', |
input => 'radio', |
}, |
}, |
); |
); |
return &make_item_rows($cdom,\%items,$ordered,$settings,$rowtotal,$crstype,'grading',$noedit); |
return &make_item_rows($cdom,\%items,$ordered,$settings,$rowtotal,$crstype,'grading',$noedit,$cnum); |
} |
} |
|
|
sub print_printouts { |
sub print_printouts { |
Line 6598 sub print_ltitools {
|
Line 6749 sub print_ltitools {
|
%courseconfig = %{$settings->{$item}->{'crsconf'}}; |
%courseconfig = %{$settings->{$item}->{'crsconf'}}; |
} |
} |
} |
} |
$datatable .= '<fieldset><legend>'.&mt('Configurable in course').'</legend><span class="LC_nobreak">'; |
$datatable .= '<fieldset><legend>'; |
|
if ($context eq 'domain') { |
|
$datatable .= &mt('Configurable in course'); |
|
} else { |
|
$datatable .= &mt('Configurable for each instance of tool in course'); |
|
} |
|
$datatable .= '</legend><span class="LC_nobreak">'; |
foreach my $item ('label','title','target','linktext','explanation','append') { |
foreach my $item ('label','title','target','linktext','explanation','append') { |
my $checked; |
my $checked; |
if ($courseconfig{$item}) { |
if ($courseconfig{$item}) { |
Line 6756 sub print_ltitools {
|
Line 6913 sub print_ltitools {
|
$datatable .= '</select></td>'; |
$datatable .= '</select></td>'; |
} |
} |
$datatable .= '</tr></table></fieldset>'. |
$datatable .= '</tr></table></fieldset>'. |
'<fieldset><legend>'.&mt('Configurable in course').'</legend><span class="LC_nobreak">'; |
'<fieldset><legend>'; |
|
if ($context eq 'domain') { |
|
$datatable .= &mt('Configurable in course'); |
|
} else { |
|
$datatable .= &mt('Configurable for each instance of tool in course'); |
|
} |
|
$datatable .= '</legend><span class="LC_nobreak">'; |
foreach my $item ('label','title','target','linktext','explanation','append') { |
foreach my $item ('label','title','target','linktext','explanation','append') { |
$datatable .= '<label>'. |
$datatable .= '<label>'. |
'<input type="checkbox" name="ltitools_add_courseconfig" value="'.$item.'" checked="checked" />'. |
'<input type="checkbox" name="ltitools_add_courseconfig" value="'.$item.'" checked="checked" />'. |
Line 7090 sub menuitems_categories {
|
Line 7253 sub menuitems_categories {
|
shown => ['top','inline','foot','main'], |
shown => ['top','inline','foot','main'], |
text => ['name','role','crs','disc','fdbk'], |
text => ['name','role','crs','disc','fdbk'], |
links => ['pers','logo','menu','comm','roles','help','logout'], |
links => ['pers','logo','menu','comm','roles','help','logout'], |
list => ['about','prefs','port','wish','anno','rss'], |
list => ['about','prefs','port','wish','anno','rss','srch','brse'], |
inline => ['cont','grades','chat','people','groups','resv','syll','feeds'], |
inline => ['cont','grades','chat','people','groups','resv','syll','feeds'], |
); |
); |
return (\@order,\%categories); |
return (\@order,\%categories); |
Line 7130 sub menuitems_fields {
|
Line 7293 sub menuitems_fields {
|
wish => 'Stored Links', |
wish => 'Stored Links', |
anno => 'Calendar', |
anno => 'Calendar', |
rss => 'RSS Feeds', |
rss => 'RSS Feeds', |
|
srch => 'Search Library', |
|
brse => 'Browse Library', |
cont => 'Contents', |
cont => 'Contents', |
grades => 'Grades', |
grades => 'Grades', |
chat => 'Chat', |
chat => 'Chat', |
Line 7401 sub print_linkprotection {
|
Line 7566 sub print_linkprotection {
|
$onclickreturnurl.$checkedreturnurl{'no'}.$disabled.' />'.&mt('No').'</label> '. |
$onclickreturnurl.$checkedreturnurl{'no'}.$disabled.' />'.&mt('No').'</label> '. |
'<label><input type="radio" name="linkprot_returnurl_'.$i.'" value="1"'. |
'<label><input type="radio" name="linkprot_returnurl_'.$i.'" value="1"'. |
$onclickreturnurl.$checkedreturnurl{'yes'}.$disabled.' />'.&mt('Yes').'</label></span>'. |
$onclickreturnurl.$checkedreturnurl{'yes'}.$disabled.' />'.&mt('Yes').'</label></span>'. |
' </span><div id="linkprot_divurlparam_'.$i.'" style="display:none" />'. |
' <div id="linkprot_divurlparam_'.$i.'" style="display:none">'. |
'<span class="LC_nobreak">'.&mt('Parameter name').':'. |
'<span class="LC_nobreak">'.&mt('Parameter name').':'. |
'<input type="text" size="15" name="linkprot_urlparam_'.$i.'" value="'.$values{'returnurl'}.'" autocomplete="off"'.$disabled.' />'. |
'<input type="text" size="15" name="linkprot_urlparam_'.$i.'" value="'.$values{'returnurl'}.'" autocomplete="off"'.$disabled.' />'. |
'</span></div> '; |
'</span></div> '; |
Line 7473 sub print_linkprotection {
|
Line 7638 sub print_linkprotection {
|
$onclickpassback.$checkedpassback{'no'}.$disabled.' />'.&mt('No').'</label> '. |
$onclickpassback.$checkedpassback{'no'}.$disabled.' />'.&mt('No').'</label> '. |
'<label><input type="radio" name="linkprot_passback_add" value="1"'. |
'<label><input type="radio" name="linkprot_passback_add" value="1"'. |
$onclickpassback.$checkedpassback{'yes'}.$disabled.' />'.&mt('Yes').'</label></span>'. |
$onclickpassback.$checkedpassback{'yes'}.$disabled.' />'.&mt('Yes').'</label></span>'. |
'<br /><div id="linkprot_passbackparam_add" class="LC_floatleft" style="display:none" />'. |
'<br /><div id="linkprot_passbackparam_add" class="LC_floatleft" style="display:none">'. |
'<span class="LC_nobreak">'.&mt('Grade format'). |
'<span class="LC_nobreak">'.&mt('Grade format'). |
'<label><input type="radio" name="linkprot_passbackformat_add" value="1.1"'.$checkedpassbackfmt{'1p1'}.$disabled.' />'. |
'<label><input type="radio" name="linkprot_passbackformat_add" value="1.1"'.$checkedpassbackfmt{'1p1'}.$disabled.' />'. |
&mt('Outcomes Service (1.1)').'</label>'.(' 'x2). |
&mt('Outcomes Service (1.1)').'</label>'.(' 'x2). |
Line 7486 sub print_linkprotection {
|
Line 7651 sub print_linkprotection {
|
$onclickreturnurl.$checkedreturnurl{'no'}.$disabled.' />'.&mt('No').'</label> '. |
$onclickreturnurl.$checkedreturnurl{'no'}.$disabled.' />'.&mt('No').'</label> '. |
'<label><input type="radio" name="linkprot_returnurl_add" value="1"'. |
'<label><input type="radio" name="linkprot_returnurl_add" value="1"'. |
$onclickreturnurl.$checkedreturnurl{'yes'}.$disabled.' />'.&mt('Yes').'</label></span>'. |
$onclickreturnurl.$checkedreturnurl{'yes'}.$disabled.' />'.&mt('Yes').'</label></span>'. |
' </span><div id="linkprot_divurlparam_add" style="display:none" />'. |
' <div id="linkprot_divurlparam_add" style="display:none">'. |
'<span class="LC_nobreak">'.&mt('Parameter name').':'. |
'<span class="LC_nobreak">'.&mt('Parameter name').':'. |
'<input type="text" size="15" name="linkprot_urlparam_add" value="" autocomplete="off"'.$disabled.' />'. |
'<input type="text" size="15" name="linkprot_urlparam_add" value="" autocomplete="off"'.$disabled.' />'. |
'</span></div> '; |
'</span></div> '; |
Line 7710 sub item_table_row_end {
|
Line 7875 sub item_table_row_end {
|
} |
} |
|
|
sub yesno_radio { |
sub yesno_radio { |
my ($item,$settings,$unsetdefault,$valueyes,$valueno,$noedit) = @_; |
my ($item,$settings,$unsetdefault,$valueyes,$valueno,$noedit,$onclick,$reverse) = @_; |
my $itemon = ' '; |
my $itemon = ' '; |
my $itemoff = ' checked="checked" '; |
my $itemoff = ' checked="checked" '; |
if (($valueyes eq '') && ($valueno eq '')) { |
if (($valueyes eq '') && ($valueno eq '')) { |
Line 7732 sub yesno_radio {
|
Line 7897 sub yesno_radio {
|
my $disabled; |
my $disabled; |
if ($noedit) { |
if ($noedit) { |
$disabled = ' disabled="disabled"'; |
$disabled = ' disabled="disabled"'; |
|
} elsif ($onclick) { |
|
$onclick = ' onclick="'.$onclick.'"'; |
|
} |
|
if ($reverse) { |
|
return '<span class="LC_nobreak"><label>'. |
|
'<input type="radio" name="'.$item.'"'. |
|
$itemoff.' value="'.$valueno.'"'.$disabled.$onclick.' />'.&mt('No').'</label> '. |
|
'<label><input type="radio" name="'.$item.'"'. |
|
$itemon.' value="'.$valueyes.'"'.$disabled.$onclick.' />'.&mt('Yes').'</label></span>'; |
|
} else { |
|
return '<span class="LC_nobreak"><label>'. |
|
'<input type="radio" name="'.$item.'"'. |
|
$itemon.' value="'.$valueyes.'"'.$disabled.$onclick.' />'.&mt('Yes').'</label> '. |
|
'<label><input type="radio" name="'.$item.'"'. |
|
$itemoff.' value="'.$valueno.'"'.$disabled.$onclick.' />'.&mt('No').'</label></span>'; |
} |
} |
return '<span class="LC_nobreak"><label>'. |
|
'<input type="radio" name="'.$item.'"'. |
|
$itemon.' value="'.$valueyes.'"'.$disabled.' />'.&mt('Yes').'</label> '. |
|
'<label><input type="radio" name="'.$item.'"'. |
|
$itemoff.' value="'.$valueno.'"'.$disabled.' />'.&mt('No').'</label></span>'; |
|
} |
} |
|
|
sub select_from_options { |
sub select_from_options { |
Line 7793 sub select_from_options {
|
Line 7968 sub select_from_options {
|
} |
} |
|
|
sub make_item_rows { |
sub make_item_rows { |
my ($cdom,$items,$ordered,$settings,$rowtotal,$crstype,$caller,$noedit) = @_; |
my ($cdom,$items,$ordered,$settings,$rowtotal,$crstype,$caller,$noedit,$cnum) = @_; |
my $datatable; |
my $datatable; |
if ((ref($items) eq 'HASH') && (ref($ordered) eq 'ARRAY')) { |
if ((ref($items) eq 'HASH') && (ref($ordered) eq 'ARRAY')) { |
my $count = 0; |
my $count = 0; |
Line 7856 sub make_item_rows {
|
Line 8031 sub make_item_rows {
|
} |
} |
$datatable .= &yesno_radio($item,$settings,$unsetdefault,$valueyes,$valueno,$noedit); |
$datatable .= &yesno_radio($item,$settings,$unsetdefault,$valueyes,$valueno,$noedit); |
} elsif ($items->{$item}{input} eq 'selectbox') { |
} elsif ($items->{$item}{input} eq 'selectbox') { |
my $id; |
my ($id,$onchange); |
if ($caller eq 'menuitems') { |
if ($caller eq 'menuitems') { |
$id = $item; |
$id = $item; |
|
} elsif ($caller eq 'grading') { |
|
if ($item eq 'grading') { |
|
$onchange = ' onchange="javascript:toggleGrading(this.form);"'; |
|
$id = $item; |
|
} |
} |
} |
my $curr = $settings->{$item}; |
my $curr = $settings->{$item}; |
$datatable .= |
$datatable .= |
&select_from_options($item,$items->{$item}{'order'}, |
&select_from_options($item,$items->{$item}{'order'}, |
$items->{$item}{'options'},$curr, |
$items->{$item}{'options'},$curr, |
$items->{$item}{'nullval'}, |
$items->{$item}{'nullval'}, |
undef,undef,undef,$noedit,$id); |
undef,undef,$onchange,$noedit,$id); |
|
if ($item eq 'grading') { |
|
my ($unsetdefault,$valueyes,$valueno,$sectionbox); |
|
my $gradingsty = 'none'; |
|
my $gradingsecsty = 'none'; |
|
$unsetdefault = 0; |
|
my (@selsec,@sections,%current); |
|
if ($curr eq 'standard') { |
|
$gradingsty = 'inline-block'; |
|
if (ref($settings) eq 'HASH') { |
|
$current{'hidetotals'} = $settings->{'hidetotals'}; |
|
if ($settings->{'hidetotals'} =~ /^([\w,]+)$/) { |
|
my $secstr = $1; |
|
unless ($secstr eq 'all') { |
|
@selsec = split(/,/,$secstr); |
|
} |
|
$current{'hidetotals'} = 1; |
|
} |
|
} |
|
} |
|
$valueyes = "1"; |
|
$valueno = "0"; |
|
my %sections = &Apache::loncommon::get_sections($cdom,$cnum); |
|
if (keys(%sections)) { |
|
@sections = sort( { $a <=> $b } keys(%sections)); |
|
} |
|
my $onclick = 'javascript:toggleHiddenTotalsSec(this.form);'; |
|
my $sectionbox = '<div id="sectotalsdiv" style="display:'.$gradingsecsty.'; float:right">'; |
|
my $reverse = 1; |
|
if (@sections) { |
|
$sectionbox .= ' ... '.&mt('hidden in sections').': '. |
|
'<div style="position: relative; top: 0%;">'. |
|
&select_sections('hidetotals','',\@sections,\@selsec,$noedit,'all'). |
|
'</div>'; |
|
} |
|
$sectionbox .= '</div>'; |
|
$datatable .= '<fieldset id="hidetotalsdiv" style="display:'.$gradingsty.';">'. |
|
'<legend style="font-weight: normal;">'. |
|
&mt('Hide Course Points Totals').'</legend>'. |
|
'<div style="position: relative; top: 0%; float:left">'. |
|
&yesno_radio('hidetotals',\%current,$unsetdefault,$valueyes,$valueno,$noedit, |
|
$onclick,$reverse).'</div>'. |
|
$sectionbox. |
|
'</fieldset><div style="padding:0;clear:both;margin:0;border:0"></div>'; |
|
} |
} elsif ($items->{$item}{input} eq 'textbox') { |
} elsif ($items->{$item}{input} eq 'textbox') { |
my $disabled; |
my $disabled; |
if ($noedit) { |
if ($noedit) { |