Diff for /loncom/homework/lonhomework.pm between versions 1.269 and 1.274

version 1.269, 2007/08/18 00:01:45 version 1.274, 2007/09/10 13:31:39
Line 188  sub proctor_checked_in { Line 188  sub proctor_checked_in {
     return 0;      return 0;
 }  }
   
 $Apache::lonxml::browse='';  
 sub check_ip_acc {  sub check_ip_acc {
     my ($acc)=@_;      my ($acc)=@_;
     &Apache::lonxml::debug("acc is $acc");      &Apache::lonxml::debug("acc is $acc");
Line 196  sub check_ip_acc { Line 195  sub check_ip_acc {
  return 1;   return 1;
     }      }
     my $allowed=0;      my $allowed=0;
     my $ip=$ENV{'REMOTE_ADDR'};      my $ip=$env{'request.host'} || $ENV{'REMOTE_ADDR'};
   
     my $name;      my $name;
     foreach my $pattern (split(',',$acc)) {      foreach my $pattern (split(',',$acc)) {
  $pattern =~ s/^\s*//;   $pattern =~ s/^\s*//;
Line 436  sub check_access { Line 436  sub check_access {
  $date = &mt("an indeterminate date"); $passed = 0;   $date = &mt("an indeterminate date"); $passed = 0;
     } else {      } else {
  if (time < $date) { $passed = 0; } else { $passed = 1; }   if (time < $date) { $passed = 0; } else { $passed = 1; }
  $date = localtime $date;   $date = &Apache::lonlocal::locallocaltime($date);
     }      }
     if (!$passed) { $type=$temp; last; }      if (!$passed) { $type=$temp; last; }
  }   }
Line 864  sub editxmlmode { Line 864  sub editxmlmode {
  my $js =   my $js =
     &Apache::edit::js_change_detection().       &Apache::edit::js_change_detection(). 
     &Apache::loncommon::resize_textarea_js();      &Apache::loncommon::resize_textarea_js();
    my $only_body =  ($env{'environment.remote'} eq 'off')? 0 : 1;
  my $start_page =    my $start_page = 
     &Apache::loncommon::start_page(&mt("EditXML [_1]",$file),$js,      &Apache::loncommon::start_page(&mt("EditXML [_1]",$file),$js,
    {'no_auto_mt_title' => 1,     {'no_auto_mt_title' => 1,
     'only_body'        => 1,      'only_body'        => $only_body,
     'add_entries'      => {      'add_entries'      => {
  'onresize' => q[resize_textarea('LC_editxmltext','LC_aftertextarea')],   'onresize' => q[resize_textarea('LC_editxmltext','LC_aftertextarea')],
  'onload'   => q[resize_textarea('LC_editxmltext','LC_aftertextarea')],   'onload'   => q[resize_textarea('LC_editxmltext','LC_aftertextarea')],
Line 950  sub renderpage { Line 951  sub renderpage {
  &Apache::lonxml::debug("Should be parsing now");   &Apache::lonxml::debug("Should be parsing now");
  $result .= &Apache::lonxml::xmlparse($request, $target, $problem,   $result .= &Apache::lonxml::xmlparse($request, $target, $problem,
      &setup_vars($target),%mystyle);       &setup_vars($target),%mystyle);
  undef($Apache::lonhomework::parsing_a_problem);   &finished_parsing();
  if (!$output) { $result = ''; }   if (!$output) { $result = ''; }
  #$request->print("Result follows:");   #$request->print("Result follows:");
  if ($target eq 'modified') {   if ($target eq 'modified') {
Line 981  sub renderpage { Line 982  sub renderpage {
     }      }
 }  }
   
   sub finished_parsing {
       undef($Apache::lonhomework::parsing_a_problem);
       undef($Apache::lonhomework::parsing_a_task);
   }
   
 # with no arg it returns a HTML <option> list of the template titles  # with no arg it returns a HTML <option> list of the template titles
 # with one arg it returns the filename associated with the arg passed  # with one arg it returns the filename associated with the arg passed
 sub get_template_list {  sub get_template_list {

Removed from v.1.269  
changed lines
  Added in v.1.274


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>