--- loncom/interface/domainprefs.pm 2023/09/06 13:57:05 1.429
+++ loncom/interface/domainprefs.pm 2025/01/11 16:10:31 1.447.2.1
@@ -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.447.2.1 2025/01/11 16:10:31 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -222,10 +222,10 @@ sub handler {
'coursedefaults','usersessions','loadbalancing',
'requestauthor','selfenrollment','inststatus',
'ltitools','toolsec','ssl','trust','lti','ltisec',
- 'privacy','passwords','proctoring','wafproxy',
+ 'privacy','passwords','wafproxy',
'ipaccess','authordefaults'],$dom);
my %encconfig =
- &Apache::lonnet::get_dom('encconfig',['ltitools','lti','proctoring','linkprot'],$dom,undef,1);
+ &Apache::lonnet::get_dom('encconfig',['ltitools','lti','linkprot'],$dom,undef,1);
my ($checked_is_home,$is_home);
if (ref($domconfig{'ltitools'}) eq 'HASH') {
if (ref($encconfig{'ltitools'}) eq 'HASH') {
@@ -288,24 +288,12 @@ sub handler {
}
}
}
- if (ref($domconfig{'proctoring'}) eq 'HASH') {
- if (ref($encconfig{'proctoring'}) eq 'HASH') {
- foreach my $provider (keys(%{$domconfig{'proctoring'}})) {
- if ((ref($domconfig{'proctoring'}{$provider}) eq 'HASH') &&
- (ref($encconfig{'proctoring'}{$provider}) eq 'HASH')) {
- foreach my $item ('key','secret') {
- $domconfig{'proctoring'}{$provider}{$item} = $encconfig{'proctoring'}{$provider}{$item};
- }
- }
- }
- }
- }
my @prefs_order = ('rolecolors','login','ipaccess','defaults','wafproxy','passwords',
'quotas','autoenroll','autoupdate','autocreate','directorysrch',
'contacts','privacy','usercreation','selfcreation',
'usermodification','scantron','requestcourses','requestauthor',
'coursecategories','serverstatuses','helpsettings','coursedefaults',
- 'authordefaults','ltitools','proctoring','selfenrollment',
+ 'authordefaults','ltitools','selfenrollment',
'usersessions','ssl','trust','lti');
my %existing;
if (ref($domconfig{'loadbalancing'}) eq 'HASH') {
@@ -386,7 +374,7 @@ sub handler {
help => 'Domain_Configuration_Quotas',
header => [{col1 => 'User affiliation',
col2 => 'Available tools',
- col3 => 'Portfilo quota (MB)',}],
+ col3 => 'Portfolio quota (MB)',}],
print => \&print_quotas,
modify => \&modify_quotas,
},
@@ -472,6 +460,8 @@ sub handler {
header => [{col1 => 'Target user has role',
col2 => 'User information updatable in author context'},
{col1 => 'Target user has role',
+ col2 => 'User information updatable by co-author manager'},
+ {col1 => 'Target user has role',
col2 => 'User information updatable in course context'}],
print => \&print_usermodification,
modify => \&modify_usermodification,
@@ -616,14 +606,6 @@ sub handler {
print => \&print_ltitools,
modify => \&modify_ltitools,
},
- 'proctoring' =>
- {text => 'Remote Proctoring Integration',
- help => 'Domain_Configuration_Proctoring',
- header => [{col1 => 'Name',
- col2 => 'Configuration'}],
- print => \&print_proctoring,
- modify => \&modify_proctoring,
- },
'ssl' =>
{text => 'LON-CAPA Network (SSL)',
help => 'Domain_Configuration_Network_SSL',
@@ -669,6 +651,8 @@ sub handler {
col2 => 'Settings'},
{col1 => 'Rules for shared secrets',
col2 => 'Settings'},
+ {col1 => 'Link Protectors in Courses',
+ col2 => 'Values'},
{col1 => 'Link Protectors',
col2 => 'Settings'},
{col1 => 'Consumers',
@@ -684,7 +668,7 @@ sub handler {
print => \&print_ipaccess,
modify => \&modify_ipaccess,
},
- 'authordefaults' =>
+ 'authordefaults' =>
{text => 'Authoring Space defaults',
help => 'Domain_Configuration_Author_Defaults',
header => [{col1 => 'Defaults which can be overridden by Author',
@@ -883,8 +867,6 @@ sub process_changes {
$output = &modify_loadbalancing($dom,%domconfig);
} elsif ($action eq 'ltitools') {
$output = &modify_ltitools($r,$dom,$action,$lastactref,%domconfig);
- } elsif ($action eq 'proctoring') {
- $output = &modify_proctoring($r,$dom,$action,$lastactref,%domconfig);
} elsif ($action eq 'ssl') {
$output = &modify_ssl($dom,$lastactref,%domconfig);
} elsif ($action eq 'trust') {
@@ -936,8 +918,6 @@ sub print_config_box {
} elsif ($action eq 'lti') {
$output .= &passwords_javascript('ltisecrets')."\n".
<i_javascript($dom,$settings);
- } elsif ($action eq 'proctoring') {
- $output .= &proctoring_javascript($settings);
} elsif ($action eq 'wafproxy') {
$output .= &wafproxy_javascript($dom);
} elsif ($action eq 'autoupdate') {
@@ -1029,7 +1009,7 @@ sub print_config_box {
($action eq 'usersessions') || ($action eq 'coursecategories') ||
($action eq 'trust') || ($action eq 'contacts') || ($action eq 'defaults') ||
($action eq 'privacy') || ($action eq 'passwords') || ($action eq 'lti') ||
- ($action eq 'ltitools')) {
+ ($action eq 'ltitools') || ($action eq 'usermodification')) {
if ($action eq 'coursecategories') {
$output .= &print_coursecategories('middle',$dom,$item,$settings,\$rowtotal);
$colspan = ' colspan="2"';
@@ -1037,6 +1017,19 @@ sub print_config_box {
$output .= $item->{'print'}->('shared',$dom,$settings,\$rowtotal);
} elsif ($action eq 'passwords') {
$output .= $item->{'print'}->('middle',$dom,$confname,$settings,\$rowtotal);
+ } elsif ($action eq 'lti') {
+ $output .= $item->{'print'}->('upper',$dom,$settings,\$rowtotal).'
+
+
+
+
+
+
+
+ '.&mt($item->{'header'}->[2]->{'col1'}).' |
+ '.&mt($item->{'header'}->[2]->{'col2'}).' |
+ '."\n".
+ $item->{'print'}->('middle',$dom,$settings,\$rowtotal);
} else {
$output .= $item->{'print'}->('middle',$dom,$settings,\$rowtotal);
}
@@ -1069,6 +1062,10 @@ sub print_config_box {
'.&mt($item->{'header'}->[8]->{'col2'}).' | '.
$item->{'print'}->('bottom',$dom,$settings,\$rowtotal);
} else {
+ my $hdridx = 2;
+ if ($action eq 'lti') {
+ $hdridx = 3;
+ }
$output .= '
|
@@ -1077,8 +1074,8 @@ sub print_config_box {
- '.&mt($item->{'header'}->[2]->{'col1'}).' |
- '.&mt($item->{'header'}->[2]->{'col2'}).' |
+ '.&mt($item->{'header'}->[$hdridx]->{'col1'}).' |
+ '.&mt($item->{'header'}->[$hdridx]->{'col2'}).' |
'."\n";
if ($action eq 'coursecategories') {
$output .= &print_coursecategories('bottom',$dom,$item,$settings,\$rowtotal);
@@ -1089,6 +1086,7 @@ sub print_config_box {
} else {
$output .= $item->{'print'}->('lower',$dom,$settings,\$rowtotal);
}
+ $hdridx ++;
$output .= '
@@ -1098,8 +1096,8 @@ sub print_config_box {
|
- '.&mt($item->{'header'}->[3]->{'col1'}).' |
- '.&mt($item->{'header'}->[3]->{'col2'}).' | '."\n";
+ '.&mt($item->{'header'}->[$hdridx]->{'col1'}).' |
+ '.&mt($item->{'header'}->[$hdridx]->{'col2'}).' | '."\n";
if ($action eq 'passwords') {
$output .= $item->{'print'}->('bottom',$dom,$confname,$settings,\$rowtotal);
} else {
@@ -1115,9 +1113,9 @@ sub print_config_box {
}
}
$rowtotal ++;
- } elsif (($action eq 'usermodification') || ($action eq 'coursedefaults') ||
+ } elsif (($action eq 'coursedefaults') || ($action eq 'authordefaults') ||
($action eq 'directorysrch') || ($action eq 'helpsettings') ||
- ($action eq 'wafproxy') || ($action eq 'authordefaults')) {
+ ($action eq 'wafproxy')) {
$output .= $item->{'print'}->('bottom',$dom,$settings,\$rowtotal);
} elsif ($action eq 'scantron') {
$output .= $item->{'print'}->($r,'bottom',$dom,$confname,$settings,\$rowtotal);
@@ -1320,7 +1318,7 @@ sub print_config_box {
$output .= &print_quotas($dom,$settings,\$rowtotal,$action);
} elsif (($action eq 'autoenroll') || ($action eq 'autocreate') ||
($action eq 'serverstatuses') || ($action eq 'loadbalancing') ||
- ($action eq 'proctoring') || ($action eq 'ipaccess')) {
+ ($action eq 'ipaccess')) {
$output .= $item->{'print'}->($dom,$settings,\$rowtotal);
}
}
@@ -1987,10 +1985,11 @@ sub commblocktype_text {
'passwd' => 'Change Password',
'grades' => 'Gradebook',
'search' => 'Course search',
+ 'index' => 'Course content index',
'wishlist' => 'Stored links',
'annotate' => 'Annotations',
);
- my $typeorder = ['com','chat','boards','port','groups','blogs','about','wishlist','printout','grades','search','annotate','passwd'];
+ my $typeorder = ['com','chat','boards','port','groups','blogs','about','wishlist','printout','grades','search','index','annotate','passwd'];
return ($typeorder,\%types);
}
@@ -1999,7 +1998,7 @@ sub print_rolecolors {
my %choices = &color_font_choices();
my @bgs = ('pgbg','tabbg','sidebg');
my @links = ('link','alink','vlink');
- my @images = ('img');
+ my @images = ();
my %alt_text = &Apache::lonlocal::texthash(img => "Banner for $role role");
my %designhash = &Apache::loncommon::get_domainconf($dom);
my %defaultdesign = %Apache::loncommon::defaultdesign;
@@ -2007,10 +2006,6 @@ sub print_rolecolors {
my %defaults = &role_defaults($role,\@bgs,\@links,\@images);
if (ref($settings) eq 'HASH') {
if (ref($settings->{$role}) eq 'HASH') {
- if ($settings->{$role}->{'img'} ne '') {
- $designs{'img'} = $settings->{$role}->{'img'};
- $is_custom{'img'} = 1;
- }
if ($settings->{$role}->{'font'} ne '') {
$designs{'font'} = $settings->{$role}->{'font'};
$is_custom{'font'} = 1;
@@ -2033,10 +2028,6 @@ sub print_rolecolors {
}
}
} else {
- if ($designhash{$dom.'.'.$role.'.img'} ne '') {
- $designs{img} = $designhash{$dom.'.'.$role.'.img'};
- $is_custom{'img'} = 1;
- }
if ($designhash{$dom.'.'.$role.'.fontmenu'} ne '') {
$designs{fontmenu} = $designhash{$dom.'.'.$role.'.fontmenu'};
$is_custom{'fontmenu'} = 1;
@@ -2086,7 +2077,6 @@ sub role_defaults {
}
} else {
%defaults = (
- img => $defaultdesign{$role.'.img'},
font => $defaultdesign{$role.'.font'},
fontmenu => $defaultdesign{$role.'.fontmenu'},
);
@@ -2425,7 +2415,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') {
@@ -6176,7 +6166,7 @@ sub print_lti {
my ($position,$dom,$settings,$rowtotal) = @_;
my $itemcount = 1;
my ($datatable,$css_class);
- my (%rules,%encrypt,%privkeys,%linkprot);
+ my (%rules,%encrypt,%privkeys,%linkprot,%suggestions);
if (ref($settings) eq 'HASH') {
if ($position eq 'top') {
if (exists($settings->{'encrypt'})) {
@@ -6199,12 +6189,18 @@ sub print_lti {
}
}
}
- } elsif ($position eq 'middle') {
+ } elsif ($position eq 'upper') {
if (exists($settings->{'rules'})) {
if (ref($settings->{'rules'}) eq 'HASH') {
%rules = %{$settings->{'rules'}};
}
}
+ } elsif ($position eq 'middle') {
+ if (exists($settings->{'suggested'})) {
+ if (ref($settings->{'suggested'}) eq 'HASH') {
+ %suggestions = %{$settings->{'suggested'}};
+ }
+ }
} elsif ($position eq 'lower') {
if (exists($settings->{'linkprot'})) {
if (ref($settings->{'linkprot'}) eq 'HASH') {
@@ -6215,7 +6211,7 @@ sub print_lti {
}
}
} else {
- foreach my $key ('encrypt','private','rules','linkprot') {
+ foreach my $key ('encrypt','private','rules','linkprot','suggestions') {
if (exists($settings->{$key})) {
delete($settings->{$key});
}
@@ -6224,11 +6220,14 @@ sub print_lti {
}
if ($position eq 'top') {
$datatable = &secrets_form($dom,'ltisec',\%encrypt,\%privkeys,$rowtotal);
- } elsif ($position eq 'middle') {
+ } elsif ($position eq 'upper') {
$datatable = &password_rules('ltisecrets',\$itemcount,\%rules);
$$rowtotal += $itemcount;
+ } elsif ($position eq 'middle') {
+ $datatable = &linkprot_suggestions(\%suggestions,\$itemcount);
+ $$rowtotal += $itemcount;
} elsif ($position eq 'lower') {
- $datatable .= &Apache::courseprefs::print_linkprotection($dom,'',$settings,$rowtotal,'','','domain');
+ $datatable .= &Apache::courseprefs::print_linkprotection($dom,'',$settings,$rowtotal,'','','domain');
} else {
my ($switchserver,$switchmessage);
$switchserver = &check_switchserver($dom);
@@ -6815,6 +6814,58 @@ sub ltimenu_titles {
);
}
+sub linkprot_suggestions {
+ my ($suggested,$itemcount) = @_;
+ my $count = 0;
+ my $next = 1;
+ my %lt = &Apache::lonlocal::texthash(
+ 'name' => 'Suggested Launcher',
+ 'info' => 'Recommendations',
+ );
+ my ($datatable,$css_class,$dest);
+ if (ref($suggested) eq 'HASH') {
+ my @current = sort { $a <=> $b } keys(%{$suggested});
+ $next += $current[-1];
+ for (my $i=0; $i<@current; $i++) {
+ my $num = $current[$i];
+ my %values;
+ if (ref($suggested->{$num}) eq 'HASH') {
+ %values = %{$suggested->{$num}};
+ } else {
+ next;
+ }
+ $css_class = $$itemcount%2?' class="LC_odd_row"':'';
+ $datatable .=
+ ''."\n".
+ ' | '."\n".
+ ''.
+ ''.
+ ''."\n".
+ ' | '."\n";
+ $$itemcount ++;
+ }
+ }
+ $css_class = $$itemcount%2?' class="LC_odd_row"':'';
+ $datatable .= ''."\n".
+ ''."\n".
+ ''.&mt('Add').' | '."\n".
+ ''."\n".
+ ''.
+ ''.
+ ''."\n".
+ ' | '."\n";
+ return $datatable;
+}
+
sub print_coursedefaults {
my ($position,$dom,$settings,$rowtotal) = @_;
my ($css_class,$datatable,%checkedon,%checkedoff,%defaultchecked,@toggles);
@@ -6822,7 +6873,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 +6886,8 @@ 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)',
+ crseditors => 'Available editors for web pages and/or problems created in a course/community',
);
my %staticdefaults = (
anonsurvey_threshold => 10,
@@ -6844,6 +6897,8 @@ sub print_coursedefaults {
mysqltables => 172800,
domexttool => 1,
exttool => 0,
+ crsauthor => 1,
+ crseditors => ['edit','xml'],
);
if ($position eq 'top') {
%defaultchecked = (
@@ -6964,6 +7019,8 @@ sub print_coursedefaults {
my $ltiauth = 0;
my %domexttool;
my %exttool;
+ my %crsauthor;
+ my %crseditors;
my @types = ('official','unofficial','community','textbook','placement');
if (ref($settings) eq 'HASH') {
if ($settings->{'ltiauth'}) {
@@ -6989,6 +7046,28 @@ 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"';
+ }
+ }
+ }
+ if (ref($settings->{'crseditors'}) eq 'ARRAY') {
+ foreach my $editor (@{$settings->{'crseditors'}}) {
+ $crseditors{$editor} = ' checked="checked"';
+ }
+ } else {
+ foreach my $editor (@{$staticdefaults{'crseditors'}}) {
+ $crseditors{$editor} = ' checked="checked"';
+ }
+ }
$currdefresponder = $settings->{'anonsurvey_threshold'};
if (ref($settings->{'uploadquota'}) eq 'HASH') {
foreach my $type (keys(%{$settings->{'uploadquota'}})) {
@@ -7048,6 +7127,12 @@ sub print_coursedefaults {
if ($staticdefaults{'domexttool'}) {
$domexttool{$type} = ' checked="checked"';
}
+ if ($staticdefaults{'crsauthor'}) {
+ $crsauthor{$type} = ' checked="checked"';
+ }
+ }
+ foreach my $editor (@{$staticdefaults{'crseditors'}}) {
+ $crseditors{$editor} = ' checked="checked"';
}
}
if (!$currdefresponder) {
@@ -7176,9 +7261,9 @@ sub print_coursedefaults {
foreach my $type (@types) {
$datatable .= ''.
''.
- ''.
- &mt($type).' | '."\n";
+ &mt($type).''."\n";
}
$datatable .= ' |
'."\n";
$itemcount ++;
@@ -7191,9 +7276,41 @@ sub print_coursedefaults {
foreach my $type (@types) {
$datatable .= ''.
''.
- ''.
- &mt($type).' | '."\n";
+ &mt($type).''."\n";
+ }
+ $datatable .= ''."\n";
+ $itemcount ++;
+ $css_class = $itemcount%2 ? ' class="LC_odd_row"' : '';
+ $datatable .= ''.
+ $choices{'crsauthor'}.
+ ' | '.
+ ''.
+ ' |
'."\n";
+ $itemcount ++;
+ $css_class = $itemcount%2 ? ' class="LC_odd_row"' : '';
+ $datatable .= ''.
+ $choices{'crseditors'}.
+ ' | '.
+ ''.
+ ' |
'."\n";
}
@@ -7201,6 +7318,14 @@ sub print_coursedefaults {
return $datatable;
}
+sub crseditor_titles {
+ return &Apache::lonlocal::texthash(
+ edit => 'Standard editor (Edit)',
+ xml => 'Text editor (EditXML)',
+ daxe => 'Daxe editor (Daxe)',
+ );
+}
+
sub print_authordefaults {
my ($position,$dom,$settings,$rowtotal) = @_;
my ($css_class,$datatable,%checkedon,%checkedoff);
@@ -7209,9 +7334,10 @@ sub print_authordefaults {
if ($position eq 'top') {
my %defaultchecked = (
'nocodemirror' => 'off',
+ 'daxecollapse' => 'off',
'domcoordacc' => 'on',
);
- my @toggles = ('nocodemirror','domcoordacc');
+ my @toggles = ('nocodemirror','daxecollapse','domcoordacc');
($datatable,$itemcount) = &radiobutton_prefs($settings,\@toggles,\%defaultchecked,
\%titles,$itemcount);
my %staticdefaults = (
@@ -7330,7 +7456,7 @@ sub print_authordefaults {
my $checkedno = ' checked="checked"';
my ($checkedon,$checkedoff);
if (ref($quotas{'webdav'}) eq 'HASH') {
- if ($quotas{'webdav'}{'_LC_adv'} =~ /^0|1$/) {
+ if ($quotas{'webdav'}{'_LC_adv'} =~ /^0|1$/) {
if ($quotas{'webdav'}{'_LC_adv'}) {
$checkedon = $checkedno;
} else {
@@ -7359,7 +7485,7 @@ sub print_authordefaults {
$text = $titles{'overon'};
$val = 1;
$checked = $checkedon;
- }
+ }
$datatable .= '