Diff for /loncom/homework/response.pm between versions 1.181 and 1.187

version 1.181, 2007/10/17 00:22:51 version 1.187, 2008/02/01 22:05:45
Line 454  sub end_customresponse { Line 454  sub end_customresponse {
  &Apache::lonxml::increment_counter(&Apache::response::repetition(),   &Apache::lonxml::increment_counter(&Apache::response::repetition(),
    "$part.$id");     "$part.$id");
  if ($target eq 'analyze') {   if ($target eq 'analyze') {
               $Apache::lonhomework::analyze{"$part.$id.type"} = 'customresponse';
     &Apache::lonhomework::set_bubble_lines();      &Apache::lonhomework::set_bubble_lines();
  }   }
     }      }
Line 675  sub start_responseparam { Line 676  sub start_responseparam {
  $Apache::lonnet::packagetab{"$tag&$name&display"};   $Apache::lonnet::packagetab{"$tag&$name&display"};
     $token->[2]->{'default'}=      $token->[2]->{'default'}=
  $Apache::lonnet::packagetab{"$tag&$name&default"};   $Apache::lonnet::packagetab{"$tag&$name&default"};
               $token->[3] = ['name','type','description','default'];
     $constructtag=1;      $constructtag=1;
  }   }
  if ($constructtag) {   if ($constructtag) {
Line 825  sub answer_footer { Line 827  sub answer_footer {
  $result .= join(' & ',@answer_bits);   $result .= join(' & ',@answer_bits);
  $result .= ' \\\\ \\hline \end{tabular} \vskip 0 mm ';   $result .= ' \\\\ \\hline \end{tabular} \vskip 0 mm ';
     } else {      } else {
  $result = '</tr></table>';   if (!$need_row_start) {
       $result .= '</tr>';
    }
    $result .= '</table>';
     }      }
     return $result;      return $result;
 }  }
Line 884  sub getresponse { Line 889  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 895  sub getresponse { Line 899  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;
     }      }
           
Line 907  sub getresponse { Line 910  sub getresponse {
  # save bubbled letter for later   # save bubbled letter for later
  $Apache::lonhomework::results{"resource.$part.$id.scantron"}.=   $Apache::lonhomework::results{"resource.$part.$id.scantron"}.=
     $response;      $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;

Removed from v.1.181  
changed lines
  Added in v.1.187


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