Subversion Repositories wimsdev

Rev

Rev 13715 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
11375 bpr 1
type=classify
13715 obado 2
textarea="data pre post"
3
iEdit="pre post"
23 reyssat 4
 
5
:Classificare oggetti in base alle loro proprietà, seleziona&trascina.
6
 
7
L'esercizio presenta una lista di oggetti i cui è necessario selezionare
8
quelli che hanno una certa proprietà e trascinarli con il mouse nella
9
casella corrispondente.
10
<p>
11
Per costruire un esercizio utilizzando questo modello è sufficiente
12
inserire la lista di oggetti e le loro proprietà.
13479 obado 13
</p><p>
23 reyssat 14
Con una piccola modifica, questo modello può essere adattato per accettare
15
oggetti costituiti da immagini.
13479 obado 16
</p>
15179 lemaire 17
<p class="wims_credits">Autore del modello: <a href="mailto:qualite@wimsedu.info">Gang Xiao</a></p>
23 reyssat 18
 
19
:%%%%%%%%%%%%%%%%%      ATTENZIONE      %%%%%%%%%%%%%%%%%%%%
20
 
21
Se si rimuovono le indicazioni del modulo modelli (le righe che
22
cominciano con ':') è necessario rimuovere tutta questa parte
23
introduttiva del file. Altrimenti Createxo potrebbe non accettare il
24
codice dell'esercizio.
25
 
26
:%%%%%%%% Parametri che possono essere ridefiniti %%%%%%%%%%%%%%%%%
27
 
28
:\title{Classifica in base a una proprietà}
5147 bpr 29
:\author{XIAO, Gang}
8002 bpr 30
:\email{qualite@wimsedu.info}
5724 bpr 31
:\credits{}
23 reyssat 32
 
33
:Numero di oggetti da classificare. Massimo 20.
34
\integer{tot=8}
35
 
36
: Massimo numero di oggetti presentati con la stessa proprietà.
37
Questo numero deve essere maggiore di 1.
38
\integer{max1=4}
39
 
4817 czzmrn 40
:Il numero di proprietà da presentare (di default il numero di proprietà definite)
8002 bpr 41
Se il numero di proprietà definite è strettamente inferiore a questo parametro,
42
distrattori saranno scelti tra le proprietà non utilizzate.
4817 czzmrn 43
\text{prop_cnt=}
44
 
23 reyssat 45
:Dimensioni dei riquadri da trascinare con il mouse, in pixel, x per y.
46
Occorre tener presente che gli utenti possono cambiare le dimensioni delle
47
fonti nel browser e quindi bisogna evitare di disegnare riquadri troppo
48
piccoli.
49
\text{size1=100x40}
50
 
51
:Elenco delle categorie. Fino a 10, separate da virgole.
52
\text{prop=insetti,uccelli,mammiferi}
53
 
54
:Contenuto effettivo dell'esercizio.
13479 obado 55
<p>Inserire un oggeto per riga, indicando prima il nome e quindi la categoria,
56
  separati da una virgola.</p>
13501 czzmrn 57
<p>È utile inserire dati in abbondanza per ogni categoria.</p>
8002 bpr 58
Attenzione a non commettere errori nello scrivere le proprietà! Questo
23 reyssat 59
potrebbe impedire completamente il funzionamento dell'esercizio.
60
\matrix{data=
61
aquila,uccelli
62
albatross,uccelli
63
ragno,insetti
7137 bpr 64
anitra,uccelli
65
gatto,mammiferi
23 reyssat 66
cavallo,mammiferi
67
cane,mammiferi
68
maiale,mammiferi
69
corbel,uccelli
70
locusta,insetti
71
elefante,mammiferi
72
falco,uccelli
73
gabbiano,uccelli
74
ape,insetti
75
leone,mammiferi
76
sparrow,uccelli
77
mosca,insetti
78
zanzara,insetti
79
pecora,mammiferi
80
oca,uccelli
81
farfalla,insetti
82
piccione,uccelli
83
volpe,mammiferi
84
nightingale,uccelli
85
scorpione,insetti
86
scimmia,mammiferi
87
tigre,mammiferi
88
mucca,mammiferi
89
}
90
 
91
:Opzioni dell'esercizio.
13501 czzmrn 92
Utilizzare
93
<ul><li>l'opzione <span class="wims_code_words">shuffle</span> se si vuole che l'ordine delle categorie elencate sia casuale,
11169 bpr 94
</li><li>
13501 czzmrn 95
 l'opzione <span class="wims_code_words">vertical</span> se si vuole una disposizione verticale degli elementi.
96
</li></ul>
97
\text{option=}
23 reyssat 98
 
99
:Testo che precede la tabella. Sono permessi comandi html.
7169 bpr 100
\text{pre=Ordina i seguenti animali a seconda del loro genere.}
23 reyssat 101
 
102
:Testo che segue la tabella. Sono permessi comandi html.
103
\text{post=}
104
 
105
:Verbo e articolo che nelle risposte appaiono prima della categoria.
106
\text{estun=appartiene ai/agli}
107
 
108
:Il testo che dice che un oggetto non appartiene a nessuna categoria.
109
\text{noclass=non è in nessuno dei generi elencati}
110
 
111
:%%%%%%%%%%% Parte che precede l'enunciato: da non modificare %%%%%%%%%%%%%
112
 
113
\integer{pcnt=items(\prop)}
4817 czzmrn 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=}
4817 czzmrn 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
}
4817 czzmrn 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
 
4817 czzmrn 145
\if{\tot>\prop_cnt}{
23 reyssat 146
 \integer{scnt=items(\second)}
4817 czzmrn 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)}
4817 czzmrn 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}
11169 bpr 169
\text{sizev=\size x \max2}
4817 czzmrn 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)}
23 reyssat 174
 
