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

version 1.343, 2014/01/15 14:46:27 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 1176  sub get_template_list { Line 1175  sub get_template_list {
         # Provide example link          # Provide example link
         my $filename=$file->[0];          my $filename=$file->[0];
         $filename=~s{^\Q$londocroot\E}{};          $filename=~s{^\Q$londocroot\E}{};
          if (!(grep $filename =~ $_, @noexamplelink)) {          if (!(grep($filename =~ /\Q$_\E$/,@noexamplelink))) {
            $result .= ' <span class="LC_fontsize_small">'              $result .= ' <span class="LC_fontsize_small">'
                      .&Apache::loncommon::modal_link(                        .&Apache::loncommon::modal_link(
                           $filename.'?inhibitmenu=yes',&mt('Example'),600,420,'sample')                             $filename.'?inhibitmenu=yes',&mt('Example'),600,420,'sample')
                      .'</span>';                        .'</span>';
         };          }
         $result .= '<br />'."\n";          $result .= '<br />'."\n";
         $count ++;          $count ++;
     }      }
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.343  
changed lines
  Added in v.1.344.2.2


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