Subversion Repositories wimsdev

Rev

Rev 13716 | Rev 15691 | Go to most recent revision | 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))}
43
 
44
:Dades principals.
45
Introduïu a la primera columna les paraules en minúscules i en la segona una possible indicació.
46
En el cas dels grups de paraules, reemplaça el blanc amb un <span class="tt">_</span>.
3392 bpr 47
\text{data=éléphant,un animal
4122 bpr 48
chandelier, la première lettre est c
5452 bpr 49
mouette_rieuse, sur la plage
3392 bpr 50
vague, sur la plage
51
}
52
 
53
:%%%%%%%%%%%%%% Rien à modifier avant l'énoncé %%%%%%%%%%%%%%%%
12172 mquerol 54
\text{Indication=Indicació}
55
\text{motatrouver=Paraula a trobar}
56
\text{proposer=Proposa una lletra en minúscula}
5722 bpr 57
\text{typename=wims(declosing wims(word 2 to -1 of \type))}
5354 obado 58
\text{type=wims(word 1 of \type)}
5722 bpr 59
\text{typename=wims(words2items wims(nospace \typename))}
11557 bpr 60
\text{typename=slib(oef/blank _,,\typename)}
3392 bpr 61
\text{mot=randrow(\data)}
62
\text{indication=\mot[2..-1]}
63
\text{mot=\mot[1]}
5354 obado 64
\text{jok=&mdash;}
13716 obado 65
\css{<style>
5354 obado 66
.centrer{text-align:center;}
67
.seen {opacity:0.5;font-weight: bold;}
68
.lettres span{background-color:orange;font-size:20px;font-family:monospace;padding:0 0.5em;}
69
.w {padding : 0 2px;}
70
.word {background-color:orange;font-size:20px;white-space: nowrap;}
71
.forget {background-color:red;color:white;font-size:20px;}
72
.good {color:green;}
73
.bad  {color:red;}
74
.indication {font-size:16px;font-weight:bold;}
75
.pendu {background-color:#CCC;width:80%;margin:auto;min-height:54px;padding:3px;}
76
.reponse, .lettres, .question {margin:1em;}
77
 
78
.dessin{border-right:1px dashed gray;}
79
.small_col{width:25%;}
80
.large_col{max-width:75%;}
81
.floating{float:left;}
82
 
83
.type2 span {background-color:green;color:green; display: inline-block; min-height: 40px;width: 40px;padding:0 0.5em;margin:2px;}
84
.type2 span.red {background-color:red;color:red;}
85
.type1 {min-width:210px;}
86
.type2,.type3  {min-width:80px;}
3392 bpr 87
</style>
88
}
4122 bpr 89
\if{\type=1}{
5354 obado 90
 \text{dessin=xrange 0,10
3392 bpr 91
yrange 0,10
92
lines black, 0,1,2,1
3396 bpr 93
lines black,1,1,1,8,5,8,5,6.5
94
linewidth 3}
5354 obado 95
 
3392 bpr 96
\matrix{pendu=ellipse 5,6,1.5,1.5,red
97
lines red, 5,5.4,5,3
98
lines red,4,4,5,5
99
lines red,6,4,5,5
100
lines red,6,2,5,3
101
lines red,4,2,5,3}
5354 obado 102
 
103
\text{Dessin=<img src="draw(200,200
5722 bpr 104
\dessin)" alt="\typename[1]"/>}
5354 obado 105
 
4122 bpr 106
}
5354 obado 107
 
108
\text{contenu=&nbsp;}
4122 bpr 109
\if{\type=2}{
5722 bpr 110
  \text{contenu=\typename[2]}
4122 bpr 111
}
5354 obado 112
 
113
\if{\type>1}{
114
 \text{order=shuffle(6)}
115
 \text{dessin=
116
 <div class="pendu">
117
  <span id="essai_4">\contenu</span><span id="essai_5">\contenu</span>
118
  <span id="essai_6">\contenu</span><span id="essai_1">\contenu</span>
119
  <span id="essai_2">\contenu</span><span id="essai_3">\contenu</span>
120
  </div>
121
 }
122
 \text{Dessin=\dessin}
4122 bpr 123
}
3392 bpr 124
 
125
\text{nb=wims(charcnt \mot)}
4122 bpr 126
\text{mot1=wims(words2items wims(singlespace \mot))}
127
\text{mot=wims(replace internal , by _ in \mot1)}
3392 bpr 128
\text{mot=wims(text expand \mot using 10)}
129
\text{mot=wims(words2items \mot)}
4755 bpr 130
\text{blanc=position(_,\mot)}
4122 bpr 131
\text{MOT=wims(makelist \jok for x=1 to \nb)}
4755 bpr 132
\for{a in \blanc}{
133
  \text{MOT=wims(replace item number \a by _ in \MOT)}
134
}
5354 obado 135
\text{MOT1=wims(makelist <span class="w">x</span> for x in \MOT) }
3392 bpr 136
\text{MOT2=wims(items2words \MOT1)}
4755 bpr 137
\text{MOT2=wims(replace internal _ by &nbsp; in \MOT2)}
3392 bpr 138
 
139
\text{nstep=r1}
140
 
5354 obado 141
\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}
142
\text{accents=à,ä,â,é,è,ê,ë,î,ï,ô,ö,û,ù,-,!,?}
143
   \text{lettre1=\lettre1,\accents}
