Subversion Repositories wimsdev

Rev

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