Subversion Repositories wimsdev

Rev

Rev 5903 | Rev 6249 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5903 Rev 5947
Line 1... Line 1...
1
 
1
 
2
<center><h3>Feedback according to answers</h3></center> <p>
2
<h3 class="wimscenter">Feedback according to answers</h3>
3
 
3
 
4
You may define conditions (on the values of user answers) under which a
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
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.
6
will be to give warnings when a typical error to the exercise is detected.
7
<p>
7
<p>
8
An arbitrary number of feedbacks can be added, on any kind of replies
8
An arbitrary number of feedbacks can be added, on any kind of replies
9
(freestyle or multiple choice). The syntax is as follows.
9
(freestyle or multiple choice). The syntax is as follows.
10
<pre>
10
</p><pre>
11
\feedback{CONDITION}{MESSAGE}
11
\feedback{CONDITION}{MESSAGE}
12
</pre>
12
</pre>
13
The line can be put into the field of parameters (under guided mode) or
13
The line can be put into the field of parameters (under guided mode) or
14
anywhere in the source (under raw mode).
14
anywhere in the source (under raw mode).
15
<p>
15
<p>
Line 18... Line 18...
18
user replies can be put into both via the variables <span class="tt wims_code_variable">\reply1</span>,
18
user replies can be put into both via the variables <span class="tt wims_code_variable">\reply1</span>,
19
<span class="tt wims_code_variable">\reply2</span>,... (for freestyle replies), <span class="tt wims_code_variable">\choice1</span>,
19
<span class="tt wims_code_variable">\reply2</span>,... (for freestyle replies), <span class="tt wims_code_variable">\choice1</span>,
20
<span class="tt wims_code_variable">\choice2</span>,... (for multiple choices). The order in the variables
20
<span class="tt wims_code_variable">\choice2</span>,... (for multiple choices). The order in the variables
21
is the order of their appearance in the source (or in the form under the
21
is the order of their appearance in the source (or in the form under the
22
guided mode).
22
guided mode).
23
<p>
23
</p><p>
24
<span class="tt">MESSAGE</span> is a free text, accepting embedded html tags and
24
<span class="tt">MESSAGE</span> is a free text, accepting embedded html tags and
25
mathematical symbols.
25
mathematical symbols.
26
 
26
 
27
<p>
27
</p><p>
28
One can use also the variables <span class="tt wims_code_variable">\sc_reply1</span>, <span class="tt wims_code_variable">\sc_reply2</span>,
28
One can use also the variables <span class="tt wims_code_variable">\sc_reply1</span>, <span class="tt wims_code_variable">\sc_reply2</span>,
29
... which are equal to  1 in case of good user reply, 0 in case of false
29
... which are equal to  1 in case of good user reply, 0 in case of false
30
user reply and 0.5 in case of good reply up to numerical precision. This variable
30
user reply and 0.5 in case of good reply up to numerical precision. This variable
31
does not take care of conditions and is empty in the case where the
31
does not take care of conditions and is empty in the case where the
32
answer is analyzed only with conditions.
32
answer is analyzed only with conditions.
33
 
-
 
34
 
33
</p>
35
<p>$table_header
34
$table_header
36
<caption>Examples of conditions
35
<caption>Examples of conditions
37
<small>
36
<small>
38
!href target=wims_mhelp cmd=help&special_parm=if complete list
37
!href target=wims_mhelp cmd=help&special_parm=if complete list
39
</small>
38
</small>
40
</caption>
39
</caption>
41
$table_hdtr<th>condition<th>when it is met
40
$table_hdtr<th>condition</th><th>when it is met</th></tr>
42
$table_tr<td><tt class="wims_code_words">\reply1=5<td>first freestyle reply is exactly equal to 5
41
$table_tr<td><span class="tt wims_code_words">\reply1=5</span></td><td>first freestyle reply is exactly equal to 5</td></tr>
43
$table_tr<td><tt class="wims_code_words">\reply1&gt;\reply2+2<td>first freestyle reply is &gt; second one plus 2
42
$table_tr<td><span class="tt wims_code_words">\reply1&gt;\reply2+2</span></td><td>first freestyle reply is &gt; second one plus 2</td></tr>
44
$table_tr<td><tt class="wims_code_words">\choice1=Yes and \choice2=No
43
$table_tr<td><span class="tt wims_code_words">\choice1=Yes and \choice2=No</span></td>
45
  <td>first multiple choice is Yes and second is No (<b>attention</b> the
44
  <td>first multiple choice is Yes and second is No (<b>attention</b> the
46
comparison in multiple choices is case-sensitive!)
45
comparison in multiple choices is case-sensitive!)
-
 
46
</td></tr>
47
$table_tr<td><tt class="wims_code_words">\reply1&lt;5 or \reply1&gt;8
47
$table_tr<td><span class="tt wims_code_words">\reply1&lt;5 or \reply1&gt;8</span></td>
48
  <td>first reply is outside the range from 5 to 8.
48
  <td>first reply is outside the range from 5 to 8.
49
$table_tr<td><tt class="wims_code_words">3 isitemof \reply1
49
</td></tr>$table_tr<td><tt class="wims_code_words">3 isitemof \reply1
50
  <td>the first reply, of type "set" or "vector", contains a component "3".
50
  <td>the first reply, of type "set" or "vector", contains a component "3".
51
 
51
</td></tr>
52
$table_end
52
$table_end
53
<p>
53
<p>
54
<b>Known-bug</b>. You should avoid mixing <span class="tt wims_code_variable">\reply</span> and
54
<b>Known-bug</b>. You should avoid mixing <span class="tt wims_code_variable">\reply</span> and
55
<span class="tt wims_code_variable">\choice</span> within one same condition. Otherwise the result will be
55
<span class="tt wims_code_variable">\choice</span> within one same condition. Otherwise the result will be
56
unpredictable.
56
unpredictable.
57
 
57
</p>