Rev 15176 | 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" |
13716 | obado | 3 | iEdit="explain" |
23 | reyssat | 4 | |
12169 | mquerol | 5 | :Seleccionar els objectes segons la seva categoria. |
23 | reyssat | 6 | |
12169 | mquerol | 7 | Es presenta una llista d'objectes i s'han de marcar aquells que tenen una propietat determinada |
17234 | bpr | 8 | segons la sol·licitud de l'exercici. <br> |
9 | Per construir un exercici amb aquest model, simplement doneu la llista d'objectes i les seves propietats. <br> |
||
15176 | lemaire | 10 | Autor del model: <a href="mailto:qualite@wimsedu.info">Gang Xiao</a> |
23 | reyssat | 11 | |
12 | :%%%%%%%%%%%%%%%%% ATTENTION %%%%%%%%%%%%%%%%%%%% |
||
13 | |||
2880 | bpr | 14 | Enlevez l'en-tête ci-dessus si vous détruisez les balises pour le modèle ! |
23 | reyssat | 15 | (Ce sont les lignes qui commencent par un ':'.) |
16 | Sinon l'exercice risque de ne pas pouvoir repasser sous Createxo. |
||
17 | |||
18 | :%%%%%%%% Paramètres d'exemples à redéfinir %%%%%%%%%%%%%%%%% |
||
19 | |||
12169 | mquerol | 20 | :\title{Seleccionar per categoria} |
5147 | bpr | 21 | :\author{XIAO, Gang} |
8002 | bpr | 22 | :\email{qualite@wimsedu.info} |
12169 | mquerol | 23 | :\credits{} |
23 | reyssat | 24 | |
12169 | mquerol | 25 | :Nombre d'objectes a marcar per exercici. Fins a 100. |
26 | Heu de tenir definits suficients objectes a les dades principals. |
||
23 | reyssat | 27 | \integer{tot=12} |
28 | |||
12169 | mquerol | 29 | :El nombre mínim de bons objectes a marcar. Almenys 1. |
23 | reyssat | 30 | \integer{mingood=1} |
31 | |||
12169 | mquerol | 32 | :El nombre mínim d'objectes incorrectes que no s'han de marcar. Almenys 1. |
23 | reyssat | 33 | \integer{minbad=4} |
34 | |||
12169 | mquerol | 35 | :Llista de propietats. La propietat que es marcarà es tria a l'atzar. |
23 | reyssat | 36 | \text{prop=française,italienne,allemande} |
37 | |||
12169 | mquerol | 38 | :Dades principals. |
39 | Escriviu (un per línia) els objectes a classificar, després la seva categoria, separats per una coma. <p> |
||
40 | L'objecte pot ser una paraula, una frase (sense comes). És millor definir abundants dades per a cada propietat. |
||
23 | reyssat | 41 | \matrix{data= |
42 | Fabien Barthez,francaise |
||
43 | Grégory Coupet,francaise |
||
44 | Eric Abidal,francaise |
||
45 | William Gallas,francaise |
||
46 | Willy Sagnol,francaise |
||
47 | Lilian Thuram,francaise |
||
48 | Pascal Chimbonda,francaise |
||
49 | Mickaël Silvestre,francaise |
||
50 | Claude Makélélé,francaise |
||
51 | Patrick Vieira,francaise |
||
52 | Florent Malouda,francaise |
||
53 | Zinedine Zidane,francaise |
||
54 | Sylvain Wiltord,francaise |
||
55 | Franck Ribéry,francaise |
||
56 | Vikash Dhorasoo,francaise |
||
57 | Sidney Govou,francaise |
||
58 | Thierry Henry,francaise |
||
59 | David Trézéguet,francaise |
||
60 | Louis Saha,francaise |
||
61 | |||
62 | Gianluigi Buffon,italienne |
||
63 | Morgan De Sanctis,italienne |
||
64 | Angelo Peruzzi,italienne |
||
65 | Christian Abbiati,italienne |
||
66 | Marco Amelia,italienne |
||
67 | Flavio Roma,italienne |
||
68 | Gianluca Zambrotta,italienne |
||
69 | Alessandro Nesta,italienne |
||
70 | Fabio Cannavaro,italienne |
||
71 | Fabio Grosso,italienne |
||
72 | Cristian Zaccardo,italienne |
||
73 | Marco Materazzi,italienne |
||
74 | Andrea Barzagli,italienne |
||
75 | Massimo Oddo,italienne |
||
76 | Mauro Camoranesi,italienne |
||
77 | Andrea Pirlo,italienne |
||
78 | Gennaro Gattuso,italienne |
||
79 | Francesco Totti,italienne |
||
80 | Daniele de Rossi,italienne |
||
81 | Aimo Diana,italienne |
||
82 | Simone Barone,italienne |
||
83 | Manuele Blasi,italienne |
||
84 | Simone Perrotta,italienne |
||
85 | Alberto Gilardino,italienne |
||
86 | Luca Toni,italienne |
||
87 | Alessandro Del Piero,italienne |
||
88 | Vicenzo Iaquinta,italienne |
||
89 | Christian Vieri,italienne |
||
90 | Antonio Cassano,italienne |
||
91 | Cristiano Lucarelli,italienne |
||
92 | Filippo Inzaghi,italienne |
||
93 | |||
94 | Jens Lehmann,allemande |
||
95 | Oliver Kahn,allemande |
||
96 | Timo Hildebrand,allemande |
||
97 | Philipp Lahm,allemande |
||
98 | Arne Friedrich,allemande |
||
99 | Robert Huth,allemande |
||
100 | Jens Nowotny,allemande |
||
101 | Per Mertesacker,allemande |
||
102 | Christoph Metzelder,allemande |
||
103 | Marcell Jansen,allemande |
||
104 | Bernd Schneider,allemande |
||
105 | Sebastian Kehl,allemande |
||
106 | Torsten Frings,allemande |
||
107 | Michael Ballack,allemande |
||
108 | Tim Borowski,allemande |
||
109 | Bastian Schweinsteiger,allemande |
||
110 | David Odonkor,allemande |
||
111 | Thomas Hitzlsperger,allemande |
||
112 | Miroslav Klose,allemande |
||
113 | Lukas Podolski,allemande |
||
114 | Gerald Asamoah,allemande |
||
115 | Mike Hanke,allemande |
||
116 | Oliver Neuville,allemande |
||
117 | } |
||
118 | |||
12169 | mquerol | 119 | :Opcions. |
14906 | bpr | 120 | Afegiu la paraula <span class="tt wims_code_words">split</span> a la definició si voleu donar una nota |
121 | parcial per a respostes parcialment correctes. |
||
23 | reyssat | 122 | \text{option=split} |
123 | |||
12169 | mquerol | 124 | :Opcions de presentació. |
125 | Afegiu aquí la paraula "liste" si voleu mostrar els objectes com una llista. |
||
2917 | obado | 126 | \text{presentation=} |
127 | |||
12169 | mquerol | 128 | :S'accepta text aleatori posat entre claus |
129 | $embraced_randitem |
||
15176 | lemaire | 130 | \text{accolade=item(1,1. sí, |
131 | 2. no)} |
||
2917 | obado | 132 | |
23 | reyssat | 133 | :%%%%%%%%%%%%%% Rien à modifier avant l'énoncé %%%%%%%%%%%%%%%% |
134 | |||
135 | \text{prop=randitem(\prop)} |
||
136 | |||
137 | \text{data=wims(nonempty rows \data)} |
||
138 | \text{good=wims(select \data where column 2 issametext \prop)} |
||
139 | \text{bad=wims(select \data where column 2 notsametext \prop)} |
||
140 | \text{good=shuffle(wims(nonempty item \good[;1]))} |
||
141 | \text{bad=shuffle(wims(nonempty item \bad[;1]))} |
||
142 | \integer{goodcnt=items(\good)} |
||
143 | \integer{badcnt=items(\bad)} |
||
144 | \integer{tot=min(\tot,\goodcnt+\badcnt)} |
||
145 | \integer{mingood=min(\mingood,\tot-1)} |
||
146 | \integer{minbad=min(\minbad,\tot-\mingood-1)} |
||
147 | \integer{pickgood=randint(min(\mingood,\goodcnt)..min(\tot-\minbad,\goodcnt))} |
||
148 | \integer{pickbad=min(\tot-\pickgood,\badcnt)} |
||
149 | \integer{tot=\pickgood+\pickbad} |
||
150 | \text{ind=wims(makelist 1 for x=1 to \pickgood),wims(makelist 0 for x=1 to \pickbad)} |
||
151 | \text{all=item(1..\pickgood,\good),item(1..\pickbad,\bad)} |
||
152 | \text{list=wims(values x for x=1 to \tot)} |
||
153 | \text{sh=shuffle(\list)} |
||
154 | \text{all=item(\sh,\all)} |
||
155 | \text{ind=item(\sh,\ind)} |
||
156 | \text{tomark=positionof(1,\ind)} |
||
15176 | lemaire | 157 | \integer{nbtomark=items(\tomark)} |
23 | reyssat | 158 | |
2917 | obado | 159 | :%% Choix de la presentation : sous forme lineaire par defaut, ou sous forme de liste à puces. |
160 | \if{liste iswordof \presentation} |
||
161 | { |
||
14906 | bpr | 162 | \text{pre=<ul>} |
163 | \text{separatorL=<li>} |
||
164 | \text{separatorR=</li>} |
||
165 | \text{post=</ul>} |
||
166 | }{ |
||
15119 | bpr | 167 | \text{pre=<div>} |
14906 | bpr | 168 | \text{separatorL=<span>} |
169 | \text{separatorR=</span>} |
||
15119 | bpr | 170 | \text{post=</div>} |
2917 | obado | 171 | } |
172 | |||
23 | reyssat | 173 | :%%%%%%%%%%%%% Maintenant l'énoncé en code html. %%%%%%%%%%%%%%%%%%%% |
174 | |||
12169 | mquerol | 175 | :El text per explicar què fer. |
176 | Per evocar la propietat demanada, escriviu <span class="tt">\prop</span>. |
||
23 | reyssat | 177 | $embraced_randitem |
178 | \text{explain= |
||
12169 | mquerol | 179 | Parmi les joueurs ci-dessous qui ont participé à la coupe du monde de football 2006, sélectionner ceux qui sont dans l'équipe \prop. |
23 | reyssat | 180 | } |
181 | |||
182 | :%% Calculs à ne pas modifier |
||
12169 | mquerol | 183 | \text{accolade=wims(word 1 of \accolade)} |
23 | reyssat | 184 | |
15176 | lemaire | 185 | \text{explain=\accolade=1. ?wims(embraced randitem \explain)} |
186 | :%% Pour la version latex de l'énonce |
||
187 | \if{liste iswordof \presentation}{ |
||
188 | \text{latextext=\begin{checkbox}} |
||
189 | \for{ll=1 to \tot}{ |
||
190 | \text{latextext=\latextext |
||
191 | \item \all[\ll] } |
||
192 | } |
||
193 | \text{latextext=\latextext \end{checkbox}} |
||
194 | }{ |
||
195 | \text{latextext=\begin{quote}} |
||
196 | \for{ll=1 to \tot-1}{ |
||
197 | \text{latextext=\latextext \all[\ll], } |
||
198 | } |
||
199 | \text{latextext=\latextext \all[\tot]. |
||
200 | \end{quote} } |
||
201 | } |
||
202 | \if{liste iswordof \presentation}{ |
||
203 | \text{latexans=\begin{itemize}} |
||
204 | \for{kls=1 to \nbtomark}{ |
||
205 | \text{latexans=\latexans |
||
206 | \item \all[\tomark[\kls]] } |
||
207 | } |
||
208 | \text{latexans=\latexans |
||
209 | \end{itemize}} |
||
210 | }{ |
||
211 | \text{latexans=\begin{quote}} |
||
212 | \for{lls=1 to \nbtomark-1}{ |
||
213 | \text{latexans=\latexans \all[\tomark[\lls]], } |
||
214 | } |
||
215 | \text{latexans=\latexans \all[\tomark[\lls]]. |
||
216 | \end{quote} } |
||
217 | } |
||
12169 | mquerol | 218 | |
23 | reyssat | 219 | ::On n'a pas besoin de modifier l'énoncé directement en général. |
220 | |||
2917 | obado | 221 | \statement{ |
14906 | bpr | 222 | <p>\explain</p> |
223 | \pre |
||
15176 | lemaire | 224 | \for{k=1 to \tot-1}{\separatorL \embed{r1,\k}, \separatorR } |
14906 | bpr | 225 | \separatorL \embed{r1,\tot}.\separatorR |
226 | \post |
||
23 | reyssat | 227 | } |
228 | |||
229 | :%%%%%%%%%%%%% Rien à modifier ci-après. %%%%%%%%%%%%%%%%%5 |
||
230 | |||
231 | \answer{Le marquage}{\tomark;\all}{type=mark}{option=\option} |
||
232 | |||
15176 | lemaire | 233 | \latex{ |
234 | \begin{statement} |
||
235 | \explain |
||
236 | \latextext |
||
237 | \end{statement} |
||
238 | \begin{answer}\ |
||
239 | \latexans |
||
240 | \end{answer} |
||
241 | } |