--- loncom/homework/functionplotresponse.pm	2013/12/03 14:54:29	1.104
+++ loncom/homework/functionplotresponse.pm	2024/06/06 15:55:19	1.112
@@ -1,7 +1,7 @@
 # LearningOnline Network with CAPA
 # Functionplot responses
 #
-# $Id: functionplotresponse.pm,v 1.104 2013/12/03 14:54:29 bisitz Exp $
+# $Id: functionplotresponse.pm,v 1.112 2024/06/06 15:55:19 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -56,11 +56,8 @@ sub useHTML5 {
     } elsif ($env{'browser.type'} eq 'safari') {
         if ($env{'browser.os'} eq 'mac') {
             my ($prefix,$version) = ($env{'browser.version'} =~ /^(\d*)(\d{3})\./); 
-            if ((!$env{'browser.mobile'}) || 
-                (($env{'browser.mobile'}) && length($prefix))) {
-                if ($version >= 536) {
-                    return 1;
-                }
+            if ($version >= 536) {
+                return 1;
             }
         }
     } elsif ($env{'browser.type'} eq 'mozilla') {
@@ -76,6 +73,10 @@ sub useHTML5 {
         if (($env{'browser.os'} eq 'win') && ($env{'browser.version'} >= 10)) {
             return 1;
         }
+    } elsif ($env{'browser.type'} eq 'opera') {
+        if ($env{'browser.version'} >= 18) {
+            return 1;
+        }
     }
     return 0;
 }
@@ -158,9 +159,11 @@ sub html5_geogebra_startcode {
     unless ($height) { $height=400; }
     my $code=&geogebra_internal_program();
     return (<<ENDSTARTCODE);
+<div class="LC_left_float" style="margin:0; width:100%;">
 <article class="geogebraweb" data-param-enableLabelDrags="false" data-param-enableShiftDragZoom="false" 
 data-param-width="$width" data-param-height="$height" data-param-id="ggbApplet$appid" 
-data-param-ggbbase64="$code"></article>
+data-param-useBrowserForJS="true" data-param-ggbbase64="$code"></article>
+</div><div style="padding:0;clear:both;margin:0;border:0"></div>
 ENDSTARTCODE
 }
 
@@ -183,7 +186,7 @@ sub java_geogebra_default_parameters {
         <param name="boxborder" value="false"  />
         <param name="centerimage" value="true"  />
 	<param name="cache_archive" value="geogebra.jar, geogebra_main.jar, geogebra_gui.jar, geogebra_cas.jar, geogebra_export.jar, geogebra_algos.jar, geogebra_javascript.jar, geogebra_properties.jar, jlatexmath.jar, jlm_cyrillic.jar, jlm_greek.jar" />
-	<param name="cache_version" value="4.0.1.0,4.0.1.0,4.0.1.0,4.0.1.0,4.0.1.0,4.0.1.0,4.0.1.0,4.0.1.0,4.0.1.0,4.0.1.0,4.0.1.0" />
+	<param name="cache_version" value="4.4.3.0,4.4.3.0,4.4.3.0,4.4.3.0,4.4.3.0,4.4.3.0,4.4.3.0,4.4.3.0,4.4.3.0,4.4.3.0,4.4.3.0" />
         <param name="framePossible" value="false" />
 
         <param name="showResetIcon" value="false" />
@@ -1456,7 +1459,7 @@ sub start_functionplotresponse {
   my $ylabel=&Apache::lonxml::get_param('ylabel',$parstack,$safeeval);
   if ($target eq 'edit') {
     $result.=&Apache::edit::start_table($token)
-       .'<tr><td><span class="LC_nobreak">'.&mt('Function Plot Question').'</span></td>'
+       .'<tr><td><span class="LC_nobreak">'.&Apache::loncommon::insert_folding_button().&mt('Function Plot Question').'</span></td>'
        .'<td><span class="LC_nobreak">'.&mt('Delete?').' '
        .&Apache::edit::deletelist($target,$token).'&nbsp;&nbsp;&nbsp;'
        .&Apache::edit::insertlist($target,$token).'&nbsp;&nbsp;&nbsp;'
@@ -2043,7 +2046,7 @@ sub start_functionplotruleset {
    my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
    if ($target eq 'edit') {
       return &Apache::edit::start_table($token).
-        '<tr><td><span class="LC_nobreak">'.&mt('Function Plot Rule Set').'</span></td>'
+        '<tr><td><span class="LC_nobreak">'.&Apache::loncommon::insert_folding_button().&mt('Function Plot Rule Set').'</span></td>'
        .'<td><span class="LC_nobreak">'.&mt('Delete?').' '
        .&Apache::edit::deletelist($target,$token).'&nbsp;&nbsp;&nbsp;'.
         &Apache::edit::insertlist($target,$token).'&nbsp;&nbsp;&nbsp;'
@@ -2236,7 +2239,8 @@ sub start_functionplotelements {
 
    if ($target eq 'edit') {
       return &Apache::edit::start_table($token).
-        '<tr><td><span class="LC_nobreak">'.&mt('Function Plot Elements').'</span></td>'
+        '<tr><td><span class="LC_nobreak">'.&Apache::loncommon::insert_folding_button()
+       .&mt('Function Plot Elements').'</span></td>'
        .'<td><span class="LC_nobreak">'.&mt('Delete?').' '
        .&Apache::edit::deletelist($target,$token).'&nbsp;&nbsp;&nbsp;'.
         &Apache::edit::insertlist($target,$token).'&nbsp;&nbsp;&nbsp;'