--- loncom/homework/lonhomework.pm 2003/11/08 10:44:58 1.157 +++ loncom/homework/lonhomework.pm 2004/01/28 15:45:44 1.161 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # The LON-CAPA Homework handler # -# $Id: lonhomework.pm,v 1.157 2003/11/08 10:44:58 albertel Exp $ +# $Id: lonhomework.pm,v 1.161 2004/01/28 15:45:44 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -24,11 +24,7 @@ # /home/httpd/html/adm/gpl.txt # # http://www.lon-capa.org/ -# -# Guy Albertelli -# 11/30 Gerd Kortemeyer -# 6/1,8/17,8/18 Gerd Kortemeyer -# 7/18 Jeremy Bowers + package Apache::lonhomework; use strict; @@ -174,7 +170,7 @@ sub check_ip_acc { use Socket; my $netaddr=inet_aton($ip); ($name)=gethostbyaddr($netaddr,AF_INET); - } + } if ($name =~ /\Q$pattern\E$/i) { $allowed=1; } } elsif ($pattern =~ /\d+\.\d+\.\d+\.\d+/) { #127.0.0.1 @@ -215,7 +211,7 @@ sub check_access { &Apache::lonxml::debug("time:".time); my $allowed=&check_ip_acc(&Apache::lonnet::EXT("resource.$id.acc")); - if (!$allowed) { + if (!$allowed && ($Apache::lonhomework::browse ne 'F')) { $status='INVALID_ACCESS'; $date=&mt("can not be accessed from your location."); return($status,$date); @@ -528,8 +524,12 @@ sub editxmlmode { &renderpage($request,$file); } else { my ($rows,$cols) = &Apache::edit::textarea_sizes(\$problem); - my $xml_help = Apache::loncommon::helpLatexCheatsheet("Problem_Editor_XML_Index", - "Problem Editing Help"); + my $xml_help = '
'. + &Apache::loncommon::helpLatexCheatsheet("Problem_Editor_XML_Index", + "Problem Editing Help"). + ''. + &Apache::loncommon::help_open_faq(5). + &Apache::loncommon::help_open_bug('Authoring').'
'; if ($cols > 80) { $cols = 80; } if ($cols < 70) { $cols = 70; } if ($rows < 20) { $rows = 20; } @@ -557,6 +557,7 @@ sub renderpage { my ($request,$file) = @_; my (@targets) = &get_target(); + &Apache::lonhomework::showhashsubset(\%ENV,'form.'); &Apache::lonxml::debug("Running targets ".join(':',@targets)); foreach my $target (@targets) { #my $t0 = [&gettimeofday()]; @@ -652,6 +653,7 @@ sub newproblem { $errormsg='

'.&mt('You did not select a template.').'

'."\n"; } my $instructions; + my $bodytag=&Apache::loncommon::bodytag(undef,undef,undef,1); if ($templatelist) { $instructions=&mt(", select a template from the pull-down menu below.").'
'.&mt("Then");} my %lt=&Apache::lonlocal::texthash( 'create' => 'Creating a new', 'resource' => 'resource', @@ -662,7 +664,7 @@ sub newproblem { 'Create' => 'Create', 'button' => 'button'); $request->print(< +$bodytag

$lt{'create'} $extension $lt{'resource'}

$errormsg $lt{'requested'} $shownurl $lt{'not exist'}. @@ -704,7 +706,6 @@ sub handler { my $request=$_[0]; $Apache::lonxml::debug=$ENV{'user.debug'}; - if (&setupheader($request)) { return OK; } $ENV{'request.uri'}=$request->uri;