Diff for /loncom/homework/caparesponse/caparesponse.pm between versions 1.114 and 1.116

version 1.114, 2003/09/22 20:49:01 version 1.116, 2003/10/15 19:40:43
Line 114  sub end_numericalresponse { Line 114  sub end_numericalresponse {
     if ( $response =~ /[^\s]/) {      if ( $response =~ /[^\s]/) {
  my $ad;   my $ad;
  my %previous = &Apache::response::check_for_previous($response,$partid,$id);   my %previous = &Apache::response::check_for_previous($response,$partid,$id);
  $Apache::lonhomework::results{"resource.$partid.$id.submission"}=$response;  
  &Apache::lonxml::debug("submitted a $response<br>\n");   &Apache::lonxml::debug("submitted a $response<br>\n");
  &Apache::lonxml::debug($$parstack[-1] . "\n<br>");   &Apache::lonxml::debug($$parstack[-1] . "\n<br>");
   
Line 131  sub end_numericalresponse { Line 130  sub end_numericalresponse {
     $response =~ s/\\/\\\\/g;      $response =~ s/\\/\\\\/g;
     $response =~ s/\'/\\\'/g;      $response =~ s/\'/\\\'/g;
  }   }
    $Apache::lonhomework::results{"resource.$partid.$id.submission"}=$response;
  &Apache::lonxml::debug("current $response");   &Apache::lonxml::debug("current $response");
  my $expression="&caparesponse_check_list('".$response."','".   my $expression="&caparesponse_check_list('".$response."','".
     $$parstack[-1];      $$parstack[-1];
Line 220  sub end_numericalresponse { Line 220  sub end_numericalresponse {
  if ($$tagstack[-1] eq 'numericalresponse') {   if ($$tagstack[-1] eq 'numericalresponse') {
     if ($unit=~/\S/) {$result.=' (in '.$unit.')<br /><br />';}      if ($unit=~/\S/) {$result.=' (in '.$unit.')<br /><br />';}
     $result.= '<table border="1"><tr>';      $result.= '<table border="1"><tr>';
       my $previous=$Apache::lonhomework::history{"resource.$Apache::inputtags::part.$id.submission"};
     for (my $ind=0;$ind<$number_of_bubbles;$ind++) {      for (my $ind=0;$ind<$number_of_bubbles;$ind++) {
    my $checked='';
    if ($previous eq $bubble_values[$ind]) {
       $checked=" checked='on' ";
    }
  $result.='<td><input type="radio" name="HWVAL_'.$id.   $result.='<td><input type="radio" name="HWVAL_'.$id.
     '" value="'.$bubble_values[$ind].'"><b>'.      '" value="'.$bubble_values[$ind].'" '.$checked
  $alphabet[$ind].'</b>: '.      .' /><b>'.$alphabet[$ind].'</b>: '.
     $bubble_values[$ind].'</td>';      $bubble_values[$ind].'</td>';
     }      }
     $result.='</tr></table>';      $result.='</tr></table>';
  } elsif ($$tagstack[-1] eq 'formularesponse') {   } elsif ($$tagstack[-1] eq 'formularesponse') {

Removed from v.1.114  
changed lines
  Added in v.1.116


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