--- loncom/homework/functionplotresponse.pm 2012/08/17 13:08:11 1.98 +++ loncom/homework/functionplotresponse.pm 2015/01/19 15:35:53 1.107 @@ -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.107 2015/01/19 15:35:53 goltermann 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 { - + @@ -193,7 +221,7 @@ sub init_script { my $html5init=''; if (&useHTML5()) { $html5init= - ''; + ''; } return (<'.&mt('Function Plot Question').'' + .''.&Apache::loncommon::insert_folding_button().&mt('Function Plot Question').'' .''.&mt('Delete?').' ' .&Apache::edit::deletelist($target,$token).'   ' .&Apache::edit::insertlist($target,$token).'   ' @@ -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, - '
'.$Apache::functionplotresponse::ruleslog.'
', + '
'.$Apache::functionplotresponse::ruleslog.'
', &mt('Rules Log'))."
"); } return $result; @@ -2015,7 +2043,7 @@ sub start_functionplotruleset { my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; if ($target eq 'edit') { return &Apache::edit::start_table($token). - ''.&mt('Function Plot Rule Set').'' + ''.&Apache::loncommon::insert_folding_button().&mt('Function Plot Rule Set').'' .''.&mt('Delete?').' ' .&Apache::edit::deletelist($target,$token).'   '. &Apache::edit::insertlist($target,$token).'   ' @@ -2208,7 +2236,8 @@ sub start_functionplotelements { if ($target eq 'edit') { return &Apache::edit::start_table($token). - ''.&mt('Function Plot Elements').'' + ''.&Apache::loncommon::insert_folding_button() + .&mt('Function Plot Elements').'' .''.&mt('Delete?').' ' .&Apache::edit::deletelist($target,$token).'   '. &Apache::edit::insertlist($target,$token).'   '