--- loncom/homework/functionplotresponse.pm 2013/07/12 21:19:17 1.102 +++ loncom/homework/functionplotresponse.pm 2013/07/22 11:46:26 1.103 @@ -1,7 +1,7 @@ # LearningOnline Network with CAPA # Functionplot responses # -# $Id: functionplotresponse.pm,v 1.102 2013/07/12 21:19:17 raeburn Exp $ +# $Id: functionplotresponse.pm,v 1.103 2013/07/22 11:46:26 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -49,9 +49,34 @@ BEGIN { # Return a true value if HTML5 should be used. sub useHTML5 { - if ($env{'browser.type'} eq 'chrome') { return 1; } - if (($env{'browser.type'} eq 'safari') && - ($env{'browser.os'} eq 'mac')) { 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; }