--- loncom/xml/lonxml.pm	2024/07/04 15:50:20	1.531.2.25
+++ loncom/xml/lonxml.pm	2024/07/07 21:43:24	1.531.2.26
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # XML Parser Module 
 #
-# $Id: lonxml.pm,v 1.531.2.25 2024/07/04 15:50:20 raeburn Exp $
+# $Id: lonxml.pm,v 1.531.2.26 2024/07/07 21:43:24 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1633,6 +1633,21 @@ sub renderingoptions {
     return $output;
 }
 
+sub setmode_javascript {
+    return <<"ENDSCRIPT";
+<script type="text/javascript">
+// <![CDATA[
+function setmode(form,probmode) {
+    var initial = form.problemmode.value;
+    form.problemmode.value = probmode;
+    form.submit();
+    form.problemmode.value = initial;
+}
+// ]]>
+</script>
+ENDSCRIPT
+}
+
 sub inserteditinfo {
       my ($filecontents,$filetype,$filename,$symb,$itemtitle,$folderpath,$uri,$action) = @_;
       $filecontents = &HTML::Entities::encode($filecontents,'<>&"');