--- loncom/interface/domainprefs.pm 2023/09/06 13:57:05 1.429 +++ loncom/interface/domainprefs.pm 2024/01/02 02:34:06 1.433 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set domain-wide configuration settings # -# $Id: domainprefs.pm,v 1.429 2023/09/06 13:57:05 raeburn Exp $ +# $Id: domainprefs.pm,v 1.433 2024/01/02 02:34:06 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -2425,7 +2425,7 @@ sub print_quotas { @options = ('norequest','approval','automatic'); %titles = &authorrequest_titles(); } else { - @usertools = ('aboutme','blog','portfolio','timezone'); + @usertools = ('aboutme','blog','portfolio','portaccess','timezone'); %titles = &tool_titles(); } if (ref($types) eq 'ARRAY') { @@ -6822,7 +6822,7 @@ sub print_coursedefaults { 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)', - 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', coursecredits => 'Credits can be specified for courses', uselcmath => 'Math preview uses LON-CAPA previewer (javascript) in place of DragMath (Java)', @@ -6835,6 +6835,7 @@ sub print_coursedefaults { 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)', + crsauthor => 'Standard LON-CAPA problems can be created within a course/community (by type)', ); my %staticdefaults = ( anonsurvey_threshold => 10, @@ -6844,6 +6845,7 @@ sub print_coursedefaults { mysqltables => 172800, domexttool => 1, exttool => 0, + crsauthor => 1, ); if ($position eq 'top') { %defaultchecked = ( @@ -6964,6 +6966,7 @@ sub print_coursedefaults { my $ltiauth = 0; my %domexttool; my %exttool; + my %crsauthor; my @types = ('official','unofficial','community','textbook','placement'); if (ref($settings) eq 'HASH') { if ($settings->{'ltiauth'}) { @@ -6989,6 +6992,19 @@ 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'}; if (ref($settings->{'uploadquota'}) eq 'HASH') { foreach my $type (keys(%{$settings->{'uploadquota'}})) { @@ -7048,6 +7064,9 @@ sub print_coursedefaults { if ($staticdefaults{'domexttool'}) { $domexttool{$type} = ' checked="checked"'; } + if ($staticdefaults{'crsauthor'}) { + $crsauthor{$type} = ' checked="checked"'; + } } } if (!$currdefresponder) { @@ -7196,6 +7215,21 @@ sub print_coursedefaults { &mt($type).''."\n"; } $datatable .= ''."\n"; + $itemcount ++; + $css_class = $itemcount%2 ? ' class="LC_odd_row"' : ''; + $datatable .= ''. + $choices{'crsauthor'}. + ''. + ''. + ''; + foreach my $type (@types) { + $datatable .= ''."\n"; + } + $datatable .= '
'. + ''. + ''. + &mt($type).'
'."\n"; } $$rowtotal += $itemcount; return $datatable; @@ -8335,8 +8369,10 @@ sub print_wafproxy { my $dom_in_effect; my $aliasrows = ''. ''. - &mt('Hostname').': '. - ''.&Apache::lonnet::hostname($server).' '; + &mt('Hostname').': '. + ''. + &Apache::lonnet::hostname($server). + ' '; if ($othercontrol{$server}) { $dom_in_effect = $othercontrol{$server}; my ($current,$forsaml); @@ -9652,6 +9688,7 @@ sub tool_titles { aboutme => 'Personal web page', blog => 'Blog', portfolio => 'Portfolio', + portaccess => 'Share portfolio files', timezone => 'Can set time zone', official => 'Official courses (with institutional codes)', unofficial => 'Unofficial courses', @@ -13391,9 +13428,9 @@ sub modify_authordefaults { my $resulttext; if ($putresult eq 'ok') { if (keys(%changes)) { + my %domdefaults = &Apache::lonnet::get_domain_defaults($dom); if ((exists($changes{'authorquota'})) || (exists($changes{'webdav'})) || ($changes{'webdav_LC_adv'})) { - my %domdefaults = &Apache::lonnet::get_domain_defaults($dom,1); if ((exists($changes{'authorquota'})) && (ref($save_quotas{'authorquota'}) eq 'HASH')) { $domdefaults{'authorquota'} = $save_quotas{'authorquota'}; } @@ -13401,16 +13438,12 @@ sub modify_authordefaults { (ref($save_quotas{'webdav'}) eq 'HASH')) { $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:').'