Rev 14625 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
20 | reyssat | 1 | !nocache |
2 | varcnt=$[min($varcnt,$limit_var)] |
||
3 | replycnt=$[min($replycnt,$limit_reply)] |
||
4 | choicecnt=$[min($choicecnt,$limit_choice)] |
||
5 | !reset fill_check fill_checked |
||
6 | |||
7 | !for i=1 to $choicecnt |
||
12348 | bpr | 8 | choice$i= |
9 | cbad=!listuniq $(choicebad$i) |
||
10 | cgood=!listuniq $(choicegood$i) |
||
11 | cbad=!listcomplement $cgood in $cbad |
||
12 | choicebad$i=$cbad |
||
13 | itemg=!itemcnt $cgood |
||
14 | itemb=!itemcnt $cbad |
||
15 | !if $itemg<=1 and $qcmgood>0 and $itemb>1 |
||
16 | shf=!shuffle $itemb-1 |
||
17 | ccbad=!item 2 to -1 of $cbad |
||
18 | tmp=!item 1 of $cbad |
||
19 | ccbad=!item $shf of $ccbad |
||
20 | cbad=$tmp,$ccbad |
||
21 | cli=!item 1 to $qcmpresent of $cgood,$cbad |
||
22 | !else |
||
23 | shf=!shuffle $cgood,$cbad |
||
24 | cli=!item 1 to $qcmpresent of $shf |
||
25 | !if $qcmpresent<=$itemb |
||
26 | qcmgood=0 |
||
27 | !endif |
||
20 | reyssat | 28 | !endif |
12348 | bpr | 29 | choiceitems$i=!itemcnt $cli |
30 | num=yes |
||
31 | !for j=1 to $(choiceitems$i) |
||
32 | t=!item $j of $cli |
||
33 | t=$[$t] |
||
34 | !if NaN isin $t |
||
14625 | bpr | 35 | num=no |
12348 | bpr | 36 | !endif |
37 | !next j |
||
38 | !if shuffle iswordof $(choiceoption$i) |
||
39 | choicelist$i=!shuffle $cli |
||
20 | reyssat | 40 | !else |
12348 | bpr | 41 | !if $num=yes |
42 | choicelist$i=!sort numeric list $cli |
||
43 | !else |
||
44 | choicelist$i=!sort nocase list $cli |
||
45 | !endif |
||
20 | reyssat | 46 | !endif |
12348 | bpr | 47 | choicegood$i=!listintersect $cgood and $cli |
20 | reyssat | 48 | !next i |
49 | |||
50 | !for i=1 to $replycnt |
||
14625 | bpr | 51 | reply$i= |
52 | replygood$i=!trim $(replygood$i) |
||
15534 | bpr | 53 | !!FIXME to replace by !reset inputprompt[$limit_reply] when it will be avalaible |
54 | !!useful for exercises by createxo |
||
55 | !if $(inputprompt$i)!=$empty |
||
56 | !reset inputprompt$i |
||
57 | !endif |
||
20 | reyssat | 58 | !next i |
59 | |||
60 | !read oef/valsave.proc |
||
61 | |||
62 | !if $ansorder=$empty |
||
14625 | bpr | 63 | !for i=1 to $choicecnt |
64 | ansorder=!append item c to $ansorder |
||
65 | !next i |
||
66 | !for i=1 to $replycnt |
||
67 | ansorder=!append item r to $ansorder |
||
68 | !next i |
||
20 | reyssat | 69 | !endif |
70 | |||
71 | !bound precision between integer 20 and 100000000 default 10000 |
||
72 | !default leftrange=-5 |
||
73 | !default rightrange=5 |
||
74 | !default cchoicecnt=$choicecnt |
||
75 | !default creplycnt=$replycnt |
||
76 | wims_compare_precision=$precision |
||
77 | question_url= |
||
78 | status=waiting |
||
79 | !default conditioncnt=0 |