Subversion Repositories wimsdev

Rev

Rev 23 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

  1.  
  2. <center><h3>Feedback according to answers</h3></center> <p>
  3.  
  4. You may define conditions (on the values of user answers) under which a
  5. message will be printed on the page of results. A common use of this feature
  6. will be to give warnings when a typical error to the exercise is detected.
  7. <p>
  8. An arbitrary number of feedbacks can be added, on any kind of replies
  9. (freestyle or multiple choice). The syntax is as follows.
  10. <p><tt>
  11. \feedback{CONDITION}{MESSAGE}
  12. </tt> <p>
  13. The line can be put into the field of parameters (under guided mode) or
  14. anywhere in the source (under raw mode).
  15. <p>
  16. When <tt>CONDITION</tt> is met,
  17. <tt>MESSAGE</tt> will be shown to the user in the result page. Values of
  18. user replies can be put into both via the variables <tt>\reply1</tt>,
  19. <tt>\reply2</tt>,... (for freestyle replies), <tt>\choice1</tt>,
  20. <tt>\choice2</tt>,... (for multiple choices). The order in the variables
  21. is the order of their appearance in the source (or in the form under the
  22. guided mode).
  23. <p>
  24. <tt>MESSAGE</tt> is a free text, accepting embedded html tags and
  25. mathematical symbols.
  26. <p>$table_header
  27. <caption>Examples of conditions
  28. <small>
  29. !href target=wims_mhelp cmd=help&special_parm=if complete list
  30. </small>
  31. </caption>
  32. $table_hdtr<th>condition<th>when it is met
  33. $table_tr<td><tt>\reply1=5<td>first freestyle reply is exactly equal to 5
  34. $table_tr<td><tt>\reply1&gt;\reply2+2<td>first freestyle reply is &gt; second one plus 2
  35. $table_tr<td><tt>\choice1=Yes and \choice2=No
  36.   <td>first multiple choice is Yes and second is No (<b>attention</b> the
  37. comparison in multiple choices is case-sensitive!)
  38. $table_tr<td><tt>\reply1&lt;5 or \reply1&gt;8
  39.   <td>first reply is outside the range from 5 to 8.
  40. $table_tr<td><tt>3 isitemof \reply1
  41.   <td>the first reply, of type "set" or "vector", contains a component "3".
  42.  
  43. $table_end
  44. <p>
  45. <b>Known-bug</b>. You should avoid mixing <tt>\reply</tt> and
  46. <tt>\choice</tt> within one same condition. Otherwise the result will be
  47. unpredictable.
  48.  
  49.