version 1.421, 2023/03/19 16:05:48
|
version 1.422, 2023/04/11 20:35:19
|
Line 6746 sub print_coursedefaults {
|
Line 6746 sub print_coursedefaults {
|
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', |
mysqltables => 'Lifetime (s) of "Temporary" MySQL tables (student performance data) on homeserver', |
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)', |
|
exttool => 'External Tools can be defined and configured in courses/communities (by type)', |
); |
); |
my %staticdefaults = ( |
my %staticdefaults = ( |
anonsurvey_threshold => 10, |
anonsurvey_threshold => 10, |
uploadquota => 500, |
uploadquota => 500, |
postsubmit => 60, |
postsubmit => 60, |
mysqltables => 172800, |
mysqltables => 172800, |
|
domexttool => 1, |
|
exttool => 0, |
); |
); |
if ($position eq 'top') { |
if ($position eq 'top') { |
%defaultchecked = ( |
%defaultchecked = ( |
Line 6869 sub print_coursedefaults {
|
Line 6873 sub print_coursedefaults {
|
my $currusecredits = 0; |
my $currusecredits = 0; |
my $postsubmitclient = 1; |
my $postsubmitclient = 1; |
my $ltiauth = 0; |
my $ltiauth = 0; |
|
my %domexttool; |
|
my %exttool; |
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'}) { |
$ltiauth = 1; |
$ltiauth = 1; |
} |
} |
|
if (ref($settings->{'domexttool'}) eq 'HASH') { |
|
foreach my $type (@types) { |
|
if ($settings->{'domexttool'}->{$type}) { |
|
$domexttool{$type} = ' checked="checked"'; |
|
} |
|
} |
|
} else { |
|
foreach my $type (@types) { |
|
if ($staticdefaults{'domexttool'}) { |
|
$domexttool{$type} = ' checked="checked"'; |
|
} |
|
} |
|
} |
|
if (ref($settings->{'exttool'}) eq 'HASH') { |
|
foreach my $type (@types) { |
|
if ($settings->{'exttool'}->{$type}) { |
|
$exttool{$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 6925 sub print_coursedefaults {
|
Line 6951 sub print_coursedefaults {
|
} else { |
} else { |
foreach my $type (@types) { |
foreach my $type (@types) { |
$deftimeout{$type} = $staticdefaults{'postsubmit'}; |
$deftimeout{$type} = $staticdefaults{'postsubmit'}; |
|
if ($staticdefaults{'domexttool'}) { |
|
$domexttool{$type} = ' checked="checked"'; |
|
} |
} |
} |
} |
} |
if (!$currdefresponder) { |
if (!$currdefresponder) { |
Line 7028 sub print_coursedefaults {
|
Line 7057 sub print_coursedefaults {
|
&radiobutton_prefs($current,\@toggles,\%defaultchecked, |
&radiobutton_prefs($current,\@toggles,\%defaultchecked, |
\%choices,$itemcount,undef,undef,'left'); |
\%choices,$itemcount,undef,undef,'left'); |
$datatable .= $table; |
$datatable .= $table; |
|
$css_class = $itemcount%2 ? ' class="LC_odd_row"' : ''; |
|
$datatable .= '<tr'.$css_class.'><td><span class="LC_nobreak">'. |
|
$choices{'domexttool'}. |
|
'</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="domexttool"'. |
|
' value="'.$type.'"'.$domexttool{$type}.' />'. |
|
&mt($type).'</span></td>'."\n"; |
|
} |
|
$datatable .= '</tr></table></td></tr>'."\n"; |
$itemcount ++; |
$itemcount ++; |
|
$css_class = $itemcount%2 ? ' class="LC_odd_row"' : ''; |
|
$datatable .= '<tr'.$css_class.'><td><span class="LC_nobreak">'. |
|
$choices{'exttool'}. |
|
'</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="exttool"'. |
|
' value="'.$type.'"'.$exttool{$type}.' />'. |
|
&mt($type).'</span></td>'."\n"; |
|
} |
|
$datatable .= '</tr></table></td></tr>'."\n"; |
} |
} |
$$rowtotal += $itemcount; |
$$rowtotal += $itemcount; |
return $datatable; |
return $datatable; |
Line 20212 sub modify_coursedefaults {
|
Line 20269 sub modify_coursedefaults {
|
uploadquota => 500, |
uploadquota => 500, |
postsubmit => 60, |
postsubmit => 60, |
mysqltables => 172800, |
mysqltables => 172800, |
|
domexttool => 1, |
); |
); |
my %texoptions = ( |
my %texoptions = ( |
MathJax => 'MathJax', |
MathJax => 'MathJax', |
Line 20403 sub modify_coursedefaults {
|
Line 20461 sub modify_coursedefaults {
|
$changes{'postsubmit'} = 1; |
$changes{'postsubmit'} = 1; |
} |
} |
} |
} |
|
my (%newdomexttool,%newexttool,%olddomexttool,%oldexttool); |
|
map { $newdomexttool{$_} = 1; } &Apache::loncommon::get_env_multiple('form.domexttool'); |
|
map { $newexttool{$_} = 1; } &Apache::loncommon::get_env_multiple('form.exttool'); |
|
if (ref($domconfig{'coursedefaults'}{'domexttool'}) eq 'HASH') { |
|
%olddomexttool = %{$domconfig{'coursedefaults'}{'domexttool'}}; |
|
} else { |
|
foreach my $type (@types) { |
|
if ($staticdefaults{'domexttool'}) { |
|
$olddomexttool{$type} = 1; |
|
} else { |
|
$olddomexttool{$type} = 0; |
|
} |
|
} |
|
} |
|
if (ref($domconfig{'coursedefaults'}{'exttool'}) eq 'HASH') { |
|
%oldexttool = %{$domconfig{'coursedefaults'}{'exttool'}}; |
|
} else { |
|
foreach my $type (@types) { |
|
if ($staticdefaults{'exttool'}) { |
|
$oldexttool{$type} = 1; |
|
} else { |
|
$oldexttool{$type} = 0; |
|
} |
|
} |
|
} |
|
foreach my $type (@types) { |
|
unless ($newdomexttool{$type}) { |
|
$newdomexttool{$type} = 0; |
|
} |
|
unless ($newexttool{$type}) { |
|
$newexttool{$type} = 0; |
|
} |
|
if ($newdomexttool{$type} != $olddomexttool{$type}) { |
|
$changes{'domexttool'} = 1; |
|
} |
|
if ($newexttool{$type} != $oldexttool{$type}) { |
|
$changes{'exttool'} = 1; |
|
} |
|
} |
|
$defaultshash{'coursedefaults'}{'domexttool'} = \%newdomexttool; |
|
$defaultshash{'coursedefaults'}{'exttool'} = \%newexttool; |
} |
} |
my $putresult = &Apache::lonnet::put_dom('configuration',\%defaultshash, |
my $putresult = &Apache::lonnet::put_dom('configuration',\%defaultshash, |
$dom); |
$dom); |
Line 20412 sub modify_coursedefaults {
|
Line 20511 sub modify_coursedefaults {
|
if (($changes{'canuse_pdfforms'}) || ($changes{'uploadquota'}) || ($changes{'postsubmit'}) || |
if (($changes{'canuse_pdfforms'}) || ($changes{'uploadquota'}) || ($changes{'postsubmit'}) || |
($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{'inline_chem'}) || ($changes{'ltiauth'}) || ($changes{'domexttool'}) || |
foreach my $item ('canuse_pdfforms','uselcmath','usejsme','inline_chem','texengine','ltiauth') { |
($changes{'exttool'}) ) { |
|
foreach my $item ('canuse_pdfforms','uselcmath','usejsme','inline_chem','texengine', |
|
'ltiauth') { |
if ($changes{$item}) { |
if ($changes{$item}) { |
$domdefaults{$item}=$defaultshash{'coursedefaults'}{$item}; |
$domdefaults{$item}=$defaultshash{'coursedefaults'}{$item}; |
} |
} |
Line 20456 sub modify_coursedefaults {
|
Line 20557 sub modify_coursedefaults {
|
$domdefaults{'canclone'}=$defaultshash{'coursedefaults'}{'canclone'}; |
$domdefaults{'canclone'}=$defaultshash{'coursedefaults'}{'canclone'}; |
} |
} |
} |
} |
|
if ($changes{'domexttool'}) { |
|
if (ref($defaultshash{'coursedefaults'}{'domexttool'}) eq 'HASH') { |
|
foreach my $type (@types) { |
|
$domdefaults{$type.'domexttool'}=$defaultshash{'coursedefaults'}{'domexttool'}{$type}; |
|
} |
|
} |
|
} |
|
if ($changes{'exttool'}) { |
|
if (ref($defaultshash{'coursedefaults'}{'exttool'}) eq 'HASH') { |
|
foreach my $type (@types) { |
|
$domdefaults{$type.'exttool'}=$defaultshash{'coursedefaults'}{'exttool'}{$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 20593 sub modify_coursedefaults {
|
Line 20708 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') { |
|
my @noyes = (&mt('no'),&mt('yes')); |
|
if (ref($defaultshash{'coursedefaults'}{'domexttool'}) eq 'HASH') { |
|
$resulttext .= '<li>'.&mt('External Tools defined in the domain may be used as follows:').'<ul>'. |
|
'<li>'.&mt('Official courses: [_1]','<b>'.$noyes[$defaultshash{'coursedefaults'}{'domexttool'}{'official'}].'</b>').'</li>'. |
|
'<li>'.&mt('Unofficial courses: [_1]','<b>'.$noyes[$defaultshash{'coursedefaults'}{'domexttool'}{'unofficial'}].'</b>').'</li>'. |
|
'<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>'. |
|
'<li>'.&mt('Communities: [_1]','<b>'.$noyes[$defaultshash{'coursedefaults'}{'domexttool'}{'community'}].'</b>').'</li>'. |
|
'</ul>'. |
|
'</li>'; |
|
} else { |
|
$resulttext .= '<li>'.&mt('External Tools defined in the domain may be used in all course types, by default').'</li>'; |
|
} |
|
} 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>'. |
|
'<li>'.&mt('Official courses: [_1]','<b>'.$noyes[$defaultshash{'coursedefaults'}{'exttool'}{'official'}].'</b>').'</li>'. |
|
'<li>'.&mt('Unofficial courses: [_1]','<b>'.$noyes[$defaultshash{'coursedefaults'}{'exttool'}{'unofficial'}].'</b>').'</li>'. |
|
'<li>'.&mt('Textbook courses: [_1]','<b>'.$noyes[$defaultshash{'coursedefaults'}{'exttool'}{'textbook'}].'</b>').'</li>'. |
|
'<li>'.&mt('Placement tests: [_1]','<b>'.$noyes[$defaultshash{'coursedefaults'}{'exttool'}{'placement'}].'</b>').'</li>'. |
|
'<li>'.&mt('Communities: [_1]','<b>'.$noyes[$defaultshash{'coursedefaults'}{'exttool'}{'community'}].'</b>').'</li>'. |
|
'</ul>'. |
|
'</li>'; |
|
} else { |
|
$resulttext .= '<li>'.&mt('External Tools can not be defined in any course types, by default').'</li>'; |
|
} |
} |
} |
} |
} |
$resulttext .= '</ul>'; |
$resulttext .= '</ul>'; |