Diff for /loncom/homework/templates/CustomResponse.problem between versions 1.1 and 1.4

version 1.1, 2006/07/18 17:24:39 version 1.4, 2010/06/10 22:37:12
Line 1 Line 1
 <problem>  <problem>
 <startouttext />Accept an answer of around 90 or -90<endouttext />  
   <customresponse answerdisplay="something near 90 or -90">  <startouttext />
   Accept an answer of around 90 or -90
   <endouttext />
   
   <customresponse answerdisplay="something near 90 or -90">
     <answer type="loncapa/perl">      <answer type="loncapa/perl">
 # We do not want a vector  # We do not want a vector
 if ($submission=~/\,/) { return 'ANS_CNT_NOT_MATCH'; }  if ($submission=~/\,/) { return 'EXTRA_ANSWER'; }
 # No units needed  # No units needed
 if ($submission=~/^\d+\s+\w+$/) { return 'UNIT_NOTNEEDED'; }  if ($submission=~/^\d+\s+\w+$/) { return 'UNIT_NOTNEEDED'; }
 # Need a numerical answer here  # Need a numerical answer here
 if ($submission!~/^\d+$/) { return 'WANTED_NUMERIC'; }  if ($submission!~/^[\d\.\-]+$/) { return 'WANTED_NUMERIC'; }
 $difference=abs(90-abs($submission));  $difference=abs(90-abs($submission));
 if ($difference==0) { return 'EXACT_ANS'; }  if ($difference==0) { return 'EXACT_ANS'; }
 if ($difference < 0.001) { return 'APPROX_ANS'; }  if ($difference < 0.001) { return 'APPROX_ANS'; }
 return 'INCORRECT';  return 'INCORRECT';
     </answer>      </answer>
     <textline />      <textline />
   </customresponse>  </customresponse>
 </problem>  
   
   </problem>

Removed from v.1.1  
changed lines
  Added in v.1.4


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