Rev 18061 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
3392 | bpr | 1 | type=game |
13716 | obado | 2 | textarea="data instruction" |
3 | iEdit="instruction" |
||
3392 | bpr | 4 | |
12172 | mquerol | 5 | :Joc del penjat |
6 | Es tracta d'endevinar una paraula proposant lletres d'acord amb el principi del joc de l'home penjat. |
||
13476 | obado | 7 | <p class="wims_credits"> |
15179 | lemaire | 8 | Autor del model: <a href="mailto:bernadette.m.riou@orange.fr">Bernadette Perrin-Riou</a> |
3392 | bpr | 9 | </p> |
10 | :%%%%%%%%%%%%%%%%% ATTENTION %%%%%%%%%%%%%%%%%%%% |
||
11 | |||
12 | Enlevez l'en-tête ci-dessus si vous détruisez les balises pour le modèle ! |
||
13 | (Ce sont les lignes qui commencent par un ':'.) |
||
14 | Sinon l'exercice risque de ne pas pouvoir repasser sous Createxo. |
||
15 | |||
16 | :%%%%%%%% Paramètres d'exemples à redéfinir %%%%%%%%%%%%%%%%% |
||
12172 | mquerol | 17 | :\title{Joc del penjat} |
5354 | obado | 18 | :\author{Bernadette Perrin-Riou} |
12172 | mquerol | 19 | :\email{bpr@math.u-psud.fr} |
20 | :\credits{} |
||
13476 | obado | 21 | |
12172 | mquerol | 22 | :Enunciat |
23 | Enunciat de l'exercici |
||
24 | \text{instruction=Trobar la paraula oferint lletres una per una.} |
||
5354 | obado | 25 | |
12172 | mquerol | 26 | :Feedback general |
27 | Text que es mostra al final de l'exercici, independentment del resultat. |
||
28 | \text{feedback=Heu trobat la paraula} |
||
3392 | bpr | 29 | |
12172 | mquerol | 30 | :Feedback de fracàs |
31 | Text que es mostra al final de l'exercici, quan no s'ha trobat la paraula. |
||
32 | \text{echec=Has perdut!} |
||
5354 | obado | 33 | |
12172 | mquerol | 34 | :Missatge sobre el nombre d'intents restants |
5722 | bpr | 35 | |
12172 | mquerol | 36 | \text{message0=Teniu dret a XXXX errors} |
5354 | obado | 37 | |
12172 | mquerol | 38 | :Tipus de disseny |
39 | Elecció del disseny: "Penjat", "Targes vermelles" o "Cranis" |
||
40 | \text{type=item(2,3 (Cranis), |
||
41 | 2 (Tarja_vermella, Tarja_verda), |
||
42 | 1 (Penjat))} |
||
15691 | bpr | 43 | :Options |
44 | Les options peuvent être: <span class="tt">noaccent</span> (ne tient pas compte des accents), <span class="tt">hint</span> (les première et dernière lettres sont affichées). |
||
45 | \text{option=} |
||
12172 | mquerol | 46 | :Dades principals. |
47 | Introduïu a la primera columna les paraules en minúscules i en la segona una possible indicació. |
||
48 | En el cas dels grups de paraules, reemplaça el blanc amb un <span class="tt">_</span>. |
||
3392 | bpr | 49 | \text{data=éléphant,un animal |
4122 | bpr | 50 | chandelier, la première lettre est c |
18074 | bpr | 51 | mouette_rieuse, {sur la mer,sur la plage} |
52 | vague, {sur la mer,sur la plage} |
||
3392 | bpr | 53 | } |
54 | |||
55 | :%%%%%%%%%%%%%% Rien à modifier avant l'énoncé %%%%%%%%%%%%%%%% |
||
12172 | mquerol | 56 | \text{Indication=Indicació} |
57 | \text{motatrouver=Paraula a trobar} |
||
58 | \text{proposer=Proposa una lletra en minúscula} |
||
5722 | bpr | 59 | \text{typename=wims(declosing wims(word 2 to -1 of \type))} |
5354 | obado | 60 | \text{type=wims(word 1 of \type)} |
5722 | bpr | 61 | \text{typename=wims(words2items wims(nospace \typename))} |
11557 | bpr | 62 | \text{typename=slib(oef/blank _,,\typename)} |
3392 | bpr | 63 | \text{mot=randrow(\data)} |
18074 | bpr | 64 | \text{mot=wims(embraced randitem \mot)} |
3392 | bpr | 65 | \text{indication=\mot[2..-1]} |
66 | \text{mot=\mot[1]} |
||
5354 | obado | 67 | \text{jok=—} |
13716 | obado | 68 | \css{<style> |
5354 | obado | 69 | .centrer{text-align:center;} |
15691 | bpr | 70 | .seen {opacity:.5;font-weight: bold;} |
71 | .lettres{display: flex; |
||
72 | flex-wrap: wrap; |
||
73 | justify-content: center;} |
||
74 | .lettres span{background-color:orange;font-size:20px;font-family:monospace;padding:0 .5em;} |
||
5354 | obado | 75 | .w {padding : 0 2px;} |
76 | .word {background-color:orange;font-size:20px;white-space: nowrap;} |
||
77 | .forget {background-color:red;color:white;font-size:20px;} |
||
78 | .good {color:green;} |
||
79 | .bad {color:red;} |
||
80 | .indication {font-size:16px;font-weight:bold;} |
||
81 | .pendu {background-color:#CCC;width:80%;margin:auto;min-height:54px;padding:3px;} |
||
82 | .reponse, .lettres, .question {margin:1em;} |
||
83 | |||
84 | .dessin{border-right:1px dashed gray;} |
||
85 | .small_col{width:25%;} |
||
86 | .large_col{max-width:75%;} |
||
87 | .floating{float:left;} |
||
88 | |||
15691 | bpr | 89 | .type2 span {background-color:green;color:green; display: inline-block; min-height: 40px;width: 40px;padding:0 .5em;margin:2px;} |
5354 | obado | 90 | .type2 span.red {background-color:red;color:red;} |
91 | .type1 {min-width:210px;} |
||
92 | .type2,.type3 {min-width:80px;} |
||
3392 | bpr | 93 | </style> |
94 | } |
||
4122 | bpr | 95 | \if{\type=1}{ |
5354 | obado | 96 | \text{dessin=xrange 0,10 |
3392 | bpr | 97 | yrange 0,10 |
18061 | bpr | 98 | segments black, 0,1,2,1 |
99 | polyline black,1,1,1,8,5,8,5,6.5 |
||
3396 | bpr | 100 | linewidth 3} |
3392 | bpr | 101 | \matrix{pendu=ellipse 5,6,1.5,1.5,red |
18074 | bpr | 102 | polyline red, 5,5.4,5,3 |
103 | polyline red,4,4,5,5 |
||
104 | polyline red,6,4,5,5 |
||
105 | polyline red,6,2,5,3 |
||
106 | polyline red,4,2,5,3} |
||
5354 | obado | 107 | |
108 | \text{Dessin=<img src="draw(200,200 |
||
17234 | bpr | 109 | \dessin)" alt="\typename[1]">} |
4122 | bpr | 110 | } |
5354 | obado | 111 | |
112 | \text{contenu= } |
||
4122 | bpr | 113 | \if{\type=2}{ |
5722 | bpr | 114 | \text{contenu=\typename[2]} |
4122 | bpr | 115 | } |
5354 | obado | 116 | |
117 | \if{\type>1}{ |
||
118 | \text{order=shuffle(6)} |
||
119 | \text{dessin= |
||
120 | <div class="pendu"> |
||
15691 | bpr | 121 | <span id="essai_4">\contenu</span> |
122 | <span id="essai_5">\contenu</span> |
||
123 | <span id="essai_6">\contenu</span> |
||
124 | <span id="essai_1">\contenu</span> |
||
125 | <span id="essai_2">\contenu</span> |
||
126 | <span id="essai_3">\contenu</span> |
||
127 | </div> |
||
5354 | obado | 128 | } |
129 | \text{Dessin=\dessin} |
||
4122 | bpr | 130 | } |
3392 | bpr | 131 | |
132 | \text{nb=wims(charcnt \mot)} |
||
4122 | bpr | 133 | \text{mot1=wims(words2items wims(singlespace \mot))} |
134 | \text{mot=wims(replace internal , by _ in \mot1)} |
||
3392 | bpr | 135 | \text{mot=wims(text expand \mot using 10)} |
136 | \text{mot=wims(words2items \mot)} |
||
4755 | bpr | 137 | \text{blanc=position(_,\mot)} |
4122 | bpr | 138 | \text{MOT=wims(makelist \jok for x=1 to \nb)} |
4755 | bpr | 139 | \for{a in \blanc}{ |
140 | \text{MOT=wims(replace item number \a by _ in \MOT)} |
||
141 | } |
||
15691 | bpr | 142 | option première et dernière lettre |
143 | \if{hint isin \option}{ |
||
144 | \text{MOT=wims(replace item number 1 by \mot[1] in \MOT)} |
||
145 | \text{MOT=wims(replace item number -1 by \mot[-1] in \MOT)} |
||
146 | } |
||
147 | |||
5354 | obado | 148 | \text{MOT1=wims(makelist <span class="w">x</span> for x in \MOT) } |
3392 | bpr | 149 | \text{MOT2=wims(items2words \MOT1)} |
4755 | bpr | 150 | \text{MOT2=wims(replace internal _ by in \MOT2)} |
3392 | bpr | 151 | |
152 | \text{nstep=r1} |
||
153 | |||
5354 | obado | 154 | \text{lettre1=a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z} |
15691 | bpr | 155 | \text{accents=à,ä,â,é,è,ê,ë,î,ï,ô,ö,û,ù,ç} |
156 | \text{ponctu=?,!,-} |
||
157 | \text{lettre1=\lettre1,\accents,\ponctu} |
||
158 | \text{accents=wims(replace internal , by in \accents)} |
||
159 | \text{ponctu=wims(replace internal , by in \ponctu)} |
||
5354 | obado | 160 | \text{lettre=wims(makelist <span class="notseen">x</span> for x in \lettre1)} |
15691 | bpr | 161 | \text{lettre2=wims(replace internal , by in \lettre)} |
3392 | bpr | 162 | \nextstep{\nstep} |
163 | \text{cnt=0} |
||
164 | |||
5354 | obado | 165 | \integer{reste=6 - \cnt} |
5722 | bpr | 166 | \text{message=wims(replace internal XXXX by <strong>\reste</strong> in \message0)} |
15691 | bpr | 167 | \if{noaccent isin \option}{ |
168 | \text{motnoaccent=wims(deaccent \mot)} |
||
169 | }{\text{motnoaccent=\mot}} |
||
170 | |||
5354 | obado | 171 | \statement{ |
15703 | obado | 172 | <div class="instruction">\instruction</div> |
15691 | bpr | 173 | \if{\indication!=\empty}{ |
174 | <p><em>\Indication : <span class="indication">\indication</span></em></p> |
||
175 | } |
||
176 | <div class="floating small_col centrer type\type"> |
||
177 | <div class="dessin"> |
||
178 | <p>\message</p> |
||
179 | \Dessin |
||
180 | </div> |
||
5354 | obado | 181 | </div> |
15691 | bpr | 182 | <div class="floating large_col centrer"> |
183 | <div class="question">\motatrouver :<span class="word">\MOT2</span></div> |
||
184 | <div class="reponse"> |
||
185 | <label for="reply\step">\proposer :</label> |
||
186 | \embed{r\step,1 |
||
187 | default |
||
188 | maxlength="1" pattern="[a-z\accents\ponctu]" style="text-align:center;"} |
||
189 | </div> |
||
190 | <div class="lettres">\lettre2</div> |
||
191 | </div> |
||
3392 | bpr | 192 | } |
193 | |||
194 | \answer{}{\rep1}{type=case}{option=noanalyzeprint} |
||
195 | \answer{}{\rep2}{type=case}{option=noanalyzeprint} |
||
196 | \answer{}{\rep3}{type=case}{option=noanalyzeprint} |
||
197 | \answer{}{\rep4}{type=case}{option=noanalyzeprint} |
||
198 | \answer{}{\rep5}{type=case}{option=noanalyzeprint} |
||
199 | \answer{}{\rep6}{type=case}{option=noanalyzeprint} |
||
200 | \answer{}{\rep7}{type=case}{option=noanalyzeprint} |
||
201 | \answer{}{\rep8}{type=case}{option=noanalyzeprint} |
||
202 | \answer{}{\rep9}{type=case}{option=noanalyzeprint} |
||
203 | \answer{}{\rep10}{type=case}{option=noanalyzeprint} |
||
204 | \answer{}{\rep11}{type=case}{option=noanalyzeprint} |
||
205 | \answer{}{\rep12}{type=case}{option=noanalyzeprint} |
||
206 | \answer{}{\rep13}{type=case}{option=noanalyzeprint} |
||
207 | \answer{}{\rep14}{type=case}{option=noanalyzeprint} |
||
208 | \answer{}{\rep15}{type=case}{option=noanalyzeprint} |
||
209 | \answer{}{\rep16}{type=case}{option=noanalyzeprint} |
||
210 | \answer{}{\rep17}{type=case}{option=noanalyzeprint} |
||
211 | \answer{}{\rep18}{type=case}{option=noanalyzeprint} |
||
212 | \answer{}{\rep19}{type=case}{option=noanalyzeprint} |
||
213 | \answer{}{\rep20}{type=case}{option=noanalyzeprint} |
||
4122 | bpr | 214 | \answer{}{\rep21}{type=case}{option=noanalyzeprint} |
215 | \answer{}{\rep22}{type=case}{option=noanalyzeprint} |
||
216 | \answer{}{\rep23}{type=case}{option=noanalyzeprint} |
||
217 | \answer{}{\rep24}{type=case}{option=noanalyzeprint} |
||
218 | \answer{}{\rep25}{type=case}{option=noanalyzeprint} |
||
219 | \answer{}{\rep26}{type=case}{option=noanalyzeprint} |
||
220 | \answer{}{\rep27}{type=case}{option=noanalyzeprint} |
||
221 | \answer{}{\rep28}{type=case}{option=noanalyzeprint} |
||
222 | \answer{}{\rep29}{type=case}{option=noanalyzeprint} |
||
223 | \answer{}{\rep30}{type=case}{option=noanalyzeprint} |
||
3392 | bpr | 224 | |
225 | \text{rep=\rep1,\rep2,\rep3,\rep4,\rep5,\rep6,\rep7,\rep8,\rep9,\rep10,\rep11,\rep12,\rep13,\rep14, |
||
4754 | bpr | 226 | \rep15,\rep16,\rep17,\rep18,\rep19,\rep20,\rep21,\rep22,\rep23,\rep24, |
227 | \rep25,\rep26,\rep27,\rep28,\rep29,\rep30} |
||
3392 | bpr | 228 | |
5354 | obado | 229 | |
230 | \text{w_class=good} |
||
231 | |||
232 | \if{\rep[\step-1] notitemof \mot }{ |
||
233 | \integer{cnt=\cnt+1} |
||
234 | \integer{reste=6 - \cnt} |
||
235 | \text{w_class=bad} |
||
236 | \if {\reste > 0}{ |
||
5722 | bpr | 237 | \text{message=wims(replace internal XXXX by <strong>\reste</strong> in \message0)} |
5354 | obado | 238 | } |
239 | \if {\reste <= 0} { |
||
240 | \text{message=<strong class="oef_condbad">\echec</strong>} |
||
241 | } |
||
242 | \if{\type = 1}{ |
||
243 | \text{dessin=\dessin |
||
244 | \pendu[\cnt;]} |
||
245 | \text{Dessin=<img src="draw(200,200 |
||
17234 | bpr | 246 | \dessin)" alt="Vous avez fait \cnt erreur(s). Vous avancez vers la pendaison...">} |
5354 | obado | 247 | } |
248 | |||
249 | \if{\type>1}{ |
||
250 | \integer{h=\order[\cnt]} |
||
251 | \text{jj=<span id="essai_\h">\contenu</span>} |
||
252 | \if{\type=2}{ |
||
5722 | bpr | 253 | \text{dessin=wims(replace internal \jj by <span class="red">\typename[1]</span> in \dessin)} |
5354 | obado | 254 | } |
255 | \if{\type=3}{ |
||
17234 | bpr | 256 | \text{dessin=wims(replace internal \jj by <img src="gifs/images/skull_and_crossbones50.png" alt="\typename[1]"> in \dessin)} |
5354 | obado | 257 | } |
11557 | bpr | 258 | \text{Dessin=\dessin} |
5354 | obado | 259 | } |
260 | } |
||
261 | |||
15691 | bpr | 262 | %% On affiche differement les lettres deja tapées |
3392 | bpr | 263 | \text{z=position(\rep[\step-1],\lettre1)} |
5354 | obado | 264 | \text{lettre=wims(replace internal item number \z by <span class="seen \w_class">\rep[\step-1]</span> in \lettre)} |
15691 | bpr | 265 | \text{lettre2=wims(items2words \lettre)} |
5354 | obado | 266 | |
3392 | bpr | 267 | \text{z=position(\rep[\step-1],\mot)} |
268 | \for{k in \z}{ |
||
269 | \text{MOT=wims(replace internal item number \k by \rep[\step-1] in \MOT)} |
||
270 | } |
||
15691 | bpr | 271 | \if{noaccent isin \option}{ |
272 | \text{z=position(\rep[\step-1],\motnoaccent)} |
||
273 | \for{k in \z}{ |
||
274 | \text{MOT=wims(replace internal item number \k by \mot[\k] in \MOT)} |
||
275 | } |
||
276 | } |
||
5354 | obado | 277 | \text{MOT1=wims(makelist <span class="w">x</span> for x in \MOT)} |
3392 | bpr | 278 | \text{MOT2=wims(items2words \MOT1)} |
4755 | bpr | 279 | \text{MOT2=wims(replace internal _ by in \MOT2)} |
3392 | bpr | 280 | \text{nstep=} |
4122 | bpr | 281 | \text{nstep=\jok isitemof \MOT and \step<30 and \cnt<6 ? r \step} |
282 | \if{\step>30 or \cnt>=6}{ |
||
283 | \text{w=position(\jok,\MOT)} |
||
3392 | bpr | 284 | \for{a in \w}{ |
5354 | obado | 285 | \text{MOT1=wims(replace internal item number \a by <span class="w forget">\mot[\a]</span> in \MOT1)} |
3392 | bpr | 286 | } |
287 | \text{MOT2=wims(items2words \MOT1)} |
||
4755 | bpr | 288 | \text{MOT2=wims(replace internal _ by in \MOT2)} |
3392 | bpr | 289 | } |
290 | |||
15691 | bpr | 291 | \condition{Avez-vous trouvé le mot ?}{\jok notitemof \MOT} |
3392 | bpr | 292 | \condition{}{\cnt<=3}{option=hide} |
5722 | bpr | 293 | \condition{}{\cnt<=4}{option=hide} |