Rev 15179 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
11375 | bpr | 1 | type=order |
13714 | obado | 2 | textarea="instruction data1 data2 data3 data4 data5" |
3 | iEdit="instruction" |
||
4375 | bpr | 4 | |
13477 | obado | 5 | :Mix of letters |
6 | <p>Make a word with letters. Up to 5 word lists can be entered. |
||
7 | A random word in each list is taken each time. |
||
8 | An indication can be made for each word.</p> |
||
11544 | obado | 9 | <p><span class="wims_warning">$wims_name_warning</span>. |
13477 | obado | 10 | You must verify that other words are not feasible with the same letters |
11 | or put an indication that allows differentiation.</p> |
||
15179 | lemaire | 12 | <p>Author of the model: <a href="mailto:bernadette.m.riou@orange.fr">Bernadette Perrin-Riou</a></p> |
4375 | bpr | 13 | :%%%%%%%%%%%%%%%%% ATTENTION %%%%%%%%%%%%%%%%%%%% |
14 | |||
11544 | obado | 15 | Remove the above header if you destroy the model tags! (The lines starting |
16 | with a ':'.) Otherwise the exercise might not be taken back by Createxo. |
||
4375 | bpr | 17 | |
11544 | obado | 18 | :%%%%%%%% Sample parameters to be redefined %%%%%%%%%%%%%%%%% |
4375 | bpr | 19 | |
13477 | obado | 20 | :\title{Make a word with letters} |
5147 | bpr | 21 | :\author{Bernadette, Perrin-Riou} |
4375 | bpr | 22 | :\email{bpr@math.u-psud.fr} |
5724 | bpr | 23 | :\credits{} |
4375 | bpr | 24 | |
13477 | obado | 25 | :Instructions |
26 | \text{instruction=Compose a word with all the proposed letters.} |
||
4375 | bpr | 27 | |
13714 | obado | 28 | :Number of words (maximum 5) |
29 | The number of words must be less than 5 |
||
30 | and less than the number of lists completed below. |
||
4375 | bpr | 31 | \integer{N=3} |
32 | |||
13477 | obado | 33 | :First word list |
34 | Put a word (or group of words) per line, possibly followed by an indication. |
||
35 | If it is a group of words, replace the space with <span class="tt">_</span>. |
||
36 | \text{data1=tree, a plant |
||
37 | domino, a game} |
||
38 | |||
39 | :Second word list |
||
40 | \text{data2=child |
||
41 | mother |
||
13481 | obado | 42 | father} |
13477 | obado | 43 | |
44 | :Third word list |
||
45 | \text{data3=house |
||
46 | building |
||
4375 | bpr | 47 | villa |
13477 | obado | 48 | dwelling |
4375 | bpr | 49 | } |
13477 | obado | 50 | |
51 | :Fourth word list |
||
4375 | bpr | 52 | \text{data4=} |
13477 | obado | 53 | |
54 | :Fifth word list |
||
4375 | bpr | 55 | \text{data5=} |
56 | |||
11544 | obado | 57 | :%%%%%%%%%%%%%% Nothing to modify until statement %%%%%%%%%%%%%%%% |
13714 | obado | 58 | \css{<style> |
13481 | obado | 59 | .word_jumble{ |
60 | font-size:large; |
||
61 | padding:6px; |
||
62 | margin-left:10px; |
||
63 | border: 1px solid #555; |
||
64 | }</style>} |
||
65 | |||
4375 | bpr | 66 | \matrix{data1=\data1} |
67 | \text{mot1=wims(nonempty items \data1[;1])} |
||
68 | \text{mot1=items(\mot1)>=2 ? shuffle(\mot1)} |
||
69 | \text{mot1=\mot1[1]} |
||
70 | \text{indication1=wims(select \data1 where column 1 issametext \mot1)} |
||
71 | \text{indication1=\indication1[2]} |
||
72 | \text{indication1=\indication1 issametext ? xxx} |
||
73 | \text{mot=\mot1} |
||
74 | \matrix{indication=\indication1} |
||
75 | \matrix{data2=\data2} |
||
76 | \text{mot2=wims(nonempty items \data2[;1])} |
||
77 | \text{mot2=items(\mot2)>=2 ? shuffle(\mot2)} |
||
78 | \text{mot2=\mot2[1]} |
||
4734 | bpr | 79 | \if{\mot2!=}{ |
13714 | obado | 80 | \text{indication2=wims(select \data2 where column 1 issametext \mot2)} |
81 | \text{indication2=\indication2[2]} |
||
82 | \text{indication2=\indication2 issametext ? xxx} |
||
83 | \text{mot=wims(append item \mot2 to \mot)} |
||
84 | \matrix{indication=wims(append line \indication2 to \indication)} |
||
4375 | bpr | 85 | } |
13714 | obado | 86 | |
4375 | bpr | 87 | \matrix{data3=\data3} |
88 | \text{mot3=wims(nonempty items \data3[;1])} |
||
89 | \text{mot3=items(\mot3)>=2 ? shuffle(\mot3)} |
||
90 | \text{mot3=\mot3[1]} |
||
4734 | bpr | 91 | \if{\mot3!=}{ |
4375 | bpr | 92 | \text{indication3=wims(select \data3 where column 1 issametext \mot3)} |
93 | \text{indication3=\indication3[2]} |
||
94 | \text{indication3=\indication3 issametext ? xxx} |
||
95 | \text{mot=wims(append item \mot3 to \mot)} |
||
96 | \matrix{indication=wims(append line \indication3 to \indication)} |
||
97 | } |
||
98 | |||
99 | \matrix{data4=\data4} |
||
100 | \text{mot4=wims(nonempty items \data4[;1])} |
||
101 | \text{mot4=items(\mot4)>=2 ? shuffle(\mot4)} |
||
102 | \text{mot4=\mot4[1]} |
||
103 | \if{\mot4!=}{ |
||
104 | \text{indication4=wims(select \data4 where column 1 issametext \mot4)} |
||
105 | \text{indication4=\indication4[2]} |
||
106 | \text{indication4=\indication4 issametext ? xxx} |
||
4734 | bpr | 107 | \text{mot=wims(append item \mot4 to \mot)} |
4375 | bpr | 108 | \matrix{indication=wims(append line \indication4 to \indication)} |
109 | } |
||
110 | |||
111 | \matrix{data5=\data5} |
||
112 | \text{mot5=wims(nonempty items \data5[;1])} |
||
113 | \text{mot5=items(\mot5)>=2 ? shuffle(\mot5)} |
||
114 | \text{mot5=\mot5[1]} |
||
115 | \if{\mot5!=}{ |
||
116 | \text{indication5=wims(select \data5 where column 1 issametext \mot5)} |
||
117 | \text{indication5=\indication5[2]} |
||
118 | \text{indication5=\indication5 issametext ? xxx} |
||
4734 | bpr | 119 | \text{mot=wims(append item \mot5 to \mot)} |
4375 | bpr | 120 | \matrix{indication=wims(append line \indication5 to \indication)} |
121 | } |
||
122 | |||
123 | \integer{N1=items(\mot)} |
||
124 | \text{bat=shuffle(\N1)} |
||
125 | \integer{N=min(\N1,\N)} |
||
126 | |||
127 | \text{mot=\mot[\bat]} |
||
128 | \matrix{indication=\indication[\bat;]} |
||
129 | \text{mot1=wims(text expand \mot[1] using 01)} |
||
130 | \text{mot1=wims(words2items \mot1)} |
||
5271 | bpr | 131 | \text{mot1=wims(replace internal _ by in \mot1)} |
4375 | bpr | 132 | |
133 | \text{mot2=wims(text expand \mot[2] using 01)} |
||
134 | \text{mot2=wims(words2items \mot2)} |
||
5271 | bpr | 135 | \text{mot2=wims(replace internal _ by in \mot2)} |
4375 | bpr | 136 | |
137 | \text{mot3=wims(text expand \mot[3] using 01)} |
||
138 | \text{mot3=wims(words2items \mot3)} |
||
5271 | bpr | 139 | \text{mot3=wims(replace internal _ by in \mot3)} |
4375 | bpr | 140 | |
141 | \text{mot4=wims(text expand \mot[4] using 01)} |
||
142 | \text{mot4=wims(words2items \mot4)} |
||
5271 | bpr | 143 | \text{mot4=wims(replace internal _ by in \mot4)} |
4375 | bpr | 144 | |
145 | \text{mot5=wims(text expand \mot[5] using 01)} |
||
146 | \text{mot5=wims(words2items \mot5)} |
||
5271 | bpr | 147 | \text{mot5=wims(replace internal _ by in \mot5)} |
13714 | obado | 148 | |
4375 | bpr | 149 | \text{Mot=} |
150 | \text{STEP=wims(makelist r x for x=1 to \N)} |
||
151 | \text{STEP=r1} |
||
152 | \nextstep{\STEP} |
||
153 | |||
11544 | obado | 154 | ::You don't need to modify this in general. |
155 | |||
4375 | bpr | 156 | \statement{ |
13481 | obado | 157 | \for{a=1 to \step-1}{ |
158 | \if{\a <= \N}{ |
||
13714 | obado | 159 | <div class="word_jumble">\Mot[\a;] |
160 | \if{ \indication[\a;] notsametext xxx }{<em class="indication">(\indication[\a;])</em>}</div> |
||
13481 | obado | 161 | } |
4375 | bpr | 162 | } |
13481 | obado | 163 | \if{\step <= \N}{ |
15703 | obado | 164 | <div class="instruction">\instruction</div> |
13481 | obado | 165 | <div class="wimscenter"> |
166 | \embed{r \step,50 x 50} |
||
167 | \if{ \indication[\step;] notsametext xxx }{ |
||
13714 | obado | 168 | <span class="indication">(\indication[\step;])</span> } |
13481 | obado | 169 | </div> |
170 | } |
||
4375 | bpr | 171 | } |
11544 | obado | 172 | |
4375 | bpr | 173 | \answer{}{\mot1}{type=dragfill}{option=nonstop} |
174 | \answer{}{\mot2}{type=dragfill}{option=nonstop} |
||
175 | \answer{}{\mot3}{type=dragfill}{option=nonstop} |
||
176 | \answer{}{\mot4}{type=dragfill}{option=nonstop} |
||
177 | \answer{}{\mot5}{type=dragfill}{option=nonstop} |
||
178 | |||
179 | \text{Mot=\reply1 |
||
180 | \reply2 |
||
181 | \reply3 |
||
182 | \reply4 |
||
183 | \reply5} |
||
184 | \text{Mot=wims(replace , by in \Mot)} |
||
185 | \matrix{Mot=\Mot} |
||
186 | \text{STEP=\step <= \N ? r \step:} |