Subversion Repositories wimsdev

Rev

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

Rev Author Line No. Line
11375 bpr 1
type=select
23 reyssat 2
textarea="data explain"
13715 obado 3
iEdit="explain"
23 reyssat 4
 
4131 bpr 5
:Select items according to their properties (click).
23 reyssat 6
 
8002 bpr 7
The exercise presents a list of items to be classified according to a criterion. Click on the
4131 bpr 8
items to select those that belong to the same group.
23 reyssat 9
<p>
4131 bpr 10
To make an exercise with this model, type the list of
11
items and their properties.
13477 obado 12
</p><p>
4131 bpr 13
With a slight modification, a variant of this model can accept images as items.
13477 obado 14
</p><p class="wims_credits">
15176 lemaire 15
Author of the model: <a href="mailto:qualite@wimsedu.info">Gang Xiao</a>
13477 obado 16
</p>
23 reyssat 17
:%%%%%%%%%%%%%%%%%      ATTENTION      %%%%%%%%%%%%%%%%%%%%
18
 
4131 bpr 19
Remove the above header if you destroy the model tags i.e. the lines starting
20
with a ':'. Otherwise the exercise might not be recognised by Createxo.
23 reyssat 21
 
22
:%%%%%%%% Example parameters to be redefined %%%%%%%%%%%%%%%%%
23
 
4131 bpr 24
:\title{Classification (click)}
5147 bpr 25
:\author{XIAO, Gang}
8002 bpr 26
:\email{qualite@wimsedu.info}
5724 bpr 27
:\credits{}
23 reyssat 28
 
4131 bpr 29
:Number of items to classify per exercise: up to 100.
30
Make sure you include  enough items in the main data for the exercise to be worthwile!
23 reyssat 31
\integer{tot=12}
32
 
4131 bpr 33
:The minimum number of items to be selected: at least 1.
23 reyssat 34
\integer{mingood=1}
35
 
4131 bpr 36
:The minimum number of items that should NOT be selected: at least 1.
23 reyssat 37
\integer{minbad=4}
38
 
4131 bpr 39
:List of properties. The properties to select will be randomly drawn from the list provided.
23 reyssat 40
\text{prop=French,Italian,German}
41
 
42
:Main data.
4131 bpr 43
Define one item per line, first the name of the item, then the property,
23 reyssat 44
separated by a comma. <p>
4131 bpr 45
It is best to provide lot of data for each category. <p>
8002 bpr 46
Be careful to use exactly the same spelling and case when you type
4135 bpr 47
the properties (e.g. <b>French</b> and <b>french</b> will count as two categories)! Otherwise the exercise may not work .
23 reyssat 48
\matrix{data=
49
Fabien Barthez,French
50
Grégory Coupet,French
51
Eric Abidal,French
52
William Gallas,French
53
Willy Sagnol,French
54
Lilian Thuram,French
55
Pascal Chimbonda,French
56
Mickaël Silvestre,French
57
Claude Makélélé,French
58
Patrick Vieira,French
59
Florent Malouda,French
60
Zinedine Zidane,French
61
Sylvain Wiltord,French
62
Franck Ribéry,French
63
Vikash Dhorasoo,French
64
Sidney Govou,French
65
Thierry Henry,French
66
David Trézéguet,French
67
Louis Saha,French
68
 
69
Gianluigi Buffon,Italian
70
Morgan De Sanctis,Italian
71
Angelo Peruzzi,Italian
72
Christian Abbiati,Italian
73
Marco Amelia,Italian
74
Flavio Roma,Italian
75
Gianluca Zambrotta,Italian
76
Alessandro Nesta,Italian
77
Fabio Cannavaro,Italian
78
Fabio Grosso,Italian
79
Cristian Zaccardo,Italian
80
Marco Materazzi,Italian
81
Andrea Barzagli,Italian
82
Massimo Oddo,Italian
83
Mauro Camoranesi,Italian
84
Andrea Pirlo,Italian
85
Gennaro Gattuso,Italian
86
Francesco Totti,Italian
87
Daniele de Rossi,Italian
88
Aimo Diana,Italian
89
Simone Barone,Italian
90
Manuele Blasi,Italian
91
Simone Perrotta,Italian
92
Alberto Gilardino,Italian
93
Luca Toni,Italian
94
Alessandro Del Piero,Italian
95
Vicenzo Iaquinta,Italian
96
Christian Vieri,Italian
97
Antonio Cassano,Italian
98
Cristiano Lucarelli,Italian
99
Filippo Inzaghi,Italian
100
 
101
Jens Lehmann,German
102
Oliver Kahn,German
103
Timo Hildebrand,German
104
Philipp Lahm,German
105
Arne Friedrich,German
106
Robert Huth,German
107
Jens Nowotny,German
108
Per Mertesacker,German
109
Christoph Metzelder,German
110
Marcell Jansen,German
111
Bernd Schneider,German
112
Sebastian Kehl,German
113
Torsten Frings,German
114
Michael Ballack,German
115
Tim Borowski,German
116
Bastian Schweinsteiger,German
117
David Odonkor,German
118
Thomas Hitzlsperger,German
119
Miroslav Klose,German
120
Lukas Podolski,German
121
Gerald Asamoah,German
122
Mike Hanke,German
123
Oliver Neuville,German
124
}
125
 
4131 bpr 126
:Optional words.
11544 obado 127
Add the word "split" if you allow a partial score for a partially correct answer.
23 reyssat 128
\text{option=split}
129
 