144
\text{lettre=wims(makelist <span class="notseen">x</span> for x in \lettre1)}
3392 bpr 145
\text{lettre2=\lettre}
146
\text{lettre2=\lettre2[1..10]
5354 obado 147
<br/>\lettre2[11..20]
148
<br/>\lettre2[21..30]
149
<br/>\lettre2[31..-1]}
3392 bpr 150
\text{lettre2=wims(replace internal ,  by in \lettre2)}
151
\nextstep{\nstep}
152
\text{cnt=0}
153
 
5354 obado 154
\integer{reste=6 - \cnt}
5722 bpr 155
\text{message=wims(replace internal XXXX by <strong>\reste</strong> in \message0)}
5354 obado 156
\statement{
12172 mquerol 157
	<p class="instruction">\instruction</p>
5452 bpr 158
	<p ><em>\Indication&nbsp;: <span class="indication">\indication</span></em></p>
5354 obado 159
<div class="floating small_col centrer type\type">
160
 <div class="dessin"><p>\message</p>
161
\Dessin</div>
162
</div>
163
 <div class="floating large_col centrer">
5452 bpr 164
  <div class="question">\motatrouver&nbsp;:<span class="word"> \MOT2</span></div>
5354 obado 165
  <div class="reponse">
5452 bpr 166
   <label for="reply\step">\proposer&nbsp;: </label>
5354 obado 167
   \embed{r\step,1
168
   default
11557 bpr 169
   autocomplete="off" maxlength="1" style="text-align:center;"}
5354 obado 170
  </div>
171
  <div class="lettres">\lettre2</div>
172
 </div>
173
 
174
<br style="clear:both;"/>
3392 bpr 175
}
176
 
177
\answer{}{\rep1}{type=case}{option=noanalyzeprint}
178
\answer{}{\rep2}{type=case}{option=noanalyzeprint}
179
\answer{}{\rep3}{type=case}{option=noanalyzeprint}
180
\answer{}{\rep4}{type=case}{option=noanalyzeprint}
181
\answer{}{\rep5}{type=case}{option=noanalyzeprint}
182
\answer{}{\rep6}{type=case}{option=noanalyzeprint}
183
\answer{}{\rep7}{type=case}{option=noanalyzeprint}
184
\answer{}{\rep8}{type=case}{option=noanalyzeprint}
185
\answer{}{\rep9}{type=case}{option=noanalyzeprint}
186
\answer{}{\rep10}{type=case}{option=noanalyzeprint}
187
\answer{}{\rep11}{type=case}{option=noanalyzeprint}
188
\answer{}{\rep12}{type=case}{option=noanalyzeprint}
189
\answer{}{\rep13}{type=case}{option=noanalyzeprint}
190
\answer{}{\rep14}{type=case}{option=noanalyzeprint}
191
\answer{}{\rep15}{type=case}{option=noanalyzeprint}
192
\answer{}{\rep16}{type=case}{option=noanalyzeprint}
193
\answer{}{\rep17}{type=case}{option=noanalyzeprint}
194
\answer{}{\rep18}{type=case}{option=noanalyzeprint}
195
\answer{}{\rep19}{type=case}{option=noanalyzeprint}
196
\answer{}{\rep20}{type=case}{option=noanalyzeprint}
4122 bpr 197
\answer{}{\rep21}{type=case}{option=noanalyzeprint}
198
\answer{}{\rep22}{type=case}{option=noanalyzeprint}
199
\answer{}{\rep23}{type=case}{option=noanalyzeprint}
200
\answer{}{\rep24}{type=case}{option=noanalyzeprint}
201
\answer{}{\rep25}{type=case}{option=noanalyzeprint}
202
\answer{}{\rep26}{type=case}{option=noanalyzeprint}
203
\answer{}{\rep27}{type=case}{option=noanalyzeprint}
204
\answer{}{\rep28}{type=case}{option=noanalyzeprint}
205
\answer{}{\rep29}{type=case}{option=noanalyzeprint}
206
\answer{}{\rep30}{type=case}{option=noanalyzeprint}
3392 bpr 207
 
