Rev 13716 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
11375 | bpr | 1 | type=classify |
13716 | obado | 2 | textarea="data pre post" |
3 | iEdit="pre post" |
||
23 | reyssat | 4 | |
12169 | mquerol | 5 | :Classificar objectes arrossegant-los i deixant-los anar. |
23 | reyssat | 6 | |
12169 | mquerol | 7 | Presentem una llista d'objectes, i hem de classificar segons els seus |
14822 | mquerol | 8 | propietats, llençant-les als quadres proveïts amb el ratolí. |
23 | reyssat | 9 | <p> |
14822 | mquerol | 10 | Per construir un exercici amb aquest model, només cal que introduïu la llista |
12169 | mquerol | 11 | d'objectes i les seves propietats. |
13488 | obado | 12 | </p><p> |
14822 | mquerol | 13 | Amb una petita modificació, es pot acceptar una variant d'aquest model |
13488 | obado | 14 | amb imatges com a objectes.</p> |
5131 | bpr | 15 | $image_help |
13488 | obado | 16 | <p class="wims_credits">Autor del model: Gang Xiao <qualite@wimsedu.info></p> |
23 | reyssat | 17 | |
18 | :%%%%%%%%%%%%%%%%% ATTENTION %%%%%%%%%%%%%%%%%%%% |
||
19 | |||
14822 | mquerol | 20 | Enlevez l'en-tête ci-dessus si vous détruisez les balises pour le modèle ! |
23 | reyssat | 21 | (Ce sont les lignes qui commencent par un ':'.) |
22 | Sinon l'exercice risque de ne pas pouvoir repasser sous Createxo. |
||
23 | |||
14822 | mquerol | 24 | :%%%%%%%% Paramètres d'exemples à redéfinir %%%%%%%%%%%%%%%%% |
23 | reyssat | 25 | |
12169 | mquerol | 26 | :\title{Classificar per categoria} |
5147 | bpr | 27 | :\author{XIAO, Gang} |
8002 | bpr | 28 | :\email{qualite@wimsedu.info} |
7137 | bpr | 29 | :\credits{} |
23 | reyssat | 30 | |
12169 | mquerol | 31 | :Nombre d'objectes a classificar per exercici. Fins a 20. |
23 | reyssat | 32 | \integer{tot=8} |
33 | |||
14822 | mquerol | 34 | :La màxima quantitat d'objectes presentats tenint la mateixa propietat. |
35 | Aquest número ha de ser estrictament superior a 1. |
||
23 | reyssat | 36 | \integer{max1=4} |
37 | |||
12169 | mquerol | 38 | :El nombre de propietats a presentar (per defecte el nombre de propietats) |
14822 | mquerol | 39 | Si el nombre de propietats és estrictament inferior al nombre de propietats, |
40 | un distractor serà seleccionat de propietats no mostrades. |
||
4744 | bpr | 41 | \text{prop_cnt=} |
42 | |||
14822 | mquerol | 43 | :La mida dels objectes per arrossegar, en píxels, x per y. |
44 | Penseu en les persones que augmenten la grandària de la font dels navegadors. |
||
12169 | mquerol | 45 | No deixeu que les caixes siguin massa petites. |
23 | reyssat | 46 | \text{size1=100x40} |
47 | |||
12169 | mquerol | 48 | :Llista de propietats. Fins a 10, separades per comes. |
14822 | mquerol | 49 | \text{prop=Insecte,Oiseau,Mammifère} |
23 | reyssat | 50 | |
12169 | mquerol | 51 | :Dades principals. |
14822 | mquerol | 52 | Escriviu (un per línia) els objectes a classificar, després la seva categoria, separats per una coma. <p> |
12169 | mquerol | 53 | L'objecte pot ser una paraula, una frase (sense comes) i fins i tot una imatge. |
14822 | mquerol | 54 | És millor definir moltes dades per a cada |
13488 | obado | 55 | categoria i almenys dos objectes per a cada categoria.</p> <p> |
12169 | mquerol | 56 | Aneu amb compte de no introduir errors d'escriptura a les propietats. |
57 | En cas contrari, l'objecte corresponent pot causar un mal funcionament de l'exercici.</p> |
||
23 | reyssat | 58 | \matrix{data= |
11319 | bpr | 59 | L'abeille,Insecte |
23 | reyssat | 60 | L'aigle,Oiseau |
61 | L'albatros,Oiseau |
||
62 | L'alouette,Oiseau |
||
63 | La blatte,Insecte |
||
64 | Le canard,Oiseau |
||
14822 | mquerol | 65 | Le chat,Mammifère |
66 | Le cheval,Mammifère |
||
67 | Le chien,Mammifère |
||
68 | Le cochon,Mammifère |
||
23 | reyssat | 69 | Le corbeau,Oiseau |
70 | Le criquet,Insecte |
||
14822 | mquerol | 71 | L'éléphant,Mammifère |
23 | reyssat | 72 | Le faucon,Oiseau |
14822 | mquerol | 73 | Le goéland,Oiseau |
74 | La guêpe,Insecte |
||
75 | Le lion,Mammifère |
||
23 | reyssat | 76 | Le moineau,Oiseau |
77 | La mouche,Insecte |
||
78 | Le moustique,Insecte |
||
14822 | mquerol | 79 | Le mouton,Mammifère |
23 | reyssat | 80 | L'oie,Oiseau |
81 | Le papillon,Insecte |
||
82 | Le pigeon,Oiseau |
||
14822 | mquerol | 83 | Le renard,Mammifère |
23 | reyssat | 84 | Le rossignol,Oiseau |
85 | Le scorpion,Insecte |
||
14822 | mquerol | 86 | Le singe,Mammifère |
87 | Le tigre,Mammifère |
||
88 | La vache,Mammifère |
||
23 | reyssat | 89 | Le vautour,Oiseau |
90 | } |
||
91 | |||
12169 | mquerol | 92 | :Opcions. |
93 | Afegir <ul><li> la paraula <span class="wims_code_words">shuffle</span> si volem que l'ordre de les propietats sigui |
||
94 | aleatori, </li><li>la paraula <span class="wims_code_words">vertical</span> |
||
95 | si voleu un arranjament vertical dels camps. |
||
11319 | bpr | 96 | </li></ul> |
23 | reyssat | 97 | \text{option=} |
98 | |||
12169 | mquerol | 99 | :Text abans de la taula. Es permeten etiquetes HTML. |
14822 | mquerol | 100 | \text{pre=Classez les animaux ci-dessous selon leurs catégories.} |
23 | reyssat | 101 | |
14822 | mquerol | 102 | :Text després de la taula. Es permeten etiquetes HTML. |
23 | reyssat | 103 | \text{post=} |
104 | |||
12169 | mquerol | 105 | :Verb i article per mostrar davant de la categoria classificada. |
23 | reyssat | 106 | \text{estun=est un} |
107 | |||
14822 | mquerol | 108 | :Com dir si un objecte no està classificat? |
109 | \text{noclass=n'appartient à aucune catégorie} |
||
23 | reyssat | 110 | |
14822 | mquerol | 111 | :%%%%%%%%%%%%%% Rien à modifier avant l'énoncé %%%%%%%%%%%%%%%% |
23 | reyssat | 112 | |
113 | \integer{pcnt=items(\prop)} |
||
4744 | bpr | 114 | \integer{prop_cnt=\prop_cnt=? \pcnt} |
115 | \integer{prop_cnt=min(\prop_cnt,\pcnt)} |
||
23 | reyssat | 116 | \integer{datacnt=rows(\data)} |
117 | \integer{max2=\max1+1} |
||
118 | \integer{tot=\tot<\pcnt?\pcnt} |
||
119 | \text{prop=\pcnt>1 and shuffle iswordof \option?shuffle(\prop)} |
||
120 | |||
121 | \text{first=} |
||
122 | \text{firsti=} |
||
123 | \text{second=} |
||
124 | \text{secondi=} |
||
4744 | bpr | 125 | \text{dist=} |
126 | \text{disti=} |
||
127 | \for{i=1 to \prop_cnt}{ |
||
23 | reyssat | 128 | \text{t=shuffle(column(1,wims(select \data where column 2 issametext \prop[\i])))} |
129 | \integer{s=min(\max1,items(\t))} |
||
130 | \text{first=wims(append item \t[1] to \first)} |
||
131 | \text{firsti=wims(append item \i to \firsti)} |
||
132 | \if{\s > 1}{ |
||
133 | \text{second=wims(append item \t[2..\s] to \second)} |
||
134 | \text{secondi=wims(append item wims(makelist \i for x=2 to \s) to \secondi)} |
||
135 | } |
||
136 | } |
||
4744 | bpr | 137 | distracteur |
138 | \if{\prop_cnt<\pcnt}{ |
||
139 | \text{t=shuffle(column(1,wims(select \data where column 2 issametext \prop[\prop_cnt+1])))} |
||
140 | \integer{s=min(\max1,items(\t))} |
||
141 | \text{dist=wims(append item \t[1] to \dist)} |
||
142 | \text{disti=wims(append item \i to \disti)} |
||
143 | } |
||
23 | reyssat | 144 | |
4744 | bpr | 145 | \if{\tot>\prop_cnt}{ |
23 | reyssat | 146 | \integer{scnt=items(\second)} |
4744 | bpr | 147 | \integer{secnt=min(\tot-\prop_cnt,\scnt)} |
148 | \integer{tot=\prop_cnt+\secnt} |
||
23 | reyssat | 149 | \text{sh2=shuffle(\scnt)} |
150 | \text{sh2=\sh2[1..\secnt]} |
||
151 | \text{second=item(\sh2,\second)} |
||
152 | \text{secondi=item(\sh2,\secondi)} |
||
153 | \text{all=\first,\second} |
||
154 | \text{alli=\firsti,\secondi} |
||
155 | }{ |
||
156 | \text{all=\first} |
||
157 | \text{alli=\firsti} |
||
158 | } |
||
5272 | bpr | 159 | \text{all=wims(nonempty items \all)} |
160 | \text{all=wims(listuniq \all)} |
||
23 | reyssat | 161 | \integer{acnt=items(\all)} |
162 | \text{sh=shuffle(\acnt)} |
||
163 | \text{all=item(\sh,\all)} |
||
164 | \text{alli=item(\sh,\alli)} |
||
4744 | bpr | 165 | \text{prop=\prop[1..\prop_cnt]} |
23 | reyssat | 166 | \text{props=wims(tolower \prop)} |
167 | \text{alls=wims(tolower \all)} |
||
168 | \text{size=\size1 x \max2} |
||
11319 | bpr | 169 | \text{sizev=\size x \max2} |
4744 | bpr | 170 | \text{rep=item(1..\prop_cnt,wims(makelist r x for x=1 to 10))} |
23 | reyssat | 171 | \steps{\rep} |
5272 | bpr | 172 | \integer{distc=\dist!= ? 1 : 0} |
173 | \conditions{wims(makelist x for x=1 to \acnt + \distc)} |
||
14822 | mquerol | 174 | :%%%%%%%%%%%%% Maintenant l'énoncé en code html. %%%%%%%%%%%%%%%%%%%% |
23 | reyssat | 175 | |
14822 | mquerol | 176 | ::La commande pour afficher le champ de réponse numéro 3 par exemple, |
23 | reyssat | 177 | c'est \embed{reply 3,\size} <p> |
14822 | mquerol | 178 | Et le nom de la propriété numéro 4, c'est \prop[4] avec la première lettre |
23 | reyssat | 179 | en majuscule, ou \props[4] tout en minuscule. |
180 | |||
7137 | bpr | 181 | \statement{<div class="instruction"> |
182 | \pre |
||
183 | </div> |
||
184 | <table class="wimsnoborder"> |
||
11319 | bpr | 185 | \if{vertical iswordof \option}{ |
186 | <tr>\for{k=1 to \prop_cnt}{<th>\prop[\k]</th>}</tr> |
||
187 | <tr>\for{k=1 to \prop_cnt}{ |
||
188 | <td style="text-align:left;vertical-align:top">\embed{reply \k, \sizev}</td>} |
||
189 | </tr> |
||
190 | }{ |
||
191 | \for{k=1 to \prop_cnt}{ |
||
192 | <tr> |
||
193 | <th>\prop[\k]</th> |
||
194 | <td style="text-align:left">\embed{reply \k, \size}</td> |
||
195 | </tr> |
||
196 | } |
||
197 | } |
||
198 | </table> |
||
199 | \post |
||
23 | reyssat | 200 | } |
201 | |||
14822 | mquerol | 202 | :%%%%%%%%%%%%% Rien à modifier ci-après. %%%%%%%%%%%%%%%%%5 |
23 | reyssat | 203 | |
7137 | bpr | 204 | \answer{\prop[1]}{\r1;\all,\dist}{type=dragfill} |
23 | reyssat | 205 | \answer{\prop[2]}{\r2}{type=dragfill} |
206 | \answer{\prop[3]}{\r3}{type=dragfill} |
||
207 | \answer{\prop[4]}{\r4}{type=dragfill} |
||
208 | \answer{\prop[5]}{\r5}{type=dragfill} |
||
209 | \answer{\prop[6]}{\r6}{type=dragfill} |
||
210 | \answer{\prop[7]}{\r7}{type=dragfill} |
||
211 | \answer{\prop[8]}{\r8}{type=dragfill} |
||
212 | \answer{\prop[9]}{\r9}{type=dragfill} |
||
213 | \answer{\prop[10]}{\r10}{type=dragfill} |
||
214 | |||
4744 | bpr | 215 | \text{totans=item(1..\prop_cnt, |
23 | reyssat | 216 | wims(items2words \r1), |
217 | wims(items2words \r2), |
||
218 | wims(items2words \r3), |
||
219 | wims(items2words \r4), |
||
220 | wims(items2words \r5), |
||
221 | wims(items2words \r6), |
||
222 | wims(items2words \r7), |
||
223 | wims(items2words \r8), |
||
224 | wims(items2words \r9), |
||
225 | wims(items2words \r10))} |
||
226 | text{totans=wims(replace internal ' to ' in \totans)} |
||
227 | \text{clean=} |
||
228 | \text{check=} |
||
4744 | bpr | 229 | \for{t=1 to \acnt}{ |
23 | reyssat | 230 | \integer{cat=0} |
4744 | bpr | 231 | \for{r=1 to \prop_cnt}{ |
23 | reyssat | 232 | \integer{cat=\all[\t] iswordof \totans[\r]?\r} |
233 | } |
||
234 | \if{\cat > 0}{ |
||
235 | \text{clean=\clean \estun \props[\cat],} |
||
236 | \text{check=\alli[\t]=\cat?\check 1,:\check 0,} |
||
237 | }{ |
||
238 | \text{clean=\clean \noclass,} |
||
239 | \text{check=\check 0,} |
||
240 | } |
||
241 | } |
||
7137 | bpr | 242 | |
5272 | bpr | 243 | \if{\dist!=}{ |
244 | \for{t=1 to 1}{ |
||
7137 | bpr | 245 | \integer{cat=0} |
246 | \for{r=1 to \prop_cnt}{ |
||
247 | \integer{cat=\dist[\t] iswordof \totans[\r]?\r} |
||
248 | } |
||
249 | \if{\cat = 0}{ |
||
5272 | bpr | 250 | \text{clean=\clean \dist[\t] \noclass,} |
251 | \text{check=\check 1,} |
||
252 | }{ |
||
7137 | bpr | 253 | \text{clean=\clean \dist[\t] \estun \props[\cat],} |
5272 | bpr | 254 | \text{check=\check 0,} |
255 | } |
||
4744 | bpr | 256 | } |
257 | } |
||
23 | reyssat | 258 | |
259 | \condition{\all[1] \clean[1]}{\check[1]=1} |
||
260 | \condition{\all[2] \clean[2]}{\check[2]=1} |
||
261 | \condition{\all[3] \clean[3]}{\check[3]=1} |
||
262 | \condition{\all[4] \clean[4]}{\check[4]=1} |
||
263 | \condition{\all[5] \clean[5]}{\check[5]=1} |
||
264 | \condition{\all[6] \clean[6]}{\check[6]=1} |
||
265 | \condition{\all[7] \clean[7]}{\check[7]=1} |
||
266 | \condition{\all[8] \clean[8]}{\check[8]=1} |
||
267 | \condition{\all[9] \clean[9]}{\check[9]=1} |
||
268 | \condition{\all[10] \clean[10]}{\check[10]=1} |
||
269 | \condition{\all[11] \clean[11]}{\check[11]=1} |
||
270 | \condition{\all[12] \clean[12]}{\check[12]=1} |
||
271 | \condition{\all[13] \clean[13]}{\check[13]=1} |
||
272 | \condition{\all[14] \clean[14]}{\check[14]=1} |
||
273 | \condition{\all[15] \clean[15]}{\check[15]=1} |
||
274 | \condition{\all[16] \clean[16]}{\check[16]=1} |
||
275 | \condition{\all[17] \clean[17]}{\check[17]=1} |
||
276 | \condition{\all[18] \clean[18]}{\check[18]=1} |
||
277 | \condition{\all[19] \clean[19]}{\check[19]=1} |
||
278 | \condition{\all[20] \clean[20]}{\check[20]=1} |