--- loncom/xml/londefdef.pm 2005/01/19 18:16:35 1.250 +++ loncom/xml/londefdef.pm 2005/02/07 20:15:11 1.252 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Tags Default Definition Module # -# $Id: londefdef.pm,v 1.250 2005/01/19 18:16:35 albertel Exp $ +# $Id: londefdef.pm,v 1.252 2005/02/07 20:15:11 matthew Exp $ # # # Copyright Michigan State University Board of Trustees @@ -2757,7 +2757,10 @@ sub start_param { if ($src) { $toconvert{'src'}= $src; } my $name=&Apache::lonxml::get_param('name',$parstack,$safeeval, undef,1); - if ($name=~/^cabbase$/i) { $toconvert{'name'}= $name; } + if ($name=~/^cabbase$/i) { + $toconvert{'value'}=&Apache::lonxml::get_param('value',$parstack, + $safeeval,undef,1); + } $currentstring = &Apache::lonenc::encrypt_ref($token,\%toconvert); } elsif ($target eq 'tex') { } @@ -3793,18 +3796,26 @@ sub image_size { my $width = &Apache::lonxml::get_param('width',$parstack,$safeeval, undef,1); if ($TeXwidth ne '') { + my $old_width_param=$width_param; if ($TeXwidth=~/(\d+)\s*\%/) { $width_param = $1*$ENV{'form.textwidth'}/100; } else { $width_param = $TeXwidth; } + $height_param=$TeXwidth/$old_width_param*$height_param; } elsif ($TeXheight ne '') { $height_param = $TeXheight; $width_param = $TeXheight/$height_param*$width_param; } elsif ($width ne '') { + my $old_width_param=$width_param; $width_param = $width*$scaling; + $height_param=$width_param/$old_width_param*$height_param; + } + if ($width_param > $ENV{'form.textwidth'}) { + my $old_width_param=$width_param; + $width_param =0.95*$ENV{'form.textwidth'}; + $height_param=$width_param/$old_width_param*$height_param; } - if ($width_param > $ENV{'form.textwidth'}) {$width_param =0.95*$ENV{'form.textwidth'}} return ($height_param, $width_param); }