version 1.160.6.56, 2015/03/11 15:56:36
|
version 1.160.6.57, 2015/03/11 17:15:40
|
Line 414 sub handler {
|
Line 414 sub handler {
|
'coursedefaults' => |
'coursedefaults' => |
{text => 'Course/Community defaults', |
{text => 'Course/Community defaults', |
help => 'Domain_Configuration_Course_Defaults', |
help => 'Domain_Configuration_Course_Defaults', |
header => [{col1 => 'Defaults which can be overridden for each course by a DC', |
header => [{col1 => 'Defaults which can be overridden in each course by a CC', |
|
col2 => 'Value',}, |
|
{col1 => 'Defaults which can be overridden for each course by a DC', |
col2 => 'Value',},], |
col2 => 'Value',},], |
print => \&print_coursedefaults, |
print => \&print_coursedefaults, |
modify => \&modify_coursedefaults, |
modify => \&modify_coursedefaults, |
Line 670 sub print_config_box {
|
Line 672 sub print_config_box {
|
</tr>'; |
</tr>'; |
$rowtotal ++; |
$rowtotal ++; |
if (($action eq 'autoupdate') || ($action eq 'usercreation') || ($action eq 'selfcreation') || |
if (($action eq 'autoupdate') || ($action eq 'usercreation') || ($action eq 'selfcreation') || |
($action eq 'usermodification') || ($action eq 'defaults') || |
($action eq 'usermodification') || ($action eq 'defaults') || ($action eq 'coursedefaults') || |
($action eq 'selfenrollment') || ($action eq 'usersessions')) { |
($action eq 'selfenrollment') || ($action eq 'usersessions')) { |
$output .= $item->{'print'}->('top',$dom,$settings,\$rowtotal); |
$output .= $item->{'print'}->('top',$dom,$settings,\$rowtotal); |
} elsif ($action eq 'coursecategories') { |
} elsif ($action eq 'coursecategories') { |
Line 725 sub print_config_box {
|
Line 727 sub print_config_box {
|
$output .= $item->{'print'}->('bottom',$dom,$settings,\$rowtotal); |
$output .= $item->{'print'}->('bottom',$dom,$settings,\$rowtotal); |
} |
} |
$rowtotal ++; |
$rowtotal ++; |
} elsif (($action eq 'usermodification') || ($action eq 'defaults')) { |
} elsif (($action eq 'usermodification') || ($action eq 'coursedefaults') || |
|
($action eq 'defaults')) { |
$output .= $item->{'print'}->('bottom',$dom,$settings,\$rowtotal); |
$output .= $item->{'print'}->('bottom',$dom,$settings,\$rowtotal); |
} elsif ($action eq 'login') { |
} elsif ($action eq 'login') { |
if ($numheaders == 4) { |
if ($numheaders == 4) { |
Line 2825 sub print_helpsettings {
|
Line 2828 sub print_helpsettings {
|
|
|
sub radiobutton_prefs { |
sub radiobutton_prefs { |
my ($settings,$toggles,$defaultchecked,$choices,$itemcount,$onclick, |
my ($settings,$toggles,$defaultchecked,$choices,$itemcount,$onclick, |
$additional) = @_; |
$additional,$align) = @_; |
return unless ((ref($toggles) eq 'ARRAY') && (ref($defaultchecked) eq 'HASH') && |
return unless ((ref($toggles) eq 'ARRAY') && (ref($defaultchecked) eq 'HASH') && |
(ref($choices) eq 'HASH')); |
(ref($choices) eq 'HASH')); |
|
|
Line 2859 sub radiobutton_prefs {
|
Line 2862 sub radiobutton_prefs {
|
$datatable .= |
$datatable .= |
'<tr'.$css_class.'><td valign="top">'. |
'<tr'.$css_class.'><td valign="top">'. |
'<span class="LC_nobreak">'.$choices->{$item}. |
'<span class="LC_nobreak">'.$choices->{$item}. |
'</span></td>'. |
'</span></td>'; |
'<td class="LC_right_item"><span class="LC_nobreak">'. |
if ($align eq 'left') { |
|
$datatable .= '<td class="LC_left_item">'; |
|
} else { |
|
$datatable .= '<td class="LC_right_item">'; |
|
} |
|
$datatable .= |
|
'<span class="LC_nobreak">'. |
'<label><input type="radio" name="'. |
'<label><input type="radio" name="'. |
$item.'" '.$checkedon{$item}.' value="1"'.$onclick.' />'.&mt('Yes'). |
$item.'" '.$checkedon{$item}.' value="1"'.$onclick.' />'.&mt('Yes'). |
'</label> <label><input type="radio" name="'.$item.'" '. |
'</label> <label><input type="radio" name="'.$item.'" '. |
Line 2878 sub print_coursedefaults {
|
Line 2887 sub print_coursedefaults {
|
my ($css_class,$datatable,%checkedon,%checkedoff,%defaultchecked,@toggles); |
my ($css_class,$datatable,%checkedon,%checkedoff,%defaultchecked,@toggles); |
my $itemcount = 1; |
my $itemcount = 1; |
my %choices = &Apache::lonlocal::texthash ( |
my %choices = &Apache::lonlocal::texthash ( |
canuse_pdfforms => 'Course/Community users can create/upload PDF forms', |
|
uploadquota => 'Default quota for files uploaded directly to course/community using Course Editor (MB)', |
uploadquota => 'Default quota for files uploaded directly to course/community using Course Editor (MB)', |
anonsurvey_threshold => 'Responder count needed before showing submissions for anonymous surveys', |
anonsurvey_threshold => 'Responder count needed before showing submissions for anonymous surveys', |
coursecredits => 'Credits can be specified for courses', |
coursecredits => 'Credits can be specified for courses', |
|
uselcmath => 'Math preview uses LON-CAPA previewer (javascript) in place of DragMath (Java)', |
|
usejsme => 'Molecule editor uses JSME (HTML5) in place of JME (Java)', |
|
postsubmit => 'Disable submit button/keypress following student submission', |
); |
); |
my %staticdefaults = ( |
my %staticdefaults = ( |
anonsurvey_threshold => 10, |
anonsurvey_threshold => 10, |
uploadquota => 500, |
uploadquota => 500, |
|
postsubmit => 60, |
); |
); |
if ($position eq 'top') { |
if ($position eq 'top') { |
%defaultchecked = ('canuse_pdfforms' => 'off'); |
%defaultchecked = ( |
@toggles = ('canuse_pdfforms'); |
'uselcmath' => 'on', |
|
'usejsme' => 'on', |
|
); |
|
@toggles = ('uselcmath','usejsme'); |
($datatable,$itemcount) = &radiobutton_prefs($settings,\@toggles,\%defaultchecked, |
($datatable,$itemcount) = &radiobutton_prefs($settings,\@toggles,\%defaultchecked, |
\%choices,$itemcount); |
\%choices,$itemcount); |
} else { |
} else { |
$css_class = $itemcount%2 ? ' class="LC_odd_row"' : ''; |
$css_class = $itemcount%2 ? ' class="LC_odd_row"' : ''; |
my ($currdefresponder,$def_official_credits,$def_unofficial_credits,$def_textbook_credits, |
my ($currdefresponder,%defcredits,%curruploadquota,%deftimeout); |
%curruploadquota); |
|
my $currusecredits = 0; |
my $currusecredits = 0; |
|
my $postsubmitclient = 1; |
my @types = ('official','unofficial','community','textbook'); |
my @types = ('official','unofficial','community','textbook'); |
if (ref($settings) eq 'HASH') { |
if (ref($settings) eq 'HASH') { |
$currdefresponder = $settings->{'anonsurvey_threshold'}; |
$currdefresponder = $settings->{'anonsurvey_threshold'}; |
Line 2906 sub print_coursedefaults {
|
Line 2921 sub print_coursedefaults {
|
} |
} |
} |
} |
if (ref($settings->{'coursecredits'}) eq 'HASH') { |
if (ref($settings->{'coursecredits'}) eq 'HASH') { |
$def_official_credits = $settings->{'coursecredits'}->{'official'}; |
foreach my $type (@types) { |
$def_unofficial_credits = $settings->{'coursecredits'}->{'unofficial'}; |
next if ($type eq 'community'); |
$def_textbook_credits = $settings->{'coursecredits'}->{'textbook'}; |
$defcredits{$type} = $settings->{'coursecredits'}->{$type}; |
if (($def_official_credits ne '') || ($def_unofficial_credits ne '') || |
if ($defcredits{$type} ne '') { |
($def_textbook_credits ne '')) { |
$currusecredits = 1; |
$currusecredits = 1; |
} |
|
} |
|
} |
|
if (ref($settings->{'postsubmit'}) eq 'HASH') { |
|
if ($settings->{'postsubmit'}->{'client'} eq 'off') { |
|
$postsubmitclient = 0; |
|
foreach my $type (@types) { |
|
$deftimeout{$type} = $staticdefaults{'postsubmit'}; |
|
} |
|
} else { |
|
foreach my $type (@types) { |
|
if (ref($settings->{'postsubmit'}->{'timeout'}) eq 'HASH') { |
|
if ($settings->{'postsubmit'}->{'timeout'}->{$type} =~ /^\d+$/) { |
|
$deftimeout{$type} = $settings->{'postsubmit'}->{'timeout'}->{$type}; |
|
} else { |
|
$deftimeout{$type} = $staticdefaults{'postsubmit'}; |
|
} |
|
} else { |
|
$deftimeout{$type} = $staticdefaults{'postsubmit'}; |
|
} |
|
} |
|
} |
|
} else { |
|
foreach my $type (@types) { |
|
$deftimeout{$type} = $staticdefaults{'postsubmit'}; |
} |
} |
} |
} |
} |
} |
Line 2953 sub print_coursedefaults {
|
Line 2992 sub print_coursedefaults {
|
$display = 'block'; |
$display = 'block'; |
} |
} |
my $additional = '<div id="credits" style="display: '.$display.'">'. |
my $additional = '<div id="credits" style="display: '.$display.'">'. |
'<span class="LC_nobreak">'. |
'<i>'.&mt('Default credits').'</i><br /><table><tr>'; |
&mt('Default credits for official courses [_1]', |
foreach my $type (@types) { |
'<input type="text" name="official_credits" value="'. |
next if ($type eq 'community'); |
$def_official_credits.'" size="3" />'). |
$additional .= '<td align="center">'.&mt($type).'<br />'. |
'</span><br />'. |
'<input type="text" name="'.$type.'_credits"'. |
'<span class="LC_nobreak">'. |
' value="'.$defcredits{$type}.'" size="3" /></td>'; |
&mt('Default credits for unofficial courses [_1]', |
} |
'<input type="text" name="unofficial_credits" value="'. |
$additional .= '</tr></table></div>'."\n"; |
$def_unofficial_credits.'" size="3" />'). |
|
'</span><br />'. |
|
'<span class="LC_nobreak">'. |
|
&mt('Default credits for textbook courses [_1]', |
|
'<input type="text" name="textbook_credits" value="'. |
|
$def_textbook_credits.'" size="3" />'). |
|
'</span></div>'."\n"; |
|
%defaultchecked = ('coursecredits' => 'off'); |
%defaultchecked = ('coursecredits' => 'off'); |
@toggles = ('coursecredits'); |
@toggles = ('coursecredits'); |
my $current = { |
my $current = { |
Line 2975 sub print_coursedefaults {
|
Line 3007 sub print_coursedefaults {
|
}; |
}; |
(my $table,$itemcount) = |
(my $table,$itemcount) = |
&radiobutton_prefs($current,\@toggles,\%defaultchecked, |
&radiobutton_prefs($current,\@toggles,\%defaultchecked, |
\%choices,$itemcount,$onclick,$additional); |
\%choices,$itemcount,$onclick,$additional,'left'); |
|
$datatable .= $table; |
|
$onclick = "toggleDisplay(this.form,'studentsubmission');"; |
|
my $display = 'none'; |
|
if ($postsubmitclient) { |
|
$display = 'block'; |
|
} |
|
$additional = '<div id="studentsubmission" style="display: '.$display.'">'. |
|
'<i>'.&mt('Number of seconds submit is disabled').'</i><br /><table><tr>'; |
|
foreach my $type (@types) { |
|
$additional .= '<td align="center">'.&mt($type).'<br />'. |
|
'<input type="text" name="'.$type.'_timeout" value="'. |
|
$deftimeout{$type}.'" size="5" /></td>'; |
|
} |
|
$additional .= '</tr></table></div>'."\n"; |
|
%defaultchecked = ('postsubmit' => 'on'); |
|
@toggles = ('postsubmit'); |
|
my $current = { |
|
'postsubmit' => $postsubmitclient, |
|
}; |
|
($table,$itemcount) = |
|
&radiobutton_prefs($current,\@toggles,\%defaultchecked, |
|
\%choices,$itemcount,$onclick,$additional,'left'); |
$datatable .= $table; |
$datatable .= $table; |
$itemcount ++; |
|
} |
} |
$$rowtotal += $itemcount; |
$$rowtotal += $itemcount; |
return $datatable; |
return $datatable; |
Line 10156 sub modify_helpsettings {
|
Line 10209 sub modify_helpsettings {
|
sub modify_coursedefaults { |
sub modify_coursedefaults { |
my ($dom,$lastactref,%domconfig) = @_; |
my ($dom,$lastactref,%domconfig) = @_; |
my ($resulttext,$errors,%changes,%defaultshash); |
my ($resulttext,$errors,%changes,%defaultshash); |
my %defaultchecked = ('canuse_pdfforms' => 'off'); |
my %defaultchecked = ( |
my @toggles = ('canuse_pdfforms'); |
'uselcmath' => 'on', |
|
'usejsme' => 'on' |
|
); |
|
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'); |
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, |
); |
); |
|
|
$defaultshash{'coursedefaults'} = {}; |
$defaultshash{'coursedefaults'} = {}; |
Line 10225 sub modify_coursedefaults {
|
Line 10282 sub modify_coursedefaults {
|
} |
} |
} |
} |
|
|
my $officialcreds = $env{'form.official_credits'}; |
my %credits; |
$officialcreds =~ s/[^\d.]+//g; |
foreach my $type (@types) { |
my $unofficialcreds = $env{'form.unofficial_credits'}; |
unless ($type eq 'community') { |
$unofficialcreds =~ s/[^\d.]+//g; |
$credits{$type} = $env{'form.'.$type.'_credits'}; |
my $textbookcreds = $env{'form.textbook_credits'}; |
$credits{$type} =~ s/[^\d.]+//g; |
$textbookcreds =~ s/[^\d.]+//g; |
} |
if (ref($domconfig{'coursedefaults'}{'coursecredits'} ne 'HASH') && |
} |
($env{'form.coursecredits'} eq '1')) { |
if ((ref($domconfig{'coursedefaults'}{'coursecredits'}) ne 'HASH') && |
$changes{'coursecredits'} = 1; |
($env{'form.coursecredits'} eq '1')) { |
} else { |
$changes{'coursecredits'} = 1; |
if (($domconfig{'coursedefaults'}{'coursecredits'}{'official'} ne $officialcreds) || |
foreach my $type (keys(%credits)) { |
($domconfig{'coursedefaults'}{'coursecredits'}{'unofficial'} ne $unofficialcreds) || |
$defaultshash{'coursedefaults'}{'coursecredits'}{$type} = $credits{$type}; |
($domconfig{'coursedefaults'}{'coursecredits'}{'textbook'} ne $textbookcreds)) { |
} |
$changes{'coursecredits'} = 1; |
} else { |
} |
if ($env{'form.coursecredits'} eq '1') { |
} |
foreach my $type (@types) { |
$defaultshash{'coursedefaults'}{'coursecredits'} = { |
unless ($type eq 'community') { |
official => $officialcreds, |
if ($domconfig{'coursedefaults'}{'coursecredits'}{$type} ne $credits{$type}) { |
unofficial => $unofficialcreds, |
$changes{'coursecredits'} = 1; |
textbook => $textbookcreds, |
} |
|
$defaultshash{'coursedefaults'}{'coursecredits'}{$type} = $credits{$type}; |
|
} |
|
} |
|
} elsif (ref($domconfig{'coursedefaults'}{'coursecredits'}) eq 'HASH') { |
|
foreach my $type (@types) { |
|
unless ($type eq 'community') { |
|
if ($domconfig{'coursedefaults'}{'coursecredits'}{$type}) { |
|
$changes{'coursecredits'} = 1; |
|
last; |
|
} |
|
} |
|
} |
|
} |
|
} |
|
if ($env{'form.postsubmit'} eq '1') { |
|
$defaultshash{'coursedefaults'}{'postsubmit'}{'client'} = 'on'; |
|
my %currtimeout; |
|
if (ref($domconfig{'coursedefaults'}{'postsubmit'}) eq 'HASH') { |
|
if ($domconfig{'coursedefaults'}{'postsubmit'}{'client'} eq 'off') { |
|
$changes{'postsubmit'} = 1; |
|
} |
|
if (ref($domconfig{'coursedefaults'}{'postsubmit'}{'timeout'}) eq 'HASH') { |
|
%currtimeout = %{$domconfig{'coursedefaults'}{'postsubmit'}{'timeout'}}; |
|
} |
|
} else { |
|
$changes{'postsubmit'} = 1; |
|
} |
|
foreach my $type (@types) { |
|
my $timeout = $env{'form.'.$type.'_timeout'}; |
|
$timeout =~ s/\D//g; |
|
if ($timeout == $staticdefaults{'postsubmit'}) { |
|
$timeout = ''; |
|
} elsif (($timeout eq '') || ($timeout =~ /^0+$/)) { |
|
$timeout = '0'; |
|
} |
|
unless ($timeout eq '') { |
|
$defaultshash{'coursedefaults'}{'postsubmit'}{'timeout'}{$type} = $timeout; |
|
} |
|
if (exists($currtimeout{$type})) { |
|
if ($timeout ne $currtimeout{$type}) { |
|
$changes{'postsubmit'} = 1; |
|
} |
|
} elsif ($timeout ne '') { |
|
$changes{'postsubmit'} = 1; |
|
} |
|
} |
|
} else { |
|
$defaultshash{'coursedefaults'}{'postsubmit'}{'client'} = 'off'; |
|
if (ref($domconfig{'coursedefaults'}{'postsubmit'}) eq 'HASH') { |
|
if ($domconfig{'coursedefaults'}{'postsubmit'}{'client'} eq 'on') { |
|
$changes{'postsubmit'} = 1; |
|
} |
|
} else { |
|
$changes{'postsubmit'} = 1; |
|
} |
} |
} |
} |
} |
my $putresult = &Apache::lonnet::put_dom('configuration',\%defaultshash, |
my $putresult = &Apache::lonnet::put_dom('configuration',\%defaultshash, |
Line 10252 sub modify_coursedefaults {
|
Line 10364 sub modify_coursedefaults {
|
if ($putresult eq 'ok') { |
if ($putresult eq 'ok') { |
if (keys(%changes) > 0) { |
if (keys(%changes) > 0) { |
my %domdefaults = &Apache::lonnet::get_domain_defaults($dom,1); |
my %domdefaults = &Apache::lonnet::get_domain_defaults($dom,1); |
if (($changes{'canuse_pdfforms'}) || ($changes{'coursecredits'}) || |
if (($changes{'uploadquota'}) || ($changes{'postsubmit'}) || |
($changes{'uploadquota'})) { |
($changes{'coursecredits'}) || ($changes{'uselcmath'}) || ($changes{'usejsme'})) { |
if ($changes{'canuse_pdfforms'}) { |
foreach my $item ('uselcmath','usejsme') { |
$domdefaults{'canuse_pdfforms'}=$defaultshash{'coursedefaults'}{'canuse_pdfforms'}; |
if ($changes{$item}) { |
|
$domdefaults{$item}=$defaultshash{'coursedefaults'}{$item}; |
|
} |
} |
} |
if ($changes{'coursecredits'}) { |
if ($changes{'coursecredits'}) { |
if (ref($defaultshash{'coursedefaults'}{'coursecredits'}) eq 'HASH') { |
if (ref($defaultshash{'coursedefaults'}{'coursecredits'}) eq 'HASH') { |
$domdefaults{'officialcredits'} = |
foreach my $type (keys(%{$defaultshash{'coursedefaults'}{'coursecredits'}})) { |
$defaultshash{'coursedefaults'}{'coursecredits'}{'official'}; |
$domdefaults{$type.'credits'} = |
$domdefaults{'unofficialcredits'} = |
$defaultshash{'coursedefaults'}{'coursecredits'}{$type}; |
$defaultshash{'coursedefaults'}{'coursecredits'}{'unofficial'}; |
} |
$domdefaults{'textbookcredits'} = |
} |
$domdefaults{'coursedefaults'}{'coursecredits'}{'textbook'}; |
} |
|
if ($changes{'postsubmit'}) { |
|
if (ref($defaultshash{'coursedefaults'}{'postsubmit'}) eq 'HASH') { |
|
$domdefaults{'postsubmit'} = $defaultshash{'coursedefaults'}{'postsubmit'}{'client'}; |
|
if (ref($defaultshash{'coursedefaults'}{'postsubmit'}{'timeout'}) eq 'HASH') { |
|
foreach my $type (keys(%{$defaultshash{'coursedefaults'}{'postsubmit'}{'timeout'}})) { |
|
$domdefaults{$type.'postsubtimeout'} = |
|
$defaultshash{'coursedefaults'}{'postsubmit'}{'timeout'}{$type}; |
|
} |
|
} |
} |
} |
} |
} |
if ($changes{'uploadquota'}) { |
if ($changes{'uploadquota'}) { |
Line 10282 sub modify_coursedefaults {
|
Line 10405 sub modify_coursedefaults {
|
} |
} |
$resulttext = &mt('Changes made:').'<ul>'; |
$resulttext = &mt('Changes made:').'<ul>'; |
foreach my $item (sort(keys(%changes))) { |
foreach my $item (sort(keys(%changes))) { |
if ($item eq 'canuse_pdfforms') { |
if ($item eq 'uselcmath') { |
if ($env{'form.'.$item} eq '1') { |
if ($env{'form.'.$item} eq '1') { |
$resulttext .= '<li>'.&mt("Course/Community users can create/upload PDF forms set to 'on'").'</li>'; |
$resulttext .= '<li>'.&mt('Math preview uses LON-CAPA previewer (javascript), if supported by browser.').'</li>'; |
} else { |
} else { |
$resulttext .= '<li>'.&mt('Course/Community users can create/upload PDF forms set to "off"').'</li>'; |
$resulttext .= '<li>'.&mt('Math preview uses DragMath (Java), if supported by client OS.').'</li>'; |
|
} |
|
} elsif ($item eq 'usejsme') { |
|
if ($env{'form.'.$item} eq '1') { |
|
$resulttext .= '<li>'.&mt('Molecule editor uses JSME (HTML5), if supported by browser.').'</li>'; |
|
} else { |
|
$resulttext .= '<li>'.&mt('Molecule editor uses JME (Java), if supported by client OS.').'</li>'; |
} |
} |
} elsif ($item eq 'anonsurvey_threshold') { |
} 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 .= '<li>'.&mt('Responder count required for display of anonymous survey submissions set to [_1].',$defaultshash{'coursedefaults'}{'anonsurvey_threshold'}).'</li>'; |
Line 10303 sub modify_coursedefaults {
|
Line 10432 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 'postsubmit') { |
|
if ($domdefaults{'postsubmit'} eq 'off') { |
|
$resulttext .= '<li>'.&mt('Submit button(s) remain enabled on page after student makes submission.'); |
|
} else { |
|
$resulttext .= '<li>'.&mt('Submit button(s) disabled on page after student makes submission').'; '; |
|
if (ref($defaultshash{'coursedefaults'}{'postsubmit'}) eq 'HASH') { |
|
$resulttext .= &mt('durations:').'<ul>'; |
|
foreach my $type (@types) { |
|
$resulttext .= '<li>'; |
|
my $timeout; |
|
if (ref($defaultshash{'coursedefaults'}{'postsubmit'}{'timeout'}) eq 'HASH') { |
|
$timeout = $defaultshash{'coursedefaults'}{'postsubmit'}{'timeout'}{$type}; |
|
} |
|
my $display; |
|
if ($timeout eq '0') { |
|
$display = &mt('unlimited'); |
|
} elsif ($timeout eq '') { |
|
$display = &mt('[quant,_1,second] (default)',$staticdefaults{'postsubmit'}); |
|
} else { |
|
$display = &mt('[quant,_1,second]',$timeout); |
|
} |
|
if ($type eq 'community') { |
|
$resulttext .= &mt('Communities'); |
|
} elsif ($type eq 'official') { |
|
$resulttext .= &mt('Official courses'); |
|
} elsif ($type eq 'unofficial') { |
|
$resulttext .= &mt('Unofficial courses'); |
|
} elsif ($type eq 'textbook') { |
|
$resulttext .= &mt('Textbook courses'); |
|
} |
|
$resulttext .= ' -- '.$display.'</li>'; |
|
} |
|
$resulttext .= '</ul>'; |
|
} |
|
$resulttext .= '</li>'; |
|
} |
} elsif ($item eq 'coursecredits') { |
} elsif ($item eq 'coursecredits') { |
if (ref($defaultshash{'coursedefaults'}{'coursecredits'}) eq 'HASH') { |
if (ref($defaultshash{'coursedefaults'}{'coursecredits'}) eq 'HASH') { |
if (($domdefaults{'officialcredits'} eq '') && |
if (($domdefaults{'officialcredits'} eq '') && |
Line 11779 function toggleDisplay(domForm,caller) {
|
Line 11944 function toggleDisplay(domForm,caller) {
|
if (caller == 'emailoptions') { |
if (caller == 'emailoptions') { |
optionsElement = domForm.cancreate_email; |
optionsElement = domForm.cancreate_email; |
} |
} |
|
if (caller == 'studentsubmission') { |
|
optionsElement = domForm.postsubmit; |
|
} |
if (optionsElement.length) { |
if (optionsElement.length) { |
var currval; |
var currval; |
for (var i=0; i<optionsElement.length; i++) { |
for (var i=0; i<optionsElement.length; i++) { |