Diff for /loncom/homework/inputtags.pm between versions 1.297 and 1.300

version 1.297, 2011/12/08 02:59:34 version 1.300, 2011/12/20 22:47:27
Line 843  sub finalizeawards { Line 843  sub finalizeawards {
 }  }
 }  }
   
 sub grading_is_nonlenient {  
     my ($part) = @_;  
 # Web mode: we are non-lenient unless told otherwise  
     my $defaultparm = 'off';  
     my $nonlenient = 0;  
 # Grading a bubblesheet exam: we are grading lenient unless told otherwise  
     if ($Apache::lonhomework::scantronmode) {  
         $defaultparm = 'on';  
         $nonlenient = 1;  
     }  
     my $lenientparm =  
         &Apache::response::get_response_param($part,'lenient',$defaultparm);  
     if ($lenientparm=~/^0|off|no$/i) {  
         $nonlenient = 1;  
     } elsif ($lenientparm=~/^1|on|yes$/i) {  
         $nonlenient = 0;  
     }  
     return $nonlenient;  
 }  
   
 sub decideoutput {  sub decideoutput {
     my ($award,$awarded,$awardmsg,$solved,$previous,$target,$nocorrect)=@_;      my ($award,$awarded,$awardmsg,$solved,$previous,$target,$nocorrect)=@_;
   
Line 931  sub decideoutput { Line 911  sub decideoutput {
  }   }
     }      }
  }   }
         if (&grading_is_nonlenient($part)) {          if ($awarded >= 1) {
             $button=0;              $button=0;
         } elsif ($awarded==1) {          } elsif (&Apache::lonnet::EXT("resource.$part.retrypartial") !~/^1|on|yes$/i) {
             $button=0;              $button=0;
         } else {           } else {
             $button=1;              $button=1;
         }          }
  $previousmsg='';   $previousmsg='';
Line 1514  sub gradestatus { Line 1494  sub gradestatus {
  && $status ne 'UNAVAILABLE'    && $status ne 'UNAVAILABLE' 
  && $status ne 'INVALID_ACCESS'    && $status ne 'INVALID_ACCESS' 
  && $status ne 'NEEDS_CHECKIN'    && $status ne 'NEEDS_CHECKIN' 
  && $status ne 'NOT_IN_A_SLOT') {     && $status ne 'NOT_IN_A_SLOT'
            && $status ne 'RESERVABLE'
            && $status ne 'RESERVABLE_LATER'
            && $status ne 'NOTRESERVABLE') {
   
  ($previousmsg,$latemessage,$message,$trystr) =   ($previousmsg,$latemessage,$message,$trystr) =
     &get_grade_messages($id,"resource.$id",$target,$status,      &get_grade_messages($id,"resource.$id",$target,$status,
Line 1647  sub previous_tries { Line 1630  sub previous_tries {
  '<tr>'.'<th>'.&mt('Submission #').'</th><th>'.&mt('Try').   '<tr>'.'<th>'.&mt('Submission #').'</th><th>'.&mt('Try').
  '</th><th colspan="'.scalar(@Apache::inputtags::response).'">'.   '</th><th colspan="'.scalar(@Apache::inputtags::response).'">'.
  &mt('Submitted Answer').'</th>';   &mt('Submitted Answer').'</th>';
     $output =&Apache::loncommon::start_scrollbox('420px','400px','400px').      $output ='<table class="LC_prior_tries">'.$headers.$output.'</table>';
              '<table class="LC_prior_tries">'.$headers.$output.'</table>'.  
              &Apache::loncommon::end_scrollbox();  
     #return $output;  
     $output = &Apache::loncommon::js_ready($output);   
   
     my $tries_text = &get_tries_text('link');      my $tries_text = &get_tries_text('link');
     my $start_page =  
  &Apache::loncommon::start_page($tries_text, undef,  
        {'only_body'      => 1,  
  'bgcolor'        => '#FFFFFF',  
  'js_ready'       => 1,  
         'inherit_jsmath' => 1, });  
     my $end_page =  
  &Apache::loncommon::end_page({'js_ready' => 1,});  
     my $prefix = $env{'form.request.prefix'};      my $prefix = $env{'form.request.prefix'};
     $prefix =~ tr{.}{_};      $prefix =~ tr{.}{_};
     my $function_name = "LONCAPA_previous_tries_".$prefix.      my $function_name = "LONCAPA_previous_tries_".$prefix.
  $Apache::lonxml::curdepth.'_'.$env{'form.counter'};   $Apache::lonxml::curdepth.'_'.$env{'form.counter'};
     my $result = &Apache::loncommon::modal_adhoc_script($function_name,420,410,$start_page.$output.$end_page).      my $result = &Apache::loncommon::modal_adhoc_window($function_name,420,410,$output,&mt($tries_text))."<br />";
     "<a href=\"javascript:$function_name();void(0);\">".&mt($tries_text)."</a><br />";  
     return $result;      return $result;
 }  }
   

Removed from v.1.297  
changed lines
  Added in v.1.300


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