Subversion Repositories wimsdev

Rev

Rev 15692 | Blame | Compare with Previous | Last modification | View Log | RSS feed

  1.  <b>Number.</b> (name: <span class="tt wims_code_words">numeric</span>)<br>
  2.  Comparison of real numbers up to the precision defined by the author.
  3. <p>
  4. Precision can be fixed in the field
  5. <span class="tt wims_code_words">precision</span>,
  6. by default 1000.
  7. The error is by default relative : the difference between the correct answer and the
  8. reply should be less in absolute value than
  9. <span class="tt">M(prec)</span>
  10. where
  11. <div class="wimscenter">
  12. !insmath M(prec)= \frac{max(|\mbox{reply}|+|\mbox{goodreply}|,\frac{1}{\mbox{prec}})}{\mbox{prec}}
  13. </div>
  14. (replace
  15.  <span class="tt">precision</span> by <span class="tt">sqrt(precision)</span>
  16. for a correct answer up to precision).
  17. </p>
  18. :option
  19. <p>
  20. If the word <span class="tt wims_code_words">comma</span> is in the option,
  21. real numbers can be written with
  22. a comma instead of the decimal point (but the correct answer must be with a
  23. decimal point). In this case, if the answer is correct, the correct answer is written
  24. with the same "decimal point" as the one of the student.
  25. </p>
  26. <p>
  27. If the word <span class="tt wims_code_words">absolute</span> is in the option, the precision is absolute.
  28. The answer is then correct up to precision if the difference is less than 10/precision.
  29. </p>
  30. :example
  31.  
  32. !distribute items good,bad,poor precision into name_good,name_bad,name_prec
  33. !set name_header=Answer,Relative <br> precision,Absolute <br>précision <br>, Difference <br>with
  34. !set example=0.42,0.4205,0.4192,0.4191,0.4190,0.4,0.39,500000
  35. !set nb_ex=!itemcnt $example
  36. !set precision=1000
  37.  
  38. !read help/anstype/table_numeric.phtml
  39.  
  40. !set example=505.42,505.4205,505.4192,505.4191,505.4190,505.4,505.39
  41. !set nb_ex=!itemcnt $example
  42. !set precision=1000
  43.  
  44. !read help/anstype/table_numeric.phtml
  45.