--- loncom/homework/lonhomework.pm 2016/07/18 19:29:11 1.363 +++ loncom/homework/lonhomework.pm 2016/09/14 16:13:17 1.365 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # The LON-CAPA Homework handler # -# $Id: lonhomework.pm,v 1.363 2016/07/18 19:29:11 raeburn Exp $ +# $Id: lonhomework.pm,v 1.365 2016/09/14 16:13:17 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -231,7 +231,7 @@ sub check_slot_access { my ($returned_slot,$slot_name,$checkinslot,$ipused,$blockip,$now,$ip, $consumed_uniq); $now = time; - $ip=$env{'request.host'} || $ENV{'REMOTE_ADDR'}; + $ip=$ENV{'REMOTE_ADDR'} || $env{'request.host'}; if ($checkedin) { $checkinslot = $Apache::lonhomework::history{"$checkin.slot"}; @@ -1431,9 +1431,11 @@ sub get_template_html { sub newproblem { my ($request) = @_; - if ($env{'form.mode'} eq 'blank'){ + if ($env{'form.mode'} eq 'blank'){ my $dest = &Apache::lonnet::filelocation("",$request->uri); - &File::Copy::copy('/home/httpd/html/res/adm/includes/templates/blank.problem',$dest); + my $templatefilename = + $request->dir_config('lonIncludes').'/templates/blank.problem'; + &File::Copy::copy($templatefilename,$dest); &renderpage($request,$dest); return; }