Diff for /loncom/homework/functionplotresponse.pm between versions 1.87 and 1.88

version 1.87, 2011/11/24 15:43:08 version 1.88, 2011/11/26 01:35:26
Line 49  BEGIN { Line 49  BEGIN {
 #  #
   
 sub geogebra_startcode {  sub geogebra_startcode {
     my ($id)=@_;      my ($id,$width,$height)=@_;
       $width=int(1.*$width);
       $height=int(1.*$height);
       unless ($width) { $width=700; }
       unless ($height) { $height=400; }
     return (<<ENDSTARTCODE);      return (<<ENDSTARTCODE);
 <applet name="ggbApplet_$id" code="geogebra.GeoGebraApplet" archive="geogebra.jar"  <applet name="ggbApplet_$id" code="geogebra.GeoGebraApplet" archive="geogebra.jar"
          codebase="/adm/geogebra/"  width="722" height="447" MAYSCRIPT>           codebase="/adm/geogebra/"  width="$width" height="$height" MAYSCRIPT>
        <param name="java_arguments" value="-Xmx512m -Djnlp.packEnabled=true"/>         <param name="java_arguments" value="-Xmx512m -Djnlp.packEnabled=true"/>
 ENDSTARTCODE  ENDSTARTCODE
 }  }
Line 1248  sub start_functionplotresponse { Line 1252  sub start_functionplotresponse {
        .&Apache::edit::end_row()         .&Apache::edit::end_row()
        .&Apache::edit::start_spanning_row()         .&Apache::edit::start_spanning_row()
        ."\n";         ."\n";
     $result.=&Apache::edit::text_arg('Label x-axis:','xlabel',      $result.=&Apache::edit::text_arg('Width (pixels):','width',
                                        $token,'6').'&nbsp;'.
                &Apache::edit::text_arg('Height (pixels):','height',
                                        $token,'6').'<br />'.
                &Apache::edit::text_arg('Label x-axis:','xlabel',
                                      $token,'6').'&nbsp;'.                                       $token,'6').'&nbsp;'.
              &Apache::edit::text_arg('Minimum x-value:','xmin',               &Apache::edit::text_arg('Minimum x-value:','xmin',
                                      $token,'4').'&nbsp;'.                                       $token,'4').'&nbsp;'.
Line 1271  sub start_functionplotresponse { Line 1279  sub start_functionplotresponse {
              &Apache::edit::end_row().&Apache::edit::start_spanning_row();               &Apache::edit::end_row().&Apache::edit::start_spanning_row();
   } elsif ($target eq 'modified') {    } elsif ($target eq 'modified') {
     my $constructtag=&Apache::edit::get_new_args($token,$parstack,      my $constructtag=&Apache::edit::get_new_args($token,$parstack,
                                                  $safeeval,'xlabel','xmin','xmax','ylabel','ymin','ymax',                                                   $safeeval,'width','height','xlabel','xmin','xmax','ylabel','ymin','ymax',
                                                            'xaxisvisible','yaxisvisible','gridvisible','answerdisplay');                                                             'xaxisvisible','yaxisvisible','gridvisible','answerdisplay');
     if ($constructtag) { $result = &Apache::edit::rebuild_tag($token); }      if ($constructtag) { $result = &Apache::edit::rebuild_tag($token); }
   
Line 1986  sub end_functionplotelements { Line 1994  sub end_functionplotelements {
 # generate the input fields  # generate the input fields
      $result.=$Apache::functionplotresponse::inputfields;       $result.=$Apache::functionplotresponse::inputfields;
 # actually start the <applet>-tag  # actually start the <applet>-tag
      $result.=&geogebra_startcode($internalid);       $result.=&geogebra_startcode($internalid,
                                     &Apache::lonxml::get_param('width',$parstack,$safeeval,-2),
                                     &Apache::lonxml::get_param('height',$parstack,$safeeval,-2));
 # load the spline bytecode  # load the spline bytecode
      $result.=&geogebra_spline_program();       $result.=&geogebra_spline_program();
 # set default parameters  # set default parameters

Removed from v.1.87  
changed lines
  Added in v.1.88


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>