version 1.430, 2023/11/03 01:12:15
|
version 1.432, 2023/12/23 02:17:38
|
Line 6822 sub print_coursedefaults {
|
Line 6822 sub print_coursedefaults {
|
my %choices = &Apache::lonlocal::texthash ( |
my %choices = &Apache::lonlocal::texthash ( |
canuse_pdfforms => 'Course/Community users can create/upload PDF forms', |
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)', |
coursequota => 'Default cumulative quota for all group portfolio spaces in course', |
coursequota => 'Default cumulative quota for all group portfolio spaces in course (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)', |
uselcmath => 'Math preview uses LON-CAPA previewer (javascript) in place of DragMath (Java)', |
Line 6835 sub print_coursedefaults {
|
Line 6835 sub print_coursedefaults {
|
ltiauth => 'Student username in LTI launch of deep-linked URL can be accepted without re-authentication', |
ltiauth => 'Student username in LTI launch of deep-linked URL can be accepted without re-authentication', |
domexttool => 'External Tools defined in the domain may be used in courses/communities (by type)', |
domexttool => 'External Tools defined in the domain may be used in courses/communities (by type)', |
exttool => 'External Tools can be defined and configured in courses/communities (by type)', |
exttool => 'External Tools can be defined and configured in courses/communities (by type)', |
|
crsauthor => 'Standard LON-CAPA problems can be created within a course/community (by type)', |
); |
); |
my %staticdefaults = ( |
my %staticdefaults = ( |
anonsurvey_threshold => 10, |
anonsurvey_threshold => 10, |
Line 6844 sub print_coursedefaults {
|
Line 6845 sub print_coursedefaults {
|
mysqltables => 172800, |
mysqltables => 172800, |
domexttool => 1, |
domexttool => 1, |
exttool => 0, |
exttool => 0, |
|
crsauthor => 1, |
); |
); |
if ($position eq 'top') { |
if ($position eq 'top') { |
%defaultchecked = ( |
%defaultchecked = ( |
Line 6964 sub print_coursedefaults {
|
Line 6966 sub print_coursedefaults {
|
my $ltiauth = 0; |
my $ltiauth = 0; |
my %domexttool; |
my %domexttool; |
my %exttool; |
my %exttool; |
|
my %crsauthor; |
my @types = ('official','unofficial','community','textbook','placement'); |
my @types = ('official','unofficial','community','textbook','placement'); |
if (ref($settings) eq 'HASH') { |
if (ref($settings) eq 'HASH') { |
if ($settings->{'ltiauth'}) { |
if ($settings->{'ltiauth'}) { |
Line 6989 sub print_coursedefaults {
|
Line 6992 sub print_coursedefaults {
|
} |
} |
} |
} |
} |
} |
|
if (ref($settings->{'crsauthor'}) eq 'HASH') { |
|
foreach my $type (@types) { |
|
if ($settings->{'crsauthor'}->{$type}) { |
|
$crsauthor{$type} = ' checked="checked"'; |
|
} |
|
} |
|
} else { |
|
foreach my $type (@types) { |
|
if ($staticdefaults{'crsauthor'}) { |
|
$crsauthor{$type} = ' checked="checked"'; |
|
} |
|
} |
|
} |
$currdefresponder = $settings->{'anonsurvey_threshold'}; |
$currdefresponder = $settings->{'anonsurvey_threshold'}; |
if (ref($settings->{'uploadquota'}) eq 'HASH') { |
if (ref($settings->{'uploadquota'}) eq 'HASH') { |
foreach my $type (keys(%{$settings->{'uploadquota'}})) { |
foreach my $type (keys(%{$settings->{'uploadquota'}})) { |
Line 7048 sub print_coursedefaults {
|
Line 7064 sub print_coursedefaults {
|
if ($staticdefaults{'domexttool'}) { |
if ($staticdefaults{'domexttool'}) { |
$domexttool{$type} = ' checked="checked"'; |
$domexttool{$type} = ' checked="checked"'; |
} |
} |
|
if ($staticdefaults{'crsauthor'}) { |
|
$crsauthor{$type} = ' checked="checked"'; |
|
} |
} |
} |
} |
} |
if (!$currdefresponder) { |
if (!$currdefresponder) { |
Line 7196 sub print_coursedefaults {
|
Line 7215 sub print_coursedefaults {
|
&mt($type).'</span></td>'."\n"; |
&mt($type).'</span></td>'."\n"; |
} |
} |
$datatable .= '</tr></table></td></tr>'."\n"; |
$datatable .= '</tr></table></td></tr>'."\n"; |
|
$itemcount ++; |
|
$css_class = $itemcount%2 ? ' class="LC_odd_row"' : ''; |
|
$datatable .= '<tr'.$css_class.'><td><span class="LC_nobreak">'. |
|
$choices{'crsauthor'}. |
|
'</span></td>'. |
|
'<td style="text-align: right" class="LC_right_item">'. |
|
'<table><tr>'; |
|
foreach my $type (@types) { |
|
$datatable .= '<td style="text-align: left">'. |
|
'<span class="LC_nobreak">'. |
|
'<input type="checkbox" name="crsauthor"'. |
|
' value="'.$type.'"'.$crsauthor{$type}.' />'. |
|
&mt($type).'</span></td>'."\n"; |
|
} |
|
$datatable .= '</tr></table></td></tr>'."\n"; |
} |
} |
$$rowtotal += $itemcount; |
$$rowtotal += $itemcount; |
return $datatable; |
return $datatable; |
Line 13392 sub modify_authordefaults {
|
Line 13426 sub modify_authordefaults {
|
my $resulttext; |
my $resulttext; |
if ($putresult eq 'ok') { |
if ($putresult eq 'ok') { |
if (keys(%changes)) { |
if (keys(%changes)) { |
|
my %domdefaults = &Apache::lonnet::get_domain_defaults($dom); |
if ((exists($changes{'authorquota'})) || (exists($changes{'webdav'})) || |
if ((exists($changes{'authorquota'})) || (exists($changes{'webdav'})) || |
($changes{'webdav_LC_adv'})) { |
($changes{'webdav_LC_adv'})) { |
my %domdefaults = &Apache::lonnet::get_domain_defaults($dom,1); |
|
if ((exists($changes{'authorquota'})) && (ref($save_quotas{'authorquota'}) eq 'HASH')) { |
if ((exists($changes{'authorquota'})) && (ref($save_quotas{'authorquota'}) eq 'HASH')) { |
$domdefaults{'authorquota'} = $save_quotas{'authorquota'}; |
$domdefaults{'authorquota'} = $save_quotas{'authorquota'}; |
} |
} |
Line 13402 sub modify_authordefaults {
|
Line 13436 sub modify_authordefaults {
|
(ref($save_quotas{'webdav'}) eq 'HASH')) { |
(ref($save_quotas{'webdav'}) eq 'HASH')) { |
$domdefaults{'webdav'} = $save_quotas{'webdav'}; |
$domdefaults{'webdav'} = $save_quotas{'webdav'}; |
} |
} |
my $cachetime = 24*60*60; |
|
&Apache::lonnet::do_cache_new('domdefaults',$dom,\%domdefaults,$cachetime); |
|
if (ref($lastactref) eq 'HASH') { |
|
$lastactref->{'domdefaults'} = 1; |
|
} |
|
} |
} |
$resulttext = &mt('Changes made:').'<ul>'; |
$resulttext = &mt('Changes made:').'<ul>'; |
my $authoroverride; |
my $authoroverride; |
foreach my $key ('nocodemirror','domcoordacc','copyright','sourceavail') { |
foreach my $key ('nocodemirror','domcoordacc','copyright','sourceavail') { |
if (exists($changes{$key})) { |
if (exists($changes{$key})) { |
|
$domdefaults{$key} = $confhash{$key}; |
my $shown; |
my $shown; |
unless ($authoroverride) { |
unless ($authoroverride) { |
$resulttext .= '<li>'.&mt('Defaults which can be overridden by Author').'<ul>'; |
$resulttext .= '<li>'.&mt('Defaults which can be overridden by Author').'<ul>'; |
Line 13439 sub modify_authordefaults {
|
Line 13469 sub modify_authordefaults {
|
$domcoordoverride = 1; |
$domcoordoverride = 1; |
} |
} |
if ($key eq 'editors') { |
if ($key eq 'editors') { |
if (@{$confhash{'editors'}}) { |
if (ref($confhash{'editors'}) eq 'ARRAY') { |
$shown = join(', ', map { $titles{$_} } @{$confhash{'editors'}}); |
$domdefaults{'editors'} = join(',',@{$confhash{'editors'}}); |
} else { |
if (@{$confhash{'editors'}}) { |
$shown = &mt('None'); |
$shown = join(', ', map { $titles{$_} } @{$confhash{'editors'}}); |
|
} else { |
|
$shown = &mt('None'); |
|
} |
} |
} |
} elsif ($key eq 'authorquota') { |
} elsif ($key eq 'authorquota') { |
foreach my $type (@insttypes) { |
foreach my $type (@insttypes) { |
Line 13467 sub modify_authordefaults {
|
Line 13500 sub modify_authordefaults {
|
if ($domcoordoverride) { |
if ($domcoordoverride) { |
$resulttext .= '</ul></li>'; |
$resulttext .= '</ul></li>'; |
} |
} |
|
my $cachetime = 24*60*60; |
|
&Apache::lonnet::do_cache_new('domdefaults',$dom,\%domdefaults,$cachetime); |
|
if (ref($lastactref) eq 'HASH') { |
|
$lastactref->{'domdefaults'} = 1; |
|
} |
} else { |
} else { |
$resulttext = &mt('No changes made to Authoring Space defaults'); |
$resulttext = &mt('No changes made to Authoring Space defaults'); |
} |
} |
Line 21005 sub modify_coursedefaults {
|
Line 21043 sub modify_coursedefaults {
|
postsubmit => 60, |
postsubmit => 60, |
mysqltables => 172800, |
mysqltables => 172800, |
domexttool => 1, |
domexttool => 1, |
|
crsauthor => 1, |
); |
); |
my %texoptions = ( |
my %texoptions = ( |
MathJax => 'MathJax', |
MathJax => 'MathJax', |
Line 21196 sub modify_coursedefaults {
|
Line 21235 sub modify_coursedefaults {
|
$changes{'postsubmit'} = 1; |
$changes{'postsubmit'} = 1; |
} |
} |
} |
} |
my (%newdomexttool,%newexttool,%olddomexttool,%oldexttool); |
my (%newdomexttool,%newexttool,%newcrsauthor,%olddomexttool,%oldexttool,%oldcrsauthor); |
map { $newdomexttool{$_} = 1; } &Apache::loncommon::get_env_multiple('form.domexttool'); |
map { $newdomexttool{$_} = 1; } &Apache::loncommon::get_env_multiple('form.domexttool'); |
map { $newexttool{$_} = 1; } &Apache::loncommon::get_env_multiple('form.exttool'); |
map { $newexttool{$_} = 1; } &Apache::loncommon::get_env_multiple('form.exttool'); |
|
map { $newcrsauthor{$_} = 1; } &Apache::loncommon::get_env_multiple('form.crsauthor'); |
if (ref($domconfig{'coursedefaults'}{'domexttool'}) eq 'HASH') { |
if (ref($domconfig{'coursedefaults'}{'domexttool'}) eq 'HASH') { |
%olddomexttool = %{$domconfig{'coursedefaults'}{'domexttool'}}; |
%olddomexttool = %{$domconfig{'coursedefaults'}{'domexttool'}}; |
} else { |
} else { |
Line 21221 sub modify_coursedefaults {
|
Line 21261 sub modify_coursedefaults {
|
} |
} |
} |
} |
} |
} |
|
if (ref($domconfig{'coursedefaults'}{'crsauthor'}) eq 'HASH') { |
|
%oldcrsauthor = %{$domconfig{'coursedefaults'}{'crsauthor'}}; |
|
} else { |
|
foreach my $type (@types) { |
|
if ($staticdefaults{'crsauthor'}) { |
|
$oldcrsauthor{$type} = 1; |
|
} else { |
|
$oldcrsauthor{$type} = 0; |
|
} |
|
} |
|
} |
foreach my $type (@types) { |
foreach my $type (@types) { |
unless ($newdomexttool{$type}) { |
unless ($newdomexttool{$type}) { |
$newdomexttool{$type} = 0; |
$newdomexttool{$type} = 0; |
Line 21228 sub modify_coursedefaults {
|
Line 21279 sub modify_coursedefaults {
|
unless ($newexttool{$type}) { |
unless ($newexttool{$type}) { |
$newexttool{$type} = 0; |
$newexttool{$type} = 0; |
} |
} |
|
unless ($newcrsauthor{$type}) { |
|
$newcrsauthor{$type} = 0; |
|
} |
if ($newdomexttool{$type} != $olddomexttool{$type}) { |
if ($newdomexttool{$type} != $olddomexttool{$type}) { |
$changes{'domexttool'} = 1; |
$changes{'domexttool'} = 1; |
} |
} |
if ($newexttool{$type} != $oldexttool{$type}) { |
if ($newexttool{$type} != $oldexttool{$type}) { |
$changes{'exttool'} = 1; |
$changes{'exttool'} = 1; |
} |
} |
|
if ($newcrsauthor{$type} != $oldcrsauthor{$type}) { |
|
$changes{'crsauthor'} = 1; |
|
} |
} |
} |
$defaultshash{'coursedefaults'}{'domexttool'} = \%newdomexttool; |
$defaultshash{'coursedefaults'}{'domexttool'} = \%newdomexttool; |
$defaultshash{'coursedefaults'}{'exttool'} = \%newexttool; |
$defaultshash{'coursedefaults'}{'exttool'} = \%newexttool; |
|
$defaultshash{'coursedefaults'}{'crsauthor'} = \%newcrsauthor; |
} |
} |
my $putresult = &Apache::lonnet::put_dom('configuration',\%defaultshash, |
my $putresult = &Apache::lonnet::put_dom('configuration',\%defaultshash, |
$dom); |
$dom); |
Line 21247 sub modify_coursedefaults {
|
Line 21305 sub modify_coursedefaults {
|
($changes{'coursecredits'}) || ($changes{'uselcmath'}) || ($changes{'usejsme'}) || |
($changes{'coursecredits'}) || ($changes{'uselcmath'}) || ($changes{'usejsme'}) || |
($changes{'canclone'}) || ($changes{'mysqltables'}) || ($changes{'texengine'}) || |
($changes{'canclone'}) || ($changes{'mysqltables'}) || ($changes{'texengine'}) || |
($changes{'inline_chem'}) || ($changes{'ltiauth'}) || ($changes{'domexttool'}) || |
($changes{'inline_chem'}) || ($changes{'ltiauth'}) || ($changes{'domexttool'}) || |
($changes{'exttool'}) || ($changes{'coursequota'})) { |
($changes{'exttool'}) || ($changes{'coursequota'}) || ($changes{'crsauthor'})) { |
foreach my $item ('canuse_pdfforms','uselcmath','usejsme','inline_chem','texengine', |
foreach my $item ('canuse_pdfforms','uselcmath','usejsme','inline_chem','texengine', |
'ltiauth') { |
'ltiauth') { |
if ($changes{$item}) { |
if ($changes{$item}) { |
Line 21313 sub modify_coursedefaults {
|
Line 21371 sub modify_coursedefaults {
|
} |
} |
} |
} |
} |
} |
|
if ($changes{'crsauthor'}) { |
|
if (ref($defaultshash{'coursedefaults'}{'crsauthor'}) eq 'HASH') { |
|
foreach my $type (@types) { |
|
$domdefaults{$type.'crsauthor'}=$defaultshash{'coursedefaults'}{'crsauthor'}{$type}; |
|
} |
|
} |
|
} |
my $cachetime = 24*60*60; |
my $cachetime = 24*60*60; |
&Apache::lonnet::do_cache_new('domdefaults',$dom,\%domdefaults,$cachetime); |
&Apache::lonnet::do_cache_new('domdefaults',$dom,\%domdefaults,$cachetime); |
if (ref($lastactref) eq 'HASH') { |
if (ref($lastactref) eq 'HASH') { |
Line 21463 sub modify_coursedefaults {
|
Line 21528 sub modify_coursedefaults {
|
} else { |
} else { |
$resulttext .= '<li>'.&mt('LTI launch of deep-linked URL will require re-authentication').'</li>'; |
$resulttext .= '<li>'.&mt('LTI launch of deep-linked URL will require re-authentication').'</li>'; |
} |
} |
} elsif ($item eq 'domexttool') { |
} elsif (($item eq 'domexttool') || ($item eq 'exttool') || ($item eq 'crsauthor')) { |
my @noyes = (&mt('no'),&mt('yes')); |
my @noyes = (&mt('no'),&mt('yes')); |
if (ref($defaultshash{'coursedefaults'}{'domexttool'}) eq 'HASH') { |
my %status = ( |
$resulttext .= '<li>'.&mt('External Tools defined in the domain may be used as follows:').'<ul>'. |
domexttool => { |
'<li>'.&mt('Official courses: [_1]','<b>'.$noyes[$defaultshash{'coursedefaults'}{'domexttool'}{'official'}].'</b>').'</li>'. |
ishash => &mt('External Tools defined in the domain may be used as follows:'), |
'<li>'.&mt('Unofficial courses: [_1]','<b>'.$noyes[$defaultshash{'coursedefaults'}{'domexttool'}{'unofficial'}].'</b>').'</li>'. |
default => &mt('External Tools defined in the domain may be used in all course types, by default'), |
'<li>'.&mt('Textbook courses: [_1]','<b>'.$noyes[$defaultshash{'coursedefaults'}{'domexttool'}{'textbook'}].'</b>').'</li>'. |
}, |
'<li>'.&mt('Placement tests: [_1]','<b>'.$noyes[$defaultshash{'coursedefaults'}{'domexttool'}{'placement'}].'</b>').'</li>'. |
exttool => { |
'<li>'.&mt('Communities: [_1]','<b>'.$noyes[$defaultshash{'coursedefaults'}{'domexttool'}{'community'}].'</b>').'</li>'. |
ishash => &mt('External Tools can be defined and configured in course containers as follows:'), |
'</ul>'. |
default => &mt('External Tools can not be defined in any course types, by default'), |
'</li>'; |
}, |
} else { |
crsauthor => { |
$resulttext .= '<li>'.&mt('External Tools defined in the domain may be used in all course types, by default').'</li>'; |
ishash => &mt('Standard Problems can be created within course containers as follows:'), |
} |
default => &mt('Standard Problems can be created within any course type, by default'), |
} elsif ($item eq 'exttool') { |
}, |
my @noyes = (&mt('no'),&mt('yes')); |
); |
if (ref($defaultshash{'coursedefaults'}{'exttool'}) eq 'HASH') { |
|
$resulttext .= '<li>'.&mt('External Tools can be defined and configured in course containers as follows:').'<ul>'. |
if (ref($defaultshash{'coursedefaults'}{$item}) eq 'HASH') { |
'<li>'.&mt('Official courses: [_1]','<b>'.$noyes[$defaultshash{'coursedefaults'}{'exttool'}{'official'}].'</b>').'</li>'. |
$resulttext .= '<li>'.$status{$item}{'ishash'}.'<ul>'. |
'<li>'.&mt('Unofficial courses: [_1]','<b>'.$noyes[$defaultshash{'coursedefaults'}{'exttool'}{'unofficial'}].'</b>').'</li>'. |
'<li>'.&mt('Official courses: [_1]','<b>'.$noyes[$defaultshash{'coursedefaults'}{$item}{'official'}].'</b>').'</li>'. |
'<li>'.&mt('Textbook courses: [_1]','<b>'.$noyes[$defaultshash{'coursedefaults'}{'exttool'}{'textbook'}].'</b>').'</li>'. |
'<li>'.&mt('Unofficial courses: [_1]','<b>'.$noyes[$defaultshash{'coursedefaults'}{$item}{'unofficial'}].'</b>').'</li>'. |
'<li>'.&mt('Placement tests: [_1]','<b>'.$noyes[$defaultshash{'coursedefaults'}{'exttool'}{'placement'}].'</b>').'</li>'. |
'<li>'.&mt('Textbook courses: [_1]','<b>'.$noyes[$defaultshash{'coursedefaults'}{$item}{'textbook'}].'</b>').'</li>'. |
'<li>'.&mt('Communities: [_1]','<b>'.$noyes[$defaultshash{'coursedefaults'}{'exttool'}{'community'}].'</b>').'</li>'. |
'<li>'.&mt('Placement tests: [_1]','<b>'.$noyes[$defaultshash{'coursedefaults'}{$item}{'placement'}].'</b>').'</li>'. |
|
'<li>'.&mt('Communities: [_1]','<b>'.$noyes[$defaultshash{'coursedefaults'}{$item}{'community'}].'</b>').'</li>'. |
'</ul>'. |
'</ul>'. |
'</li>'; |
'</li>'; |
} else { |
} else { |
$resulttext .= '<li>'.&mt('External Tools can not be defined in any course types, by default').'</li>'; |
$resulttext .= '<li>'.$status{$item}{'default'}.'</li>'; |
} |
} |
} |
} |
} |
} |