Diff for /loncom/homework/caparesponse/caparesponse.pm between versions 1.259 and 1.260

version 1.259, 2018/09/13 17:00:05 version 1.260, 2018/09/14 02:51:39
Line 760  sub end_numericalresponse { Line 760  sub end_numericalresponse {
  my $ans=$answers[$i];   my $ans=$answers[$i];
  my $fmt=$formats[0];   my $fmt=$formats[0];
  if (@formats && $#formats) {$fmt=$formats[$i];}   if (@formats && $#formats) {$fmt=$formats[$i];}
  foreach my $element (@$ans) {       my @answers;
    if (ref($ans) eq 'ARRAY') {
       @answers = (@{$ans});
    }
    foreach my $element (@answers) {    
     if ($fmt && $tag eq 'numericalresponse') {      if ($fmt && $tag eq 'numericalresponse') {
  $fmt=~s/e/E/g;   $fmt=~s/e/E/g;
  if ($unit=~/\$/) { $fmt="\$".$fmt; $unit=~s/\$//g; }   if ($unit=~/\$/) { $fmt="\$".$fmt; $unit=~s/\$//g; }
Line 770  sub end_numericalresponse { Line 774  sub end_numericalresponse {
  if ($fmt=~/\$/ && !$needsdollar) { $element=~s/\$//; }   if ($fmt=~/\$/ && !$needsdollar) { $element=~s/\$//; }
     }      }
  }   }
  push(@fmt_ans,join(',',@$ans));   push(@fmt_ans,join(',',@answers));
     }      }
     my $response=\@fmt_ans;      my $response=\@fmt_ans;
   

Removed from v.1.259  
changed lines
  Added in v.1.260


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