Diff for /loncom/homework/response.pm between versions 1.177 and 1.184

version 1.177, 2007/09/25 20:18:56 version 1.184, 2007/11/13 11:06:54
Line 451  sub end_customresponse { Line 451  sub end_customresponse {
     }      }
     if ($target eq 'grade' || $target eq 'web' || $target eq 'answer' ||       if ($target eq 'grade' || $target eq 'web' || $target eq 'answer' || 
  $target eq 'tex' || $target eq 'analyze') {   $target eq 'tex' || $target eq 'analyze') {
  &Apache::lonxml::increment_counter(&Apache::response::repetition());   &Apache::lonxml::increment_counter(&Apache::response::repetition(),
      "$part.$id");
    if ($target eq 'analyze') {
       &Apache::lonhomework::set_bubble_lines();
    }
     }      }
     pop(@Apache::lonxml::namespace);      pop(@Apache::lonxml::namespace);
     pop(@Apache::response::custom_answer);      pop(@Apache::response::custom_answer);
Line 880  sub getresponse { Line 884  sub getresponse {
     if (!defined($lines)) {      if (!defined($lines)) {
  $lines = 1;   $lines = 1;
     }      }
   
     my %let_to_num=('A'=>0,'B'=>1,'C'=>2,'D'=>3,'E'=>4,'F'=>5,'G'=>6,'H'=>7,      my %let_to_num=('A'=>0,'B'=>1,'C'=>2,'D'=>3,'E'=>4,'F'=>5,'G'=>6,'H'=>7,
     'I'=>8,'J'=>9,'K'=>10,'L'=>11,'M'=>12,'N'=>13,'O'=>14,      'I'=>8,'J'=>9,'K'=>10,'L'=>11,'M'=>12,'N'=>13,'O'=>14,
     'P'=>15,'Q'=>16,'R'=>17,'S'=>18,'T'=>19,'U'=>20,'V'=>21,      'P'=>15,'Q'=>16,'R'=>17,'S'=>18,'T'=>19,'U'=>20,'V'=>21,
Line 891  sub getresponse { Line 894  sub getresponse {
   
  my $line;   my $line;
  for ($line = 0; $line < $lines; $line++) {   for ($line = 0; $line < $lines; $line++) {
     $response = $env{'scantron.'.      my $theline = $Apache::lonxml::counter+$offset-1+$line;
  ($Apache::lonxml::counter+$offset-1+$line).      $response = $env{"scantron.$theline.answer"};
  '.answer'};      if ((defined($response)) && ($response ne "") && ($response ne " ")) {
     if ($response ne "") {  
  last;   last;
     }      }
           
  }   }
   
    # save bubbled letter for later
    $Apache::lonhomework::results{"resource.$part.$id.scantron"}.=
       $response;
  if ($resulttype ne 'letter') {   if ($resulttype ne 'letter') {
     if ($resulttype eq 'A is 1') {      if ($resulttype eq 'A is 1') {
  $response = $let_to_num{$response}+1;   $response = $let_to_num{$response}+1;
Line 913  sub getresponse { Line 919  sub getresponse {
  $response = chr(ord($response) + $line * $bubbles_per_line);   $response = chr(ord($response) + $line * $bubbles_per_line);
     }      }
  }   }
  # save submitted response for later  
  $Apache::lonhomework::results{"resource.$part.$id.scantron"}.=  
     $response;  
   
     } else {      } else {
  $response = $env{$formparm};   $response = $env{$formparm};
Line 1044  sub show_answer { Line 1047  sub show_answer {
     my $award  = $Apache::lonhomework::history{"resource.$part.solved"};      my $award  = $Apache::lonhomework::history{"resource.$part.solved"};
     my $status = $Apache::inputtags::status[-1];      my $status = $Apache::inputtags::status[-1];
     return  ( ($award =~ /^correct/      return  ( ($award =~ /^correct/
        && lc($Apache::lonhomework::problemstatus) ne 'no')         && &Apache::lonhomework::show_problem_status())
       || $status eq "SHOW_ANSWER");        || $status eq "SHOW_ANSWER");
 }  }
   

Removed from v.1.177  
changed lines
  Added in v.1.184


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