Diff for /loncom/homework/caparesponse/caparesponse.pm between versions 1.70 and 1.74

version 1.70, 2002/11/07 19:45:16 version 1.74, 2002/11/27 16:50:09
Line 113  sub start_numericalresponse { Line 113  sub start_numericalresponse {
     }      }
   } elsif ($target eq 'meta') {    } elsif ($target eq 'meta') {
     $result=&Apache::response::meta_package_write('numericalresponse');      $result=&Apache::response::meta_package_write('numericalresponse');
     } elsif ($target eq 'answer' || $target eq 'grade') {
         &Apache::response::reset_params();
   }    }
   return $result;    return $result;
 }  }
Line 120  sub start_numericalresponse { Line 122  sub start_numericalresponse {
 sub end_numericalresponse {  sub end_numericalresponse {
   my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;    my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
   my $result = '';    my $result = '';
     if (!$Apache::lonxml::default_homework_loaded) {
         &Apache::lonxml::default_homework_load($safeeval);
     }
   if ( $target eq 'grade' ) {    if ( $target eq 'grade' ) {
     if ( defined $ENV{'form.submitted'}) {      if ( defined $ENV{'form.submitted'}) {
       &Apache::response::setup_params($$tagstack[-1]);        &Apache::response::setup_params($$tagstack[-1]);
Line 223  sub end_numericalresponse { Line 228  sub end_numericalresponse {
  my @alphabet = ('A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P',   my @alphabet = ('A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P',
  'Q','R','S','T','U','V','W','X','Y','Z');   'Q','R','S','T','U','V','W','X','Y','Z');
         if ($target eq 'web') {          if ($target eq 'web') {
       my $id=$Apache::inputtags::response[-1];
     $result.= '<table border="1"><tr>';      $result.= '<table border="1"><tr>';
     for ($ind=0;$ind<$number_of_bubbles;$ind++) {      for ($ind=0;$ind<$number_of_bubbles;$ind++) {
  my $ans;   my $ans;
Line 241  sub end_numericalresponse { Line 247  sub end_numericalresponse {
     }      }
     $ans = sprintf('%.'.$format,$bubbles_values[$ind]);      $ans = sprintf('%.'.$format,$bubbles_values[$ind]);
  }   }
     $result.='<td>'.$alphabet[$ind].': '.$ans.'</td>';      $result.='<td><input type="radio" name="HWVAL'.$id.'" value="'.$ans.'"><b>'.$alphabet[$ind].'</b>: '.$ans.'</td>';
     }      }
     $result.='</tr></table>';      $result.='</tr></table>';
  } elsif ($target eq 'tex') {   } elsif ($target eq 'tex') {
Line 354  sub end_numericalresponse { Line 360  sub end_numericalresponse {
       }        }
   }    }
   if ($target eq 'answer') {    if ($target eq 'answer') {
       if ($high) { $ans.=' ['.$low.','.$high.'] '; }        if ($high) { $ans.=' ['.$low.','.$high.']'; }
       if ($sighigh) { $ans.= "Sig <i>$siglow - $sighigh</i>"; }        if ($sighigh) { $ans.= " Sig <i>$siglow - $sighigh</i>"; }
       $result.=&Apache::response::answer_part($$tagstack[-1],$ans);        $result.=&Apache::response::answer_part($$tagstack[-1],$ans);
   } elsif ($target eq 'analyze') {    } elsif ($target eq 'analyze') {
       push (@{ $Apache::lonhomework::analyze{"$part_id.answer"} },        push (@{ $Apache::lonhomework::analyze{"$part_id.answer"} },

Removed from v.1.70  
changed lines
  Added in v.1.74


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