Diff for /loncom/homework/inputtags.pm between versions 1.298 and 1.302

version 1.298, 2011/12/10 18:10:56 version 1.302, 2012/03/11 20:17:10
Line 185  sub start_textfield { Line 185  sub start_textfield {
             }              }
         }          }
         unless ($newvariation) {          unless ($newvariation) {
     $oldresponse = &HTML::Entities::encode($Apache::lonhomework::history{"resource.$partid.$resid.submission"},'<>&"');      $oldresponse = $Apache::lonhomework::history{"resource.$partid.$resid.submission"};
         }          }
  if ($Apache::inputtags::status[-1] eq 'CAN_ANSWER') {   if ($Apache::inputtags::status[-1] eq 'CAN_ANSWER') {
     my $cols = &Apache::lonxml::get_param('cols',$parstack,$safeeval);      my $cols = &Apache::lonxml::get_param('cols',$parstack,$safeeval);
Line 200  sub start_textfield { Line 200  sub start_textfield {
             my $textareaclass = 'class="LC_richDetectHtml"';              my $textareaclass = 'class="LC_richDetectHtml"';
     $result.= '<textarea wrap="hard" name="HWVAL_'.$resid.'" id="HWVAL_'.$resid.'" '.      $result.= '<textarea wrap="hard" name="HWVAL_'.$resid.'" id="HWVAL_'.$resid.'" '.
       'rows="'.$rows.'" cols="'.$cols.'" '.$textareaclass.'>'.        'rows="'.$rows.'" cols="'.$cols.'" '.$textareaclass.'>'.
                       $oldresponse;                        &HTML::Entities::encode($oldresponse,'<>&"');
     if ($oldresponse ne '') {      if ($oldresponse ne '') {
   
  #get rid of any startup text if the user has already responded   #get rid of any startup text if the user has already responded
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 1096  sub decideoutput { Line 1076  sub decideoutput {
     } elsif ($award eq 'ANONYMOUS_CREDIT') {      } elsif ($award eq 'ANONYMOUS_CREDIT') {
         $message = &mt("Your anonymous submission has been recorded, and credit awarded.");          $message = &mt("Your anonymous submission has been recorded, and credit awarded.");
         $css_class=$possible_class{'correct'};          $css_class=$possible_class{'correct'};
           $button=1;
     } elsif ($award eq 'DRAFT') {      } elsif ($award eq 'DRAFT') {
  $message = &mt("Copy saved but not submitted.");   $message = &mt("Copy saved but not submitted.");
  $css_class=$possible_class{'not_charged_try'};   $css_class=$possible_class{'not_charged_try'};
Line 1514  sub gradestatus { Line 1495  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,

Removed from v.1.298  
changed lines
  Added in v.1.302


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