Diff for /loncom/homework/optionresponse.pm between versions 1.196 and 1.199

version 1.196, 2015/01/19 15:35:53 version 1.199, 2015/04/21 12:28:05
Line 128  sub start_foilgroup { Line 128  sub start_foilgroup {
         maxcheck => 'Enter maximum number students may check (e.g., 3)',          maxcheck => 'Enter maximum number students may check (e.g., 3)',
         mincheck => 'Enter minimum number students need to check (e.g., 1)',          mincheck => 'Enter minimum number students need to check (e.g., 1)',
     );      );
     $result.= (<<ENDTABLE, &Apache::loncommon::insert_folding_button());      $result.= sprintf(<<ENDTABLE, &Apache::loncommon::insert_folding_button());
       <tr><td>%s $lt{'sel'}</td>        <tr><td>%s $lt{'sel'}</td>
         <td>          <td>
   $lt{'add'} <input type="text" name="$Apache::lonxml::curdepth.options" />    $lt{'add'} <input type="text" name="$Apache::lonxml::curdepth.options" />
Line 376  sub end_foilgroup { Line 376  sub end_foilgroup {
   }    }
  }   }
  my $part=$Apache::inputtags::part;   my $part=$Apache::inputtags::part;
         my $nonlenient=&grading_is_nonlenient($part);          my $id = $Apache::inputtags::response['-1'];
  my $id = $Apache::inputtags::response['-1'];          my $nonlenient=&grading_is_nonlenient($part,$id);
  my $responsestr=&Apache::lonnet::hash2str(%responsehash);   my $responsestr=&Apache::lonnet::hash2str(%responsehash);
  my $gradestr   =&Apache::lonnet::hash2str(%grade);   my $gradestr   =&Apache::lonnet::hash2str(%grade);
  my %previous=&Apache::response::check_for_previous($responsestr,   my %previous=&Apache::response::check_for_previous($responsestr,
Line 492  sub end_foilgroup { Line 492  sub end_foilgroup {
 }  }
   
 sub grading_is_nonlenient {  sub grading_is_nonlenient {
     my ($part) = @_;      my ($part,$id) = @_;
 # Web mode: we are non-lenient unless told otherwise  # Web mode: we are non-lenient unless told otherwise
     my $defaultparm = 'off';      my $defaultparm = 'off';
     my $nonlenient = 0;      my $nonlenient = 1;
 # Grading a bubblesheet exam: we are grading lenient unless told otherwise  # Grading a bubblesheet exam: we are grading lenient unless told otherwise
     if ($Apache::lonhomework::scantronmode) {      if ($Apache::lonhomework::scantronmode) {
         $defaultparm = 'on';          $defaultparm = 'on';
         $nonlenient = 1;          $nonlenient = 0;
     }      }
     my $lenientparm =      my $lenientparm =
         &Apache::response::get_response_param($part,'lenient',$defaultparm);          &Apache::response::get_response_param($part,'lenient',$defaultparm);
       if ($lenientparm eq 'default') {
           $lenientparm = $defaultparm;
       }
       $lenientparm =
           &Apache::response::get_response_param($part.'_'.$id,'lenient',$lenientparm);
       if ($lenientparm eq 'default') {
           $lenientparm = $defaultparm;
       }
     if ($lenientparm=~/^0|off|no$/i) {      if ($lenientparm=~/^0|off|no$/i) {
         $nonlenient = 1;          $nonlenient = 1;
     } elsif ($lenientparm=~/^1|on|yes$/i) {      } elsif ($lenientparm=~/^1|on|yes$/i) {
         $nonlenient = 0;          $nonlenient = 0;
     }      }
       if (!$nonlenient) {
           $Apache::inputtags::leniency=1;
       }
     return $nonlenient;      return $nonlenient;
 }  }
   

Removed from v.1.196  
changed lines
  Added in v.1.199


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