--- loncom/homework/functionplotresponse.pm 2012/08/16 21:02:29 1.96 +++ loncom/homework/functionplotresponse.pm 2012/08/16 23:03:01 1.97 @@ -1,7 +1,7 @@ # LearningOnline Network with CAPA # Functionplot responses # -# $Id: functionplotresponse.pm,v 1.96 2012/08/16 21:02:29 www Exp $ +# $Id: functionplotresponse.pm,v 1.97 2012/08/16 23:03:01 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -49,7 +49,7 @@ BEGIN { # Return a true value if HTML5 should be used. sub useHTML5 { - return 0; + return 1; } # Routines to start the applet (Java) or the HTML5/JavaScript @@ -69,14 +69,18 @@ sub geogebra_startcode { } sub geogebra_endcode { - unless (&useHTML5()) { + if (&useHTML5()) { + return ''; + } else { return &java_geogebra_endcode(); } } sub geogebra_default_parameters { my ($id)=@_; - unless (&useHTML5()) { + if (&useHTML5()) { + return ''; + } else { return &java_geogebra_default_parameters($id); } } @@ -107,6 +111,10 @@ sub java_geogebra_code_param { sub html5_geogebra_startcode { my ($id,$width,$height)=@_; + $width=int(1.*$width); + $height=int(1.*$height); + unless ($width) { $width=700; } + unless ($height) { $height=400; } my $code=&geogebra_internal_program(); return (<'; } return (< //