8512 bpr 130
:Options de présentation.
11544 obado 131
Add the word "list" to display objects as a bulleted list (instead of linear)
8512 bpr 132
\text{presentation=}
133
 
11544 obado 134
:Embraced random items
8512 bpr 135
$embraced_randitem
15176 lemaire 136
\text{accolade=item(1,1. yes,
137
2. no)}
8512 bpr 138
 
139
 
23 reyssat 140
:%%%%%%%%%%%%%% Nothing to modify before the statement %%%%%%%%%%%%%%%%
141
 
142
\text{prop=randitem(\prop)}
143
 
144
\text{data=wims(nonempty rows \data)}
145
\text{good=wims(select \data where column 2 issametext \prop)}
146
\text{bad=wims(select \data where column 2 notsametext \prop)}
147
\text{good=shuffle(wims(nonempty item \good[;1]))}
148
\text{bad=shuffle(wims(nonempty item \bad[;1]))}
149
\integer{goodcnt=items(\good)}
150
\integer{badcnt=items(\bad)}
151
\integer{tot=min(\tot,\goodcnt+\badcnt)}
152
\integer{mingood=min(\mingood,\tot-1)}
153
\integer{minbad=min(\minbad,\tot-\mingood-1)}
154
\integer{pickgood=randint(min(\mingood,\goodcnt)..min(\tot-\minbad,\goodcnt))}
155
\integer{pickbad=min(\tot-\pickgood,\badcnt)}
156
\integer{tot=\pickgood+\pickbad}
157
\text{ind=wims(makelist 1 for x=1 to \pickgood),wims(makelist 0 for x=1 to \pickbad)}
158
\text{all=item(1..\pickgood,\good),item(1..\pickbad,\bad)}
159
\text{list=wims(values x for x=1 to \tot)}
160
\text{sh=shuffle(\list)}
161
\text{all=item(\sh,\all)}
162
\text{ind=item(\sh,\ind)}
163
\text{tomark=positionof(1,\ind)}
15176 lemaire 164
\integer{nbtomark=items(\tomark)}
23 reyssat 165
 
11544 obado 166
:%% Display type : linear (default), ou as a bulleted list.
167
\if{list iswordof \presentation}
8512 bpr 168
{
15176 lemaire 169
  \text{pre=<ul>}
170
  \text{separatorL=<li>}
171
  \text{separatorR=</li>}
172
  \text{post=</ul>}
173
}{
174
  \text{pre=<div>}
175
  \text{separatorL=<span>}
176
  \text{separatorR=</span>}
177
  \text{post=</div>}
8512 bpr 178
}
179
 
23 reyssat 180
:%%%%%%%%%%%%% Now the statement in html. %%%%%%%%%%%%%%%%%%%%
181
 
182
:Text to explain what should be done.
5907 bpr 183
Write <span class="tt">\prop</span> for the randomly drawn property.
23 reyssat 184
$embraced_randitem
185
\text{explain=
4131 bpr 186
Among the players here below, who have participated to the World Football Cup 2006,
187
please select those in the \prop team.
23 reyssat 188
}
189
 
190
:%% Computations; do not modify
8512 bpr 191
\text{accolade=wims(word 1 of \accolade)}
23 reyssat 192
 
15176 lemaire 193
\text{explain=\accolade=1. ?wims(embraced randitem \explain)}
194
:%% Pour la version latex de l'énonce
195
\if{liste iswordof \presentation}{
196
  \text{latextext=\begin{checkbox}}
197
  \for{ll=1 to \tot}{
198
    \text{latextext=\latextext
199
    \item \all[\ll] }
200
  }
201
  \text{latextext=\latextext \end{checkbox}}
202
}{
203
  \text{latextext=\begin{quote}}
204
  \for{ll=1 to \tot-1}{
205
    \text{latextext=\latextext \all[\ll], }
206
  }
207
  \text{latextext=\latextext \all[\tot].
208
        \end{quote} }
209
}
210
\if{liste iswordof \presentation}{
211
  \text{latexans=\begin{itemize}}
212
  \for{kls=1 to \nbtomark}{
213
    \text{latexans=\latexans
214
    \item \all[\tomark[\kls]] }
215
  }
216
  \text{latexans=\latexans
217
        \end{itemize}}
218
}{
219
  \text{latexans=\begin{quote}}
220
  \for{lls=1 to \nbtomark-1}{
221
    \text{latexans=\latexans \all[\tomark[\lls]], }
222
  }
223
  \text{latexans=\latexans \all[\tomark[\lls]].
224
        \end{quote} }
225
}
8512 bpr 226
 
23 reyssat 227
::You don't need to modify this in general.
228
 
8512 bpr 229
\statement{
15176 lemaire 230
  <p>\explain</p>
231
  \pre
232
  \for{k=1 to \tot-1}{\separatorL \embed{r1,\k}, \separatorR }
233
  \separatorL \embed{r1,\tot}.\separatorR
234
  \post
23 reyssat 235
}
236
 
15176 lemaire 237
:%%%%%%%%%%%%% Nothing to modify after. %%%%%%%%%%%%%%%%%
23 reyssat 238
 
239
\answer{The marking}{\tomark;\all}{type=mark}{option=\option}
15176 lemaire 240
\latex{
241
\begin{statement}
242
\explain
243
\latextext
244
\end{statement}
245
\begin{answer}\
246
\latexans
247
\end{answer}
248
}
23 reyssat 249