--- loncom/homework/functionplotresponse.pm 2012/08/17 13:08:11 1.98 +++ loncom/homework/functionplotresponse.pm 2013/12/17 00:33:42 1.105 @@ -1,7 +1,7 @@ # LearningOnline Network with CAPA # Functionplot responses # -# $Id: functionplotresponse.pm,v 1.98 2012/08/17 13:08:11 www Exp $ +# $Id: functionplotresponse.pm,v 1.105 2013/12/17 00:33:42 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -49,7 +49,35 @@ BEGIN { # Return a true value if HTML5 should be used. sub useHTML5 { - return 1; + if ($env{'browser.type'} eq 'chrome') { + if ($env{'browser.version'} >= 14) { + return 1; + } + } 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; + } + } + } + } elsif ($env{'browser.type'} eq 'mozilla') { + if ($env{'browser.info'} =~ /^firefox\-(\d+)/) { + my $firefox = $1; + if ((($env{'browser.os'} eq 'mac') && ($firefox >= 20)) || + (($env{'browser.os'} eq 'unix') && ($firefox >= 17)) || + (($env{'browser.os'} eq 'win') && ($firefox >= 14))) { + return 1; + } + } + } elsif ($env{'browser.type'} eq 'explorer') { + if (($env{'browser.os'} eq 'win') && ($env{'browser.version'} >= 10)) { + return 1; + } + } + return 0; } # @@ -155,7 +183,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" /> @@ -193,7 +221,7 @@ sub init_script { my $html5init=''; if (&useHTML5()) { $html5init= - '<script type="text/javascript" language="javascript" src="/adm/geogebra/html5/web/test42/web/web.nocache.js"></script>'; + '<script type="text/javascript" language="javascript" src="/adm/geogebra/web/web.nocache.js"></script>'; } return (<<ENDGGBINIT); $html5init @@ -807,7 +835,7 @@ sub start_backgroundplot { &Apache::edit::text_arg('Label on Plot:','label', $token,'8'). &Apache::edit::text_arg('Color (hex code):','color', - $token,'8'). + $token,'8', 'colorchooser'). &Apache::edit::select_arg('Fixed location:','fixed', ['yes','no'],$token). &Apache::edit::end_row(); @@ -884,7 +912,7 @@ sub start_functionplotrule { $result=&Apache::edit::tag_start($target,$token,'Function Plot Graph Rule'). &Apache::edit::text_arg('Index/Name:','index', $token,'10').' '. - &Apache::edit::select_arg(&mt('Function:'),'derivativeorder', + &Apache::edit::select_arg('Function:','derivativeorder', [['0','Function itself'], ['1','First derivative'], ['2','Second derivative'], @@ -1482,7 +1510,7 @@ sub start_functionplotresponse { $env{'form.counter'},$Apache::lonxml::curdepth); &Apache::lonxml::add_script_result( &Apache::loncommon::modal_adhoc_window($function_name,700,500, - '<pre>'.$Apache::functionplotresponse::ruleslog.'</pre>', + '<pre style="background-color:#ffffff;">'.$Apache::functionplotresponse::ruleslog.'</pre>', &mt('Rules Log'))."<br />"); } return $result;