208
\text{rep=\rep1,\rep2,\rep3,\rep4,\rep5,\rep6,\rep7,\rep8,\rep9,\rep10,\rep11,\rep12,\rep13,\rep14,
4754 bpr 209
 \rep15,\rep16,\rep17,\rep18,\rep19,\rep20,\rep21,\rep22,\rep23,\rep24,
210
 \rep25,\rep26,\rep27,\rep28,\rep29,\rep30}
3392 bpr 211
 
5354 obado 212
 
213
\text{w_class=good}
214
 
215
\if{\rep[\step-1] notitemof \mot }{
216
 \integer{cnt=\cnt+1}
217
 \integer{reste=6 - \cnt}
218
 \text{w_class=bad}
219
 
220
 \if {\reste > 0}{
5722 bpr 221
  \text{message=wims(replace internal XXXX by <strong>\reste</strong> in \message0)}
5354 obado 222
 }
223
 \if {\reste <= 0} {
224
  \text{message=<strong class="oef_condbad">\echec</strong>}
225
 }
226
 
227
 \if{\type = 1}{
228
 \text{dessin=\dessin
229
  \pendu[\cnt;]}
230
 \text{Dessin=<img src="draw(200,200
5722 bpr 231
 \dessin)" alt="Vous avez fait \cnt erreur(s). Vous avancez vers la pendaison..."/>}
5354 obado 232
 }
233
 
234
 \if{\type>1}{
235
  \integer{h=\order[\cnt]}
236
  \text{jj=<span id="essai_\h">\contenu</span>}
237
  \if{\type=2}{
5722 bpr 238
   \text{dessin=wims(replace internal \jj by <span class="red">\typename[1]</span> in \dessin)}
5354 obado 239
  }
240
  \if{\type=3}{
5722 bpr 241
   \text{dessin=wims(replace internal \jj by <img src="gifs/images/skull_and_crossbones50.png" alt="\typename[1]"/> in \dessin)}
5354 obado 242
  }
11557 bpr 243
  \text{Dessin=\dessin}
5354 obado 244
 }
245
}
246
 
247
# On affiche differement les lettres deja tapées
3392 bpr 248
\text{z=position(\rep[\step-1],\lettre1)}
5354 obado 249
\text{lettre=wims(replace internal item number \z by <span class="seen \w_class">\rep[\step-1]</span> in \lettre)}
250
 
251
# On repartit les lettres par groupes de 10 maxi par ligne
3392 bpr 252
\text{lettre2=\lettre[1..10]
5354 obado 253
<br/>\lettre[11..20]
254
<br/>\lettre[21..30]
255
<br/>\lettre[31..-1]}
3392 bpr 256
\text{lettre2=wims(replace internal , by in \lettre2)}
5354 obado 257
 
258
 
3392 bpr 259
\text{z=position(\rep[\step-1],\mot)}
260
\for{k in \z}{
261
  \text{MOT=wims(replace internal item number \k by \rep[\step-1] in \MOT)}
262
}
5354 obado 263
 
264
\text{MOT1=wims(makelist <span class="w">x</span> for x in \MOT)}
3392 bpr 265
\text{MOT2=wims(items2words \MOT1)}
4755 bpr 266
\text{MOT2=wims(replace internal _ by &nbsp; in \MOT2)}
3392 bpr 267
\text{nstep=}
4122 bpr 268
\text{nstep=\jok isitemof \MOT and \step<30 and \cnt<6 ? r \step}
269
\if{\step>30 or \cnt>=6}{
270
  \text{w=position(\jok,\MOT)}
3392 bpr 271
  \for{a in \w}{
5354 obado 272
    \text{MOT1=wims(replace internal item number \a by <span class="w forget">\mot[\a]</span> in \MOT1)}
3392 bpr 273
  }
274
  \text{MOT2=wims(items2words \MOT1)}
4755 bpr 275
  \text{MOT2=wims(replace internal _ by &nbsp; in \MOT2)}
3392 bpr 276
}
277
 
4122 bpr 278
\condition{Vous avez trouvé le mot ?}{\jok notitemof \MOT}
3392 bpr 279
\condition{}{\cnt<=3}{option=hide}
5722 bpr 280
\condition{}{\cnt<=4}{option=hide}