--- loncom/homework/randomlabel.pm 2003/05/19 17:10:12 1.45 +++ loncom/homework/randomlabel.pm 2003/06/19 22:23:10 1.46 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # random labelling tool # -# $Id: randomlabel.pm,v 1.45 2003/05/19 17:10:12 sakharuk Exp $ +# $Id: randomlabel.pm,v 1.46 2003/06/19 22:23:10 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -176,14 +176,11 @@ sub end_randomlabel { &Apache::lonnet::appenv(("imagerequest.$token"=>&Apache::lonnet::escape($args))); } elsif ($target eq 'tex') { $result='\end{picture}\\\\'; - @$parstack[-1]=~/\$height\s*=\s*?"(.+)?"/; - my $one=$1; - @$parstack[-1]=~/\$width\s*=\s*?"(.+)?"/; - my $two=$1; - @$parstack[-1]=~/\$texwidth\s*=\s*?"(.+)?"/; - my $three=$1; - my $howtoskipback = $three*$one/$two; - $result.=' \vskip -'.$howtoskipback.' mm }'; + my $height=&Apache::lonxml::get_param('height',$parstack,$safeeval); + my $width=&Apache::lonxml::get_param('width',$parstack,$safeeval); + my $texwidth=&Apache::lonxml::get_param('texwidth',$parstack,$safeeval); + my $howtoskipback = $texwidth*$height/$width; + $result.= ' \vskip -'.$howtoskipback.' mm } \\\\ '; } elsif ($target eq 'edit') { $result.=&Apache::edit::end_table; }