175
:%%%%%%%%%%%%% Enunciato (in html). %%%%%%%%%%%%%%%%%%%%
176
 
13556 czzmrn 177
::Il comando per mostrare il campo della risposta 3, per esempio, è 
23 reyssat 178
\embed{reply 3,\size} <p>
13556 czzmrn 179
E il nomer della proprietà numero 4 è \prop[4] se si vuole la prima lettera
180
maiuscola oppure \props[4] se si vuole tutto miniscolo.
23 reyssat 181
 
7137 bpr 182
\statement{<div class="instruction">
183
\pre
184
</div>
5779 czzmrn 185
<table class="wimsnoborder">
11169 bpr 186
\if{vertical iswordof \option}{
187
  <tr>\for{k=1 to \prop_cnt}{<th>\prop[\k]</th>}</tr>
188
  <tr>\for{k=1 to \prop_cnt}{
13501 czzmrn 189
    <td style="text-align:left;vertical-align:top">\embed{reply \k, \sizev}</td>}
11169 bpr 190
  </tr>
191
}{
192
  \for{k=1 to \prop_cnt}{
193
   <tr>
194
     <th>\prop[\k]</th>
195
     <td style="text-align:left">\embed{reply \k, \size}</td>
196
   </tr>
197
  }
198
 }
199
</table>
200
\post
23 reyssat 201
}
202
 
203
:%%%%%%%%%%%%% Non modificare nulla da qui in poi. %%%%%%%%%%%%%%%%%
204
 
7137 bpr 205
\answer{\prop[1]}{\r1;\all,\dist}{type=dragfill}
23 reyssat 206
\answer{\prop[2]}{\r2}{type=dragfill}
207
\answer{\prop[3]}{\r3}{type=dragfill}
208
\answer{\prop[4]}{\r4}{type=dragfill}
209
\answer{\prop[5]}{\r5}{type=dragfill}
210
\answer{\prop[6]}{\r6}{type=dragfill}
211
\answer{\prop[7]}{\r7}{type=dragfill}
212
\answer{\prop[8]}{\r8}{type=dragfill}
213
\answer{\prop[9]}{\r9}{type=dragfill}
214
\answer{\prop[10]}{\r10}{type=dragfill}
215
 
4817 czzmrn 216
\text{totans=item(1..\prop_cnt,
23 reyssat 217
	wims(items2words \r1),
218
	wims(items2words \r2),
219
	wims(items2words \r3),
220
	wims(items2words \r4),
221
	wims(items2words \r5),
222
	wims(items2words \r6),
223
	wims(items2words \r7),
224
	wims(items2words \r8),
225
	wims(items2words \r9),
226
	wims(items2words \r10))}
227
text{totans=wims(replace internal &#39; to ' in \totans)}
228
\text{clean=}
229
\text{check=}
4817 czzmrn 230
\for{t=1 to \acnt}{
23 reyssat 231
 \integer{cat=0}
4817 czzmrn 232
 \for{r=1 to \prop_cnt}{
23 reyssat 233
  \integer{cat=\all[\t] iswordof \totans[\r]?\r}
234
 }
235
 \if{\cat > 0}{
236
  \text{clean=\clean \estun \props[\cat],}
237
  \text{check=\alli[\t]=\cat?\check 1,:\check 0,}
238
 }{
239
  \text{clean=\clean \noclass,}
240
  \text{check=\check 0,}
241
 }
242
}
7137 bpr 243
 
5272 bpr 244
\if{\dist!=}{
245
 \for{t=1 to 1}{
7137 bpr 246
   \integer{cat=0}
247
   \for{r=1 to \prop_cnt}{
248
    \integer{cat=\dist[\t] iswordof \totans[\r]?\r}
249
   }
250
 \if{\cat = 0}{
5272 bpr 251
   \text{clean=\clean \dist[\t] \noclass,}
252
   \text{check=\check 1,}
253
  }{
7137 bpr 254
   \text{clean=\clean \dist[\t] \estun \props[\cat],}
5272 bpr 255
   \text{check=\check 0,}
256
  }
4817 czzmrn 257
 }
258
}
23 reyssat 259
 
260
\condition{\all[1] \clean[1]}{\check[1]=1}
261
\condition{\all[2] \clean[2]}{\check[2]=1}
262
\condition{\all[3] \clean[3]}{\check[3]=1}
263
\condition{\all[4] \clean[4]}{\check[4]=1}
264
\condition{\all[5] \clean[5]}{\check[5]=1}
265
\condition{\all[6] \clean[6]}{\check[6]=1}
266
\condition{\all[7] \clean[7]}{\check[7]=1}
267
\condition{\all[8] \clean[8]}{\check[8]=1}
268
\condition{\all[9] \clean[9]}{\check[9]=1}
269
\condition{\all[10] \clean[10]}{\check[10]=1}
270
\condition{\all[11] \clean[11]}{\check[11]=1}
271
\condition{\all[12] \clean[12]}{\check[12]=1}
272
\condition{\all[13] \clean[13]}{\check[13]=1}
273
\condition{\all[14] \clean[14]}{\check[14]=1}
274
\condition{\all[15] \clean[15]}{\check[15]=1}
275
\condition{\all[16] \clean[16]}{\check[16]=1}
276
\condition{\all[17] \clean[17]}{\check[17]=1}
277
\condition{\all[18] \clean[18]}{\check[18]=1}
278
\condition{\all[19] \clean[19]}{\check[19]=1}
279
\condition{\all[20] \clean[20]}{\check[20]=1}