version 1.123.2.1, 2009/12/07 01:47:49
|
version 1.123.2.2, 2010/09/12 22:12:52
|
Line 328 sub handler {
|
Line 328 sub handler {
|
{col1 => 'Unauthenticated Help Settings', |
{col1 => 'Unauthenticated Help Settings', |
col2 => ''}], |
col2 => ''}], |
}, |
}, |
'coursedefaults' => |
'coursedefaults' => |
{text => 'Course/Community defaults', |
{text => 'Course/Community defaults', |
help => 'Domain_Configuration_Course_Defaults', |
help => 'Domain_Configuration_Course_Defaults', |
header => [{col1 => 'Setting', |
header => [{col1 => 'Defaults which can be overridden for each course by a DC', |
col2 => 'Value',}], |
col2 => 'Value',}], |
}, |
}, |
'privacy' => |
'privacy' => |
Line 2092 sub print_coursedefaults {
|
Line 2092 sub print_coursedefaults {
|
my ($css_class,$datatable); |
my ($css_class,$datatable); |
my $itemcount = 1; |
my $itemcount = 1; |
my (%checkedon,%checkedoff,%choices,%defaultchecked,@toggles); |
my (%checkedon,%checkedoff,%choices,%defaultchecked,@toggles); |
%choices = |
$css_class = $itemcount%2 ? ' class="LC_odd_row"' : ''; |
|
my %choices = |
&Apache::lonlocal::texthash ( |
&Apache::lonlocal::texthash ( |
canuse_pdfforms => 'Course/Community users can create/upload PDF forms', |
anonsurvey_threshold => 'Responder count needed before showing submissions for anonymous surveys', |
); |
); |
%defaultchecked = ('canuse_pdfforms' => 'off'); |
my $currdefresponder; |
@toggles = ('canuse_pdfforms',); |
if (ref($settings) eq 'HASH') { |
($datatable,$itemcount) = &radiobutton_prefs($settings,\@toggles,\%defaultchecked, |
$currdefresponder = $settings->{'anonsurvey_threshold'}; |
\%choices,$itemcount); |
} |
|
if (!$currdefresponder) { |
|
$currdefresponder = 10; |
|
} elsif ($currdefresponder < 1) { |
|
$currdefresponder = 1; |
|
} |
|
$datatable .= |
|
'<tr'.$css_class.'><td><span class="LC_nobreak">'.$choices{'anonsurvey_threshold'}. |
|
'</span></td>'. |
|
'<td class="LC_right_item"><span class="LC_nobreak">'. |
|
'<input type="text" name="anonsurvey_threshold"'. |
|
' value="'.$currdefresponder.'" size="5" /></span>'. |
|
'</td></tr>'; |
$$rowtotal += $itemcount; |
$$rowtotal += $itemcount; |
return $datatable; |
return $datatable; |
} |
} |
Line 6107 sub modify_coursedefaults {
|
Line 6120 sub modify_coursedefaults {
|
} |
} |
$defaultshash{'coursedefaults'}{$item} = $env{'form.'.$item}; |
$defaultshash{'coursedefaults'}{$item} = $env{'form.'.$item}; |
} |
} |
|
my $currdefresponder = $domconfig{'coursedefaults'}{'anonsurvey_threshold'}; |
|
my $newdefresponder = $env{'form.anonsurvey_threshold'}; |
|
$newdefresponder =~ s/\D//g; |
|
if ($newdefresponder eq '' || $newdefresponder < 1) { |
|
$newdefresponder = 1; |
|
} |
|
$defaultshash{'coursedefaults'}{'anonsurvey_threshold'} = $newdefresponder; |
|
if ($currdefresponder ne $newdefresponder) { |
|
unless ($currdefresponder eq '' && $newdefresponder == 10) { |
|
$changes{'anonsurvey_threshold'} = 1; |
|
} |
|
} |
} |
} |
my $putresult = &Apache::lonnet::put_dom('configuration',\%defaultshash, |
my $putresult = &Apache::lonnet::put_dom('configuration',\%defaultshash, |
$dom); |
$dom); |
Line 6126 sub modify_coursedefaults {
|
Line 6151 sub modify_coursedefaults {
|
} else { |
} else { |
$resulttext .= '<li>'.&mt('Course/Community users can create/upload PDF forms set to "off"').'</li>'; |
$resulttext .= '<li>'.&mt('Course/Community users can create/upload PDF forms set to "off"').'</li>'; |
} |
} |
|
} elsif ($item eq 'anonsurvey_threshold') { |
|
$resulttext .= '<li>'.&mt('Responder count required for display of anonymous survey submissions set to [_1].',$defaultshash{'coursedefaults'}{'anonsurvey_threshold'}).'</li>'; |
} |
} |
|
|
} |
} |
$resulttext .= '</ul>'; |
$resulttext .= '</ul>'; |
} else { |
} else { |