version 1.138, 2010/07/20 02:42:40
|
version 1.139, 2010/08/24 13:37:50
|
Line 340 sub handler {
|
Line 340 sub handler {
|
'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 in each course by a CC', |
col2 => 'Value',}], |
col2 => 'Value',}, |
|
{col1 => 'Defaults which can be overridden for each course by a DC', |
|
col2 => 'Value',},], |
}, |
}, |
'privacy' => |
'privacy' => |
{text => 'User Privacy', |
{text => 'User Privacy', |
Line 517 sub print_config_box {
|
Line 519 sub print_config_box {
|
$output .= &print_usersessions('top',$dom,$settings,\$rowtotal); |
$output .= &print_usersessions('top',$dom,$settings,\$rowtotal); |
} elsif ($action eq 'rolecolors') { |
} elsif ($action eq 'rolecolors') { |
$output .= &print_rolecolors($phase,'student',$dom,$confname,$settings,\$rowtotal); |
$output .= &print_rolecolors($phase,'student',$dom,$confname,$settings,\$rowtotal); |
|
} elsif ($action eq 'coursedefaults') { |
|
$output .= &print_coursedefaults('top',$dom,$settings,\$rowtotal); |
} |
} |
$output .= ' |
$output .= ' |
</table> |
</table> |
Line 580 sub print_config_box {
|
Line 584 sub print_config_box {
|
$output .= &print_helpsettings('bottom',$dom,$confname,$settings,\$rowtotal); |
$output .= &print_helpsettings('bottom',$dom,$confname,$settings,\$rowtotal); |
} elsif ($action eq 'usersessions') { |
} elsif ($action eq 'usersessions') { |
$output .= &print_usersessions('bottom',$dom,$settings,\$rowtotal); |
$output .= &print_usersessions('bottom',$dom,$settings,\$rowtotal); |
|
} elsif ($action eq 'coursedefaults') { |
|
$output .= &print_coursedefaults('bottom',$dom,$settings,\$rowtotal); |
} elsif ($action eq 'rolecolors') { |
} elsif ($action eq 'rolecolors') { |
$output .= &print_rolecolors($phase,'coordinator',$dom,$confname,$settings,\$rowtotal).' |
$output .= &print_rolecolors($phase,'coordinator',$dom,$confname,$settings,\$rowtotal).' |
</table> |
</table> |
Line 668 sub print_config_box {
|
Line 674 sub print_config_box {
|
$output .= &print_serverstatuses($dom,$settings,\$rowtotal); |
$output .= &print_serverstatuses($dom,$settings,\$rowtotal); |
} elsif ($action eq 'helpsettings') { |
} elsif ($action eq 'helpsettings') { |
$output .= &print_helpsettings('top',$dom,$confname,$settings,\$rowtotal); |
$output .= &print_helpsettings('top',$dom,$confname,$settings,\$rowtotal); |
} elsif ($action eq 'coursedefaults') { |
|
$output .= &print_coursedefaults($dom,$settings,\$rowtotal); |
|
} |
} |
} |
} |
$output .= ' |
$output .= ' |
Line 2240 sub radiobutton_prefs {
|
Line 2244 sub radiobutton_prefs {
|
} |
} |
|
|
sub print_coursedefaults { |
sub print_coursedefaults { |
my ($dom,$settings,$rowtotal) = @_; |
my ($position,$dom,$settings,$rowtotal) = @_; |
my ($css_class,$datatable); |
my ($css_class,$datatable); |
my $itemcount = 1; |
my $itemcount = 1; |
my (%checkedon,%checkedoff,%choices,%defaultchecked,@toggles); |
if ($position eq 'top') { |
%choices = |
my (%checkedon,%checkedoff,%choices,%defaultchecked,@toggles); |
&Apache::lonlocal::texthash ( |
%choices = |
canuse_pdfforms => 'Course/Community users can create/upload PDF forms', |
&Apache::lonlocal::texthash ( |
); |
canuse_pdfforms => 'Course/Community users can create/upload PDF forms', |
%defaultchecked = ('canuse_pdfforms' => 'off'); |
); |
@toggles = ('canuse_pdfforms',); |
%defaultchecked = ('canuse_pdfforms' => 'off'); |
($datatable,$itemcount) = &radiobutton_prefs($settings,\@toggles,\%defaultchecked, |
@toggles = ('canuse_pdfforms',); |
|
($datatable,$itemcount) = &radiobutton_prefs($settings,\@toggles,\%defaultchecked, |
\%choices,$itemcount); |
\%choices,$itemcount); |
$$rowtotal += $itemcount; |
$$rowtotal += $itemcount; |
|
} else { |
|
$css_class = $itemcount%2 ? ' class="LC_odd_row"' : ''; |
|
my %choices = |
|
&Apache::lonlocal::texthash ( |
|
anonsurvey_threshold => 'Responder count needed before showing submissions for anonymous surveys', |
|
); |
|
my $currdefresponder; |
|
if (ref($settings) eq 'HASH') { |
|
$currdefresponder = $settings->{'anonsurvey_threshold'}; |
|
} |
|
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>'; |
|
} |
return $datatable; |
return $datatable; |
} |
} |
|
|
Line 6664 sub modify_coursedefaults {
|
Line 6692 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 6683 sub modify_coursedefaults {
|
Line 6723 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 { |