Rev 15179 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
11375 | bpr | 1 | type=gapfill first |
13781 | bpr | 2 | textarea="explain data feedback_general" |
3 | iEdit="explain feedback_general" |
||
4 | asis="explain feedback_general" |
||
23 | reyssat | 5 | |
6376 | bpr | 6 | :Mixte multiple choice questions embedded in a non variable text. |
23 | reyssat | 7 | |
13704 | obado | 8 | This exercise presents a text where response fields are inserted. |
23 | reyssat | 9 | <p> |
13704 | obado | 10 | To build an exercise with this model, just enter the text. |
11 | An easy syntax allows you to incorporate multiple choice fields and |
||
12 | free answers in the text. |
||
13477 | obado | 13 | </p> |
15179 | lemaire | 14 | <p class="wims_credits">Author of the model: <a href="mailto:qualite@wimsedu.info">Gang Xiao</a></p> |
23 | reyssat | 15 | |
16 | :%%%%%%%%%%%%%%%%% ATTENTION %%%%%%%%%%%%%%%%%%%% |
||
17 | |||
11544 | obado | 18 | Remove the above header if you destroy the model tags! (The lines starting |
19 | with a ':'.) Otherwise the exercise might not be taken back by Createxo. |
||
23 | reyssat | 20 | |
11544 | obado | 21 | :%%%%%%%% Sample parameters to be redefined %%%%%%%%%%%%%%%%% |
23 | reyssat | 22 | |
10454 | obado | 23 | :\title{Choices in a text} |
5608 | bpr | 24 | :\author{XIAO, Gang} |
8002 | bpr | 25 | :\email{qualite@wimsedu.info} |
5724 | bpr | 26 | :\credits{} |
23 | reyssat | 27 | |
14235 | obado | 28 | :Instruction for learners |
29 | |||
13781 | bpr | 30 | \text{explain=Remplissez.} |
31 | |||
13477 | obado | 32 | :Main data. |
13704 | obado | 33 | Questions to ask should be put between a pair of |
34 | double-question marks "??". |
||
23 | reyssat | 35 | <p> |
13704 | obado | 36 | The question is a multiple choice if it contains multiple objects separated by commas, |
17175 | bpr | 37 | the correct answer being first.<br> |
13704 | obado | 38 | If the question (between ??) contains only one object, then it is a free answer, |
39 | numeric if it is a number or textual otherwise. |
||
13477 | obado | 40 | </p><p> |
13704 | obado | 41 | You can ask up to 20 questions in one sentence. |
14235 | obado | 42 | If several correct answers are possible in a free answer, |
43 | separate all the correct answers (synonyms) with a vertical line <span class="tt wims_code_words">|</span>. |
||
44 | (the analysis is then done by symtext). |
||
13477 | obado | 45 | </p> |
23 | reyssat | 46 | $embraced_randitem |
13781 | bpr | 47 | \text{data=Linux was created in ??1991?? by Linus Torvalds, |
13704 | obado | 48 | who was a ??Finnish, Swedish, American, English, Nordic?? student |
49 | at the time working on the ??Minix?? system on |
||
17175 | bpr | 50 | ??Intel 386,Sun,Macintosh,Bull,Microsoft?? architecture machines.<br> |
13704 | obado | 51 | He posted on a newsgroup the first version of his system, |
13781 | bpr | 52 | which was version ??0.02??. |
23 | reyssat | 53 | } |
11544 | obado | 54 | :Embraced random items |
7165 | bpr | 55 | $embraced_randitem |
10007 | obado | 56 | \text{accolade=item(1,1 yes, |
57 | 2 no)} |
||
23 | reyssat | 58 | |
10007 | obado | 59 | :Menu display order |
60 | Menus can be displayed in a shuffle order or sorted. |
||
61 | \text{list_order=item(1,alpha,shuffle)} |
||
62 | |||
14236 | obado | 63 | :Tolerance level for free answers |
14235 | obado | 64 | The types <span class="tt">case</span> and <span class="tt">nocase</span> are especially suitable for language applications. |
65 | In other cases, prefer<span class="tt">atext</span>. |
||
66 | \text{type_rep=item(3,case (no error tolerance), |
||
67 | nocase (tolerate lowercase / uppercase), |
||
68 | atext (ignore plural / singular and articles))} |
||
69 | |||
11544 | obado | 70 | :%%%%%%%%%%%%%% Nothing to modify until statement %%%%%%%%%%%%%%%% |
7165 | bpr | 71 | \text{accolade=wims(word 1 of \accolade)} |
23 | reyssat | 72 | \precision{10000} |
73 | \text{data=wims(singlespace \data)} |
||
7165 | bpr | 74 | \text{data=\accolade=1 ? wims(embraced randitem \data)} |
23 | reyssat | 75 | \text{data=slib(text/cutchoice2 \data)} |
76 | \integer{qs=min(20,floor(rows(\data)/2))} |
||
77 | \text{types=} |
||
78 | \text{options=} |
||
79 | \text{lengths=} |
||
80 | |||
81 | \text{good=} |
||
82 | \text{field=} |
||
83 | \for{i=1 to \qs}{ |
||
84 | \text{f=\data[2*\i;]} |
||
85 | \integer{test=items(\f)} |
||
86 | \if{\test>1}{ |
||
87 | \text{g=\f[1]} |
||
10007 | obado | 88 | \if{\list_order issametext alpha}{ |
89 | \text{f=wims(sort items \f)} |
||
14235 | obado | 90 | }{ |
10007 | obado | 91 | \text{f=shuffle(\f,,)} |
92 | } |
||
23 | reyssat | 93 | \text{g=positionof(\g,\f)} |
94 | \text{good=\good\g;,} |
||
95 | \text{field=\field\f;} |
||
96 | \text{types=\types[]menu,} |
||
97 | \text{lengths=\lengths,} |
||
98 | }{ |
||
99 | \text{good=\good\f,} |
||
100 | \integer{c=wims(charcnt \f)} |
||
101 | \text{field=\field;} |
||
102 | \real{test=\f} |
||
103 | \if{\test issametext NaN}{ |
||
104 | \text{test=wims(translate internal | to , in \f)} |
||
105 | \integer{c=wims(charcnt \test[1])} |
||
106 | \integer{c=min(50,max(6,\c+6))} |
||
107 | \text{lengths=\lengths\c,} |
||
14235 | obado | 108 | \text{types=\types[]\type_rep,} |
23 | reyssat | 109 | \text{options=| isin \f?\options[]symtext} |
110 | }{ |
||
111 | \integer{c=max(5,\c+2)} |
||
112 | \text{lengths=\lengths\c,} |
||
113 | \text{f1=wims(nospace \f)} |
||
114 | \text{test=wims(text select -0123456789 in \f)} |
||
115 | \text{types=\test issametext \f1 and abs(\f)<4000?\types[]numexp,:\types[]number,} |
||
116 | } |
||
117 | } |
||
118 | \text{options=\options,} |
||
119 | } |
||
120 | |||
121 | \text{qlist=wims(makelist reply x for x=1 to \qs)} |
||
122 | \steps{\qlist} |
||
123 | |||
11544 | obado | 124 | :%%%%%%%%%%%%% Now the statement in HTML. %%%%%%%%%%%%%%%%%%%% |
23 | reyssat | 125 | |
11544 | obado | 126 | ::You don't need to modify this in general. |
23 | reyssat | 127 | |
13781 | bpr | 128 | \statement{<div>\explain</div> |
14235 | obado | 129 | \data[1;] |
130 | \for{k=1 to \qs}{ |
||
131 | \embed{r \k,\lengths[\k]} \data[2*\k+1;] |
||
132 | } |
||
23 | reyssat | 133 | } |
134 | |||
11544 | obado | 135 | :%%%%%%%%%%%%% Nothing to modify after. %%%%%%%%%%%%%%%%%5 |
23 | reyssat | 136 | |
13704 | obado | 137 | \answer{Field 1}{\good[1]\field[1;]}{type=\types[1]}{option=\options[1]} |
138 | \answer{Field 2}{\good[2]\field[2;]}{type=\types[2]}{option=\options[2]} |
||
139 | \answer{Field 3}{\good[3]\field[3;]}{type=\types[3]}{option=\options[3]} |
||
140 | \answer{Field 4}{\good[4]\field[4;]}{type=\types[4]}{option=\options[4]} |
||
141 | \answer{Field 5}{\good[5]\field[5;]}{type=\types[5]}{option=\options[5]} |
||
142 | \answer{Field 6}{\good[6]\field[6;]}{type=\types[6]}{option=\options[6]} |
||
143 | \answer{Field 7}{\good[7]\field[7;]}{type=\types[7]}{option=\options[7]} |
||
144 | \answer{Field 8}{\good[8]\field[8;]}{type=\types[8]}{option=\options[8]} |
||
145 | \answer{Field 9}{\good[9]\field[9;]}{type=\types[9]}{option=\options[9]} |
||
146 | \answer{Field 10}{\good[10]\field[10;]}{type=\types[10]}{option=\options[10]} |
||
147 | \answer{Field 11}{\good[11]\field[11;]}{type=\types[11]}{option=\options[11]} |
||
148 | \answer{Field 12}{\good[12]\field[12;]}{type=\types[12]}{option=\options[12]} |
||
149 | \answer{Field 13}{\good[13]\field[13;]}{type=\types[13]}{option=\options[13]} |
||
150 | \answer{Field 14}{\good[14]\field[14;]}{type=\types[14]}{option=\options[14]} |
||
151 | \answer{Field 15}{\good[15]\field[15;]}{type=\types[15]}{option=\options[15]} |
||
152 | \answer{Field 16}{\good[16]\field[16;]}{type=\types[16]}{option=\options[16]} |
||
153 | \answer{Field 17}{\good[17]\field[17;]}{type=\types[17]}{option=\options[17]} |
||
154 | \answer{Field 18}{\good[18]\field[18;]}{type=\types[18]}{option=\options[18]} |
||
155 | \answer{Field 19}{\good[19]\field[19;]}{type=\types[19]}{option=\options[19]} |
||
156 | \answer{Field 20}{\good[20]\field[20;]}{type=\types[20]}{option=\options[20]} |
||
23 | reyssat | 157 |