--- loncom/interface/lonconfigsettings.pm	2023/10/06 21:19:46	1.21.4.13.2.11
+++ loncom/interface/lonconfigsettings.pm	2024/07/14 16:05:27	1.73
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to set domain-wide configuration settings
 #
-# $Id: lonconfigsettings.pm,v 1.21.4.13.2.11 2023/10/06 21:19:46 raeburn Exp $
+# $Id: lonconfigsettings.pm,v 1.73 2024/07/14 16:05:27 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -35,6 +35,7 @@ use Apache::lonnet;
 use Apache::loncommon();
 use Apache::lonhtmlcommon();
 use Apache::lonlocal;
+use Apache::lonparmset();
 use Apache::courseclassifier();
 use LONCAPA qw(:DEFAULT :match);
 use File::Copy;
@@ -288,6 +289,10 @@ $jscript
             if (grep(/^wafproxy$/,@actions)) {
                 $onload .= "toggleWAF();checkWAF();updateWAF();";
             }
+            if (grep(/^proctoring$/,@actions)) {
+                $onload .= "toggleProctoring(document.display,'proctorio');".
+                           "toggleProctoring(document.display,'examity');";
+            }
             if (grep(/^scantron$/,@actions)) {
                 $onload .= "toggleScantron(document.display);";
             }
@@ -405,6 +410,9 @@ $jscript
 <input type="hidden" name="pres_value" />
 </form>
 ');
+    if ($container) {
+       &Apache::lonparmset::startSettingsScreen($r,$container,$crstype);
+    }
     $r->print('<form method="post" name="'.$phase.'" action="'.$action.'"'.
               ' enctype="multipart/form-data">');
     return;
@@ -569,6 +577,9 @@ sub print_footer {
     }
     if ($phase eq 'process') {
         $r->print('</form>');
+        if ($container) {
+           &Apache::lonparmset::endSettingsScreen($r);
+        }
         $r->print(&Apache::loncommon::end_page());
     }
     return;
@@ -645,8 +656,8 @@ sub make_changes {
     if ($context eq 'course') {
         $footer_text = 'Back to display/edit settings'; 
     }
-    &print_footer($r,$phase,'display',$footer_text,\@actions,$container,$parm_permission);
     $r->print('</p>');
+    &print_footer($r,$phase,'display',$footer_text,\@actions,$container,$parm_permission);
     return \%lastact;
 }
 
@@ -676,12 +687,15 @@ sub display_settings {
                         if (ref($values) eq 'HASH') {
                             $settings = $values->{$item};
                         }
-                        if ($item eq 'usersessions') {
-                            $r->print('<script type="text/javascript">'."\n".
-                                      '// <![CDATA['."\n".
-                                      &Apache::loncommon::check_uncheck_jscript()."\n".
-                                      '// ]]>'."\n".
-                                      '</script>'."\n");
+                        if (($item eq 'usersessions') || ($item eq 'ssl')) {
+                            unless ($got_check_uncheck) {
+                                $r->print('<script type="text/javascript">'."\n".
+                                          '// <![CDATA['."\n".
+                                          &Apache::loncommon::check_uncheck_jscript()."\n".
+                                          '// ]]>'."\n".
+                                          '</script>'."\n");
+                                $got_check_uncheck = 1;
+                            }
                         } elsif ($item eq 'selfcreation') {
                             if (ref($values) eq 'HASH') {
                                 $settings = $values->{'usercreation'};
@@ -767,6 +781,9 @@ sub display_settings {
         }
         $r->print('</form>');
     }
+    if ($container) {
+        &Apache::lonparmset::endSettingsScreen($r);
+    }
     $r->print(&Apache::loncommon::end_page());
     return;
 }
@@ -829,6 +846,9 @@ sub display_choices {
     $r->print('</div><div style="padding:0;clear:both;margin:0;border:0"></div>');
     $r->print(&print_footer($r,$phase,'display','Display',undef,$container,$parm_permission));
     $r->print('</form>');
+    if ($container) {
+        &Apache::lonparmset::endSettingsScreen($r);
+    }
     $r->print(&Apache::loncommon::end_page());
     return;
 }