Diff for /loncom/homework/lonhomework.pm between versions 1.344 and 1.344.2.2

version 1.344, 2014/02/25 19:31:48 version 1.344.2.2, 2015/04/20 01:22:58
Line 469  sub check_access { Line 469  sub check_access {
  if ( $tries eq '' ) { $tries = '0'; }   if ( $tries eq '' ) { $tries = '0'; }
  if ( $maxtries eq '' &&    if ( $maxtries eq '' && 
      $env{'request.state'} ne 'construct') { $maxtries = '2'; }        $env{'request.state'} ne 'construct') { $maxtries = '2'; } 
  $Apache::lonhomework::results{'resource.'.$id.'.maxtries'}=$maxtries;  
  if ($maxtries && $tries >= $maxtries) { $status = 'CANNOT_ANSWER'; }   if ($maxtries && $tries >= $maxtries) { $status = 'CANNOT_ANSWER'; }
  # if (correct and show prob status) or excused then CANNOT_ANSWER   # if (correct and show prob status) or excused then CANNOT_ANSWER
  if ( ($Apache::lonhomework::history{"resource.$id.solved"}=~/^correct/)   if ( ($Apache::lonhomework::history{"resource.$id.solved"}=~/^correct/)
Line 541  sub due_date { Line 540  sub due_date {
     } else {      } else {
  $date = $due_date;   $date = $due_date;
     }      }
     return $date      return $date;
 }  }
   
 sub seconds_to_human_length {  sub seconds_to_human_length {
Line 590  sub showarray { Line 589  sub showarray {
 sub showhashsubset {  sub showhashsubset {
     my ($hash,$keyre) = @_;      my ($hash,$keyre) = @_;
     my $resultkey;      my $resultkey;
     foreach $resultkey (sort keys %$hash) {      foreach $resultkey (sort(keys(%$hash))) {
  if ($resultkey !~ /$keyre/) { next; }   if ($resultkey !~ /$keyre/) { next; }
  if (ref($$hash{$resultkey})  eq 'ARRAY' ) {   if (ref($$hash{$resultkey})  eq 'ARRAY' ) {
     &Apache::lonxml::debug("$resultkey ---- ".      &Apache::lonxml::debug("$resultkey ---- ".
Line 1278  sub handler { Line 1277  sub handler {
     my $file=&Apache::lonnet::filelocation("",$request->uri);      my $file=&Apache::lonnet::filelocation("",$request->uri);
   
     #check if we know where we are      #check if we know where we are
     if ($env{'request.course.fn'} && !&Apache::lonnet::symbread()) {       if ($env{'request.course.fn'} && !&Apache::lonnet::symbread('','',1,1)) { 
  # if we are browsing we might not be able to know where we are   # if we are browsing we might not be able to know where we are
  if ($Apache::lonhomework::browse ne 'F' &&    if ($Apache::lonhomework::browse ne 'F' && 
     $env{'request.state'} ne "construct") {      $env{'request.state'} ne "construct") {

Removed from v.1.344  
changed lines
  Added in v.1.344.2.2


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