version 1.160.6.69, 2016/08/12 19:49:56
|
version 1.160.6.70, 2016/09/16 23:53:01
|
Line 2899 sub print_coursedefaults {
|
Line 2899 sub print_coursedefaults {
|
usejsme => 'Molecule editor uses JSME (HTML5) in place of JME (Java)', |
usejsme => 'Molecule editor uses JSME (HTML5) in place of JME (Java)', |
postsubmit => 'Disable submit button/keypress following student submission', |
postsubmit => 'Disable submit button/keypress following student submission', |
canclone => "People who may clone a course (besides course's owner and coordinators)", |
canclone => "People who may clone a course (besides course's owner and coordinators)", |
|
mysqltables => 'Lifetime (s) of "Temporary" MySQL tables (student performance data) on homeserver', |
); |
); |
my %staticdefaults = ( |
my %staticdefaults = ( |
anonsurvey_threshold => 10, |
anonsurvey_threshold => 10, |
uploadquota => 500, |
uploadquota => 500, |
postsubmit => 60, |
postsubmit => 60, |
|
mysqltables => 172800, |
); |
); |
if ($position eq 'top') { |
if ($position eq 'top') { |
%defaultchecked = ( |
%defaultchecked = ( |
Line 2987 sub print_coursedefaults {
|
Line 2989 sub print_coursedefaults {
|
$itemcount ++; |
$itemcount ++; |
} else { |
} else { |
$css_class = $itemcount%2 ? ' class="LC_odd_row"' : ''; |
$css_class = $itemcount%2 ? ' class="LC_odd_row"' : ''; |
my ($currdefresponder,%defcredits,%curruploadquota,%deftimeout); |
my ($currdefresponder,%defcredits,%curruploadquota,%deftimeout,%currmysql)); |
my $currusecredits = 0; |
my $currusecredits = 0; |
my $postsubmitclient = 1; |
my $postsubmitclient = 1; |
my @types = ('official','unofficial','community','textbook'); |
my @types = ('official','unofficial','community','textbook'); |
Line 3031 sub print_coursedefaults {
|
Line 3033 sub print_coursedefaults {
|
$deftimeout{$type} = $staticdefaults{'postsubmit'}; |
$deftimeout{$type} = $staticdefaults{'postsubmit'}; |
} |
} |
} |
} |
|
if (ref($settings->{'mysqltables'}) eq 'HASH') { |
|
foreach my $type (keys(%{$settings->{'mysqltables'}})) { |
|
$currmysql{$type} = $settings->{'mysqltables'}{$type}; |
|
} |
|
} else { |
|
foreach my $type (@types) { |
|
$currmysql{$type} = $staticdefaults{'mysqltables'}; |
|
} |
|
} |
} else { |
} else { |
foreach my $type (@types) { |
foreach my $type (@types) { |
$deftimeout{$type} = $staticdefaults{'postsubmit'}; |
$deftimeout{$type} = $staticdefaults{'postsubmit'}; |
Line 3108 sub print_coursedefaults {
|
Line 3119 sub print_coursedefaults {
|
$additional .= '</tr></table></div>'."\n"; |
$additional .= '</tr></table></div>'."\n"; |
%defaultchecked = ('postsubmit' => 'on'); |
%defaultchecked = ('postsubmit' => 'on'); |
@toggles = ('postsubmit'); |
@toggles = ('postsubmit'); |
my $current = { |
$current = { |
'postsubmit' => $postsubmitclient, |
'postsubmit' => $postsubmitclient, |
}; |
}; |
($table,$itemcount) = |
($table,$itemcount) = |
&radiobutton_prefs($current,\@toggles,\%defaultchecked, |
&radiobutton_prefs($current,\@toggles,\%defaultchecked, |
\%choices,$itemcount,$onclick,$additional,'left'); |
\%choices,$itemcount,$onclick,$additional,'left'); |
$datatable .= $table; |
$datatable .= $table; |
|
$css_class = $itemcount%2 ? ' class="LC_odd_row"' : ''; |
|
$datatable .= '<tr'.$css_class.'><td><span class="LC_nobreak">'. |
|
$choices{'mysqltables'}. |
|
'</span></td>'. |
|
'<td align="right" class="LC_right_item">'. |
|
'<table><tr>'; |
|
foreach my $type (@types) { |
|
$datatable .= '<td align="center">'.&mt($type).'<br />'. |
|
'<input type="text" name="mysqltables_'.$type.'"'. |
|
' value="'.$currmysql{$type}.'" size="5" /></td>'; |
|
} |
|
$datatable .= '</tr></table></td></tr>'."\n"; |
|
$itemcount ++; |
|
|
} |
} |
$$rowtotal += $itemcount; |
$$rowtotal += $itemcount; |
return $datatable; |
return $datatable; |
Line 10400 sub modify_coursedefaults {
|
Line 10425 sub modify_coursedefaults {
|
); |
); |
my @toggles = ('uselcmath','usejsme'); |
my @toggles = ('uselcmath','usejsme'); |
my @numbers = ('anonsurvey_threshold','uploadquota_official','uploadquota_unofficial', |
my @numbers = ('anonsurvey_threshold','uploadquota_official','uploadquota_unofficial', |
'uploadquota_community','uploadquota_textbook'); |
'uploadquota_community','uploadquota_textbook','mysqltables_official', |
|
'mysqltables_unofficial','mysqltables_community','mysqltables_textbook'); |
my @types = ('official','unofficial','community','textbook'); |
my @types = ('official','unofficial','community','textbook'); |
my %staticdefaults = ( |
my %staticdefaults = ( |
anonsurvey_threshold => 10, |
anonsurvey_threshold => 10, |
uploadquota => 500, |
uploadquota => 500, |
postsubmit => 60, |
postsubmit => 60, |
|
mysqltables => 172800, |
); |
); |
|
|
$defaultshash{'coursedefaults'} = {}; |
$defaultshash{'coursedefaults'} = {}; |
Line 10446 sub modify_coursedefaults {
|
Line 10473 sub modify_coursedefaults {
|
} |
} |
$defaultshash{'coursedefaults'}{$item} = $newdef; |
$defaultshash{'coursedefaults'}{$item} = $newdef; |
} else { |
} else { |
my ($type) = ($item =~ /^\Quploadquota_\E(\w+)$/); |
my ($setting,$type) = ($item =~ /^(uploadquota|mysqltables)_(\w+)$/); |
if (ref($domconfig{'coursedefaults'}{'uploadquota'}) eq 'HASH') { |
if (ref($domconfig{'coursedefaults'}{$setting}) eq 'HASH') { |
$currdef = $domconfig{'coursedefaults'}{'uploadquota'}{$type}; |
$currdef = $domconfig{'coursedefaults'}{$setting}{$type}; |
} |
} |
$newdef =~ s/[^\w.\-]//g; |
$newdef =~ s/[^\w.\-]//g; |
$defaultshash{'coursedefaults'}{'uploadquota'}{$type} = $newdef; |
$defaultshash{'coursedefaults'}{$setting}{$type} = $newdef; |
} |
} |
if ($currdef ne $newdef) { |
if ($currdef ne $newdef) { |
my $staticdef; |
my $staticdef; |
Line 10459 sub modify_coursedefaults {
|
Line 10486 sub modify_coursedefaults {
|
unless (($currdef eq '') && ($newdef == $staticdefaults{$item})) { |
unless (($currdef eq '') && ($newdef == $staticdefaults{$item})) { |
$changes{$item} = 1; |
$changes{$item} = 1; |
} |
} |
} else { |
} elsif ($item =~ /^(uploadquota|mysqltables)_/) { |
unless (($currdef eq '') && ($newdef == $staticdefaults{'uploadquota'})) { |
my $setting = $1; |
$changes{'uploadquota'} = 1; |
unless (($currdef eq '') && ($newdef == $staticdefaults{$setting})) { |
|
$changes{$setting} = 1; |
} |
} |
} |
} |
} |
} |
Line 10586 sub modify_coursedefaults {
|
Line 10614 sub modify_coursedefaults {
|
my %domdefaults = &Apache::lonnet::get_domain_defaults($dom,1); |
my %domdefaults = &Apache::lonnet::get_domain_defaults($dom,1); |
if (($changes{'uploadquota'}) || ($changes{'postsubmit'}) || |
if (($changes{'uploadquota'}) || ($changes{'postsubmit'}) || |
($changes{'coursecredits'}) || ($changes{'uselcmath'}) || ($changes{'usejsme'}) || |
($changes{'coursecredits'}) || ($changes{'uselcmath'}) || ($changes{'usejsme'}) || |
($changes{'canclone'})) { |
($changes{'canclone'}) || ($changes{'mysqltables'})) { |
foreach my $item ('uselcmath','usejsme') { |
foreach my $item ('uselcmath','usejsme') { |
if ($changes{$item}) { |
if ($changes{$item}) { |
$domdefaults{$item}=$defaultshash{'coursedefaults'}{$item}; |
$domdefaults{$item}=$defaultshash{'coursedefaults'}{$item}; |
Line 10665 sub modify_coursedefaults {
|
Line 10693 sub modify_coursedefaults {
|
} else { |
} else { |
$resulttext .= '<li>'.&mt('Default quota for content uploaded via Course Editor remains default: [_1] MB',$staticdefaults{'uploadquota'}).'</li>'; |
$resulttext .= '<li>'.&mt('Default quota for content uploaded via Course Editor remains default: [_1] MB',$staticdefaults{'uploadquota'}).'</li>'; |
} |
} |
|
} elsif ($item eq 'mysqltables') { |
|
if (ref($defaultshash{'coursedefaults'}{'mysqltables'}) eq 'HASH') { |
|
$resulttext .= '<li>'.&mt('Lifetime of "Temporary" MySQL tables (student performance data) on homeserver').'<ul>'. |
|
'<li>'.&mt('Official courses: [_1] s','<b>'.$defaultshash{'coursedefaults'}{'mysqltables'}{'official'}.'</b>').'</li>'. |
|
'<li>'.&mt('Unofficial courses: [_1] s','<b>'.$defaultshash{'coursedefaults'}{'mysqltables'}{'unofficial'}.'</b>').'</li>'. |
|
'<li>'.&mt('Textbook courses: [_1] s','<b>'.$defaultshash{'coursedefaults'}{'mysqltables'}{'textbook'}.'</b>').'</li>'. |
|
'<li>'.&mt('Communities: [_1] s','<b>'.$defaultshash{'coursedefaults'}{'mysqltables'}{'community'}.'</b>').'</li>'. |
|
'</ul>'. |
|
'</li>'; |
|
} else { |
|
$resulttext .= '<li>'.&mt('Lifetime of "Temporary" MySQL tables (student performance data) on homeserver remains default: [_1] s',$staticdefaults{'uploadquota'}).'</li>'; |
|
} |
} elsif ($item eq 'postsubmit') { |
} elsif ($item eq 'postsubmit') { |
if ($domdefaults{'postsubmit'} eq 'off') { |
if ($domdefaults{'postsubmit'} eq 'off') { |
$resulttext .= '<li>'.&mt('Submit button(s) remain enabled on page after student makes submission.'); |
$resulttext .= '<li>'.&mt('Submit button(s) remain enabled on page after student makes submission.'); |