--- loncom/homework/outputtags.pm 2023/07/10 02:26:50 1.58.4.1.2.1 +++ loncom/homework/outputtags.pm 2017/05/23 03:07:34 1.59 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # tags that create controlled output # -# $Id: outputtags.pm,v 1.58.4.1.2.1 2023/07/10 02:26:50 raeburn Exp $ +# $Id: outputtags.pm,v 1.59 2017/05/23 03:07:34 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -33,6 +33,7 @@ package Apache::outputtags; use strict; use Apache::lonlocal; use Apache::lonnet; +use LONCAPA::LWPReq; use POSIX qw(strftime); BEGIN { @@ -308,7 +309,7 @@ sub start_displaystudentphoto { my $args; my $width=&Apache::lonxml::get_param('width',$parstack,$safeeval); if ($width) { $args.=" width=\"$width\" "; } - my $height=&Apache::lonxml::get_param('height',$parstack,$safeeval); + my $height=&Apache::lonxml::get_param('heigth',$parstack,$safeeval); if ($height) { $args.=" height=\"$height\" "; } my $align=&Apache::lonxml::get_param('align',$parstack,$safeeval); if ($align) { $args.=" align=\"$align\" "; } @@ -316,12 +317,13 @@ sub start_displaystudentphoto { } if ($target eq 'tex' && $env{'request.role'} =~ /^cc/) { my $url=&Apache::lonnet::studentphoto($domain,$user,"eps"); - my $ua=new LWP::UserAgent; + my $uhome=&Apache::lonnet::homeserver($user,$domain); my $request=new HTTP::Request('GET',$url); + my $response=&LONCAPA::LWPReq::makerequest($uhome,$request,'','','',1); my $response=$ua->request($request); if ($response->is_success) { my $file=$user."_".$domain."_studentphoto.eps"; - open(FILE,">",$Apache::lonnet::perlvar{'lonPrtDir'}."/$file"); + open(FILE,">".$Apache::lonnet::perlvar{'lonPrtDir'}."/$file"); print FILE $response->content; close(FILE); my $width_param=&Apache::londefdef::image_size($Apache::lonnet::perlvar{'lonPrtDir'}."/$file",'0.3',$parstack,$safeeval);