Subversion Repositories wimsdev

Rev

Rev 15179 | Rev 15703 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 15179 Rev 15691
Line 31... Line 31...
31
Texte affiché à la fin de l'exercice, quand le mot n'a pas été trouvé.
31
Texte affiché à la fin de l'exercice, quand le mot n'a pas été trouvé.
32
\text{echec=Perdu !}
32
\text{echec=Perdu !}
33
 
33
 
34
:Message sur le nombre d'essais restant
34
:Message sur le nombre d'essais restant
35
 
35
 
36
\text{message=Vous avez droit à XXXX erreurs}
36
\text{message0=Vous avez droit à XXXX erreurs}
37
 
37
 
38
:Type of drawing
38
:Type of drawing
39
Choix du dessin.  1: hangman, 2: rectangles with changing colours, 3: skull and crossbones
39
Choix du dessin.  1: hangman, 2: rectangles with changing colours, 3: skull and crossbones
40
\text{type=item(2,3 (skull and crossbones),
40
\text{type=item(2,3 (skull and crossbones),
41
	2 (rectangles with changing colours),
41
	2 (rectangles with changing colours),
Line 64... Line 64...
64
\text{indication=\mot[2..-1]}
64
\text{indication=\mot[2..-1]}
65
\text{mot=\mot[1]}
65
\text{mot=\mot[1]}
66
\text{jok=—}
66
\text{jok=—}
67
\css{<style>
67
\css{<style>
68
.centrer{text-align:center;}
68
.centrer{text-align:center;}
69
.seen {opacity:0.5;font-weight: bold;}
69
.seen {opacity:.5;font-weight: bold;}
-
 
70
.lettres{display: flex;
-
 
71
flex-wrap: wrap;
-
 
72
justify-content: center;}
70
.lettres span{background-color:orange;font-size:20px;font-family:monospace;padding:0 0.5em;}
73
.lettres span{background-color:orange;font-size:20px;font-family:monospace;padding:0 .5em;}
71
.w {padding : 0 2px;}
74
.w {padding : 0 2px;}
72
.word {background-color:orange;font-size:20px;white-space: nowrap;}
75
.word {background-color:orange;font-size:20px;white-space: nowrap;}
73
.forget {background-color:red;color:white;font-size:20px;}
76
.forget {background-color:red;color:white;font-size:20px;}
74
.good {color:green;}
77
.good {color:green;}
75
.bad  {color:red;}
78
.bad  {color:red;}
Line 80... Line 83...
80
.dessin{border-right:1px dashed gray;}
83
.dessin{border-right:1px dashed gray;}
81
.small_col{width:25%;}
84
.small_col{width:25%;}
82
.large_col{max-width:75%;}
85
.large_col{max-width:75%;}
83
.floating{float:left;}
86
.floating{float:left;}
84
 
87
 
85
.type2 span {background-color:green;color:green; display: inline-block; min-height: 40px;width: 40px;padding:0 0.5em;margin:2px;}
88
.type2 span {background-color:green;color:green; display: inline-block; min-height: 40px;width: 40px;padding:0 .5em;margin:2px;}
86
.type2 span.red {background-color:red;color:red;}
89
.type2 span.red {background-color:red;color:red;}
87
.type1 {min-width:210px;}
90
.type1 {min-width:210px;}
88
.type2,.type3  {min-width:80px;}
91
.type2,.type3  {min-width:80px;}
89
</style>
92
</style>
90
}
93
}
Line 102... Line 105...
102
lines red,6,2,5,3
105
lines red,6,2,5,3
103
lines red,4,2,5,3}
106
lines red,4,2,5,3}
104
 
107
 
105
\text{Dessin=<img src="draw(200,200
108
\text{Dessin=<img src="draw(200,200
106
\dessin)" alt="\typename[1]"/>}
109
\dessin)" alt="\typename[1]"/>}
107
 
-
 
108
}
110
}
109
 
111
 
110
\text{contenu=&nbsp;}
112
\text{contenu=&nbsp;}
111
\if{\type=2}{
113
\if{\type=2}{
112
  \text{contenu=\typename[2]}
114
  \text{contenu=\typename[2]}
113
}
115
}
114
 
116
 
115
\if{\type>1}{
117
\if{\type>1}{
116
 \text{order=shuffle(6)}
118
 \text{order=shuffle(6)}
117
 \text{dessin=
119
 \text{dessin=
118
 <div class="pendu">
120
 <div class="pendu">
-
 
121
  <span id="essai_4">\contenu</span>
119
  <span id="essai_4">\contenu</span><span id="essai_5">\contenu</span>
122
  <span id="essai_5">\contenu</span>
120
  <span id="essai_6">\contenu</span><span id="essai_1">\contenu</span>
123
  <span id="essai_6">\contenu</span>
-
 
124
  <span id="essai_1">\contenu</span>
-
 
125
  <span id="essai_2">\contenu</span>
121
  <span id="essai_2">\contenu</span><span id="essai_3">\contenu</span>
126
  <span id="essai_3">\contenu</span>
122
  </div>
127
 </div>
123
 }
128
 }
124
 \text{Dessin=\dessin}
129
 \text{Dessin=\dessin}
125
}
130
}
126
 
131
 
127
\text{nb=wims(charcnt \mot)}
132
\text{nb=wims(charcnt \mot)}
128
\text{mot1=wims(words2items wims(singlespace \mot))}
133
\text{mot1=wims(words2items wims(singlespace \mot))}
129
\text{mot=wims(replace internal , by _ in \mot1)}
134
\text{mot=wims(replace internal , by _ in \mot1)}
130
\text{mot=wims(text expand \mot using 10)}
135
\text{mot=wims(text expand \mot using 10)}
131
\text{mot=wims(words2items \mot)}
136
\text{mot=wims(words2items \mot)}
132
\text{blanc=position(_,\mot)}
137
\text{blanc=position(_,\mot)}
133
\text{MOT=wims(makelist \jok for x=1 to \nb)}
138
\text{MOT=wims(makelist \jok for x=1 to \nb)}
134
\for{a in \blanc}{
139
\for{a in \blanc}{
135
  \text{MOT=wims(replace item number \a by _ in \MOT)}
140
  \text{MOT=wims(replace item number \a by _ in \MOT)}
136
}
141
}
-
 
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
 
137
\text{MOT1=wims(makelist <span class="w">x</span> for x in \MOT) }
148
\text{MOT1=wims(makelist <span class="w">x</span> for x in \MOT) }
138
\text{MOT2=wims(items2words \MOT1)}
149
\text{MOT2=wims(items2words \MOT1)}
139
\text{MOT2=wims(replace internal _ by &nbsp; in \MOT2)}
150
\text{MOT2=wims(replace internal _ by &nbsp; in \MOT2)}
140
 
151
 
141
\text{nstep=r1}
152
\text{nstep=r1}
142
 
153
 
143
\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}
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}
144
\text{accents=à,ä,â,é,è,ê,ë,î,ï,ô,ö,û,ù,-,!,?}
155
\text{accents=à,ä,â,é,è,ê,ë,î,ï,ô,ö,û,ù,ç}
-
 
156
\text{ponctu=?,!,-}
145
   \text{lettre1=\lettre1,\accents}
157
\text{lettre1=\lettre1,\accents,\ponctu}
-
 
158
\text{accents=wims(replace internal ,  by in \accents)}
-
 
159
\text{ponctu=wims(replace internal ,  by in \ponctu)}
146
\text{lettre=wims(makelist <span class="notseen">x</span> for x in \lettre1)}
160
\text{lettre=wims(makelist <span class="notseen">x</span> for x in \lettre1)}
147
\text{lettre2=\lettre}
-
 
148
\text{lettre2=\lettre2[1..10]
-
 
149
<br/>\lettre2[11..20]
-
 
150
<br/>\lettre2[21..30]
-
 
151
<br/>\lettre2[31..-1]}
-
 
152
\text{lettre2=wims(replace internal ,  by in \lettre2)}
161
\text{lettre2=wims(replace internal ,  by in \lettre)}
153
\nextstep{\nstep}
162
\nextstep{\nstep}
154
\text{cnt=0}
163
\text{cnt=0}
155
 
164
 
156
\integer{reste=6 - \cnt}
165
\integer{reste=6 - \cnt}
157
\text{message=wims(replace internal XXXX by <strong>\reste</strong> in \message0)}
166
\text{message=wims(replace internal XXXX by <strong>\reste</strong> in \message0)}
-
 
167
\if{noaccent isin \option}{
-
 
168
  \text{motnoaccent=wims(deaccent \mot)}
-
 
169
}{\text{motnoaccent=\mot}}
-
 
170
 
158
\statement{
171
\statement{
159
	<p class="instruction">\instruction</p>
172
	<p class="instruction">\instruction</p>
-
 
173
	\if{\indication!=\empty}{
160
	<p ><em>\Indication&nbsp;: <span class="indication">\indication</span></em></p>
174
	<p><em>\Indication&nbsp;: <span class="indication">\indication</span></em></p>
161
<div class="floating small_col centrer type\type">
-
 
162
 <div class="dessin"><p>\message</p>
-
 
163
\Dessin</div>
-
 
164
</div>
175
	}
165
 <div class="floating large_col centrer">
176
  <div class="floating small_col centrer type\type">
166
  <div class="question">\motatrouver&nbsp;:<span class="word"> \MOT2</span></div>
-
 
167
  <div class="reponse">
177
    <div class="dessin">
168
   <label for="reply\step">\proposer&nbsp;: </label>
178
      <p>\message</p>
169
   \embed{r\step,1
179
      \Dessin
170
   default
180
    </div>
171
   autocomplete="off" maxlength="1" style="text-align:center;"}
-
 
172
  </div>
181
  </div>
173
  <div class="lettres">\lettre2</div>
182
  <div class="floating large_col centrer">
-
 
183
    <div class="question">\motatrouver&nbsp;:<span class="word">\MOT2</span></div>
-
 
184
    <div class="reponse">
-
 
185
      <label for="reply\step">\proposer&nbsp;:</label>
-
 
186
      \embed{r\step,1
-
 
187
        default
-
 
188
        maxlength="1" pattern="[a-z\accents\ponctu]" style="text-align:center;"}
174
 </div>
189
    </div>
175
 
-
 
176
<br style="clear:both;"/>
190
    <div class="lettres">\lettre2</div>
-
 
191
  </div>
177
}
192
}
178
 
193
 
179
\answer{}{\rep1}{type=case}{option=noanalyzeprint}
194
\answer{}{\rep1}{type=case}{option=noanalyzeprint}
180
\answer{}{\rep2}{type=case}{option=noanalyzeprint}
195
\answer{}{\rep2}{type=case}{option=noanalyzeprint}
181
\answer{}{\rep3}{type=case}{option=noanalyzeprint}
196
\answer{}{\rep3}{type=case}{option=noanalyzeprint}
182
\answer{}{\rep4}{type=case}{option=noanalyzeprint}
197
\answer{}{\rep4}{type=case}{option=noanalyzeprint}
Line 204... Line 219...
204
\answer{}{\rep26}{type=case}{option=noanalyzeprint}
219
\answer{}{\rep26}{type=case}{option=noanalyzeprint}
205
\answer{}{\rep27}{type=case}{option=noanalyzeprint}
220
\answer{}{\rep27}{type=case}{option=noanalyzeprint}
206
\answer{}{\rep28}{type=case}{option=noanalyzeprint}
221
\answer{}{\rep28}{type=case}{option=noanalyzeprint}
207
\answer{}{\rep29}{type=case}{option=noanalyzeprint}
222
\answer{}{\rep29}{type=case}{option=noanalyzeprint}
208
\answer{}{\rep30}{type=case}{option=noanalyzeprint}
223
\answer{}{\rep30}{type=case}{option=noanalyzeprint}
209
 
224
 
210
\text{rep=\rep1,\rep2,\rep3,\rep4,\rep5,\rep6,\rep7,\rep8,\rep9,\rep10,\rep11,\rep12,\rep13,\rep14,
225
\text{rep=\rep1,\rep2,\rep3,\rep4,\rep5,\rep6,\rep7,\rep8,\rep9,\rep10,\rep11,\rep12,\rep13,\rep14,
211
 \rep15,\rep16,\rep17,\rep18,\rep19,\rep20,\rep21,\rep22,\rep23,\rep24,
226
 \rep15,\rep16,\rep17,\rep18,\rep19,\rep20,\rep21,\rep22,\rep23,\rep24,
212
 \rep25,\rep26,\rep27,\rep28,\rep29,\rep30}
227
 \rep25,\rep26,\rep27,\rep28,\rep29,\rep30}
213
 
228
 
214
 
229
 
215
\text{w_class=good}
230
\text{w_class=good}
216
 
231
 
217
\if{\rep[\step-1] notitemof \mot }{
232
\if{\rep[\step-1] notitemof \mot }{
218
 \integer{cnt=\cnt+1}
233
 \integer{cnt=\cnt+1}
219
 \integer{reste=6 - \cnt}
234
 \integer{reste=6 - \cnt}
220
 \text{w_class=bad}
235
 \text{w_class=bad}
221
 
-
 
222
 \if {\reste > 0}{
236
 \if {\reste > 0}{
223
  \text{message=wims(replace internal XXXX by <strong>\reste</strong> in \message0)}
237
  \text{message=wims(replace internal XXXX by <strong>\reste</strong> in \message0)}
224
 }
238
 }
225
 \if {\reste <= 0} {
239
 \if {\reste <= 0} {
226
  \text{message=<strong class="oef_condbad">\echec</strong>}
240
  \text{message=<strong class="oef_condbad">\echec</strong>}
227
 }
241
 }
228
 
-
 
229
 \if{\type = 1}{
242
 \if{\type = 1}{
230
 \text{dessin=\dessin
243
 \text{dessin=\dessin
231
  \pendu[\cnt;]}
244
  \pendu[\cnt;]}
232
 \text{Dessin=<img src="draw(200,200
245
 \text{Dessin=<img src="draw(200,200
233
 \dessin)" alt="Vous avez fait \cnt erreur(s). Vous avancez vers la pendaison..."/>}
246
 \dessin)" alt="Vous avez fait \cnt erreur(s). Vous avancez vers la pendaison..."/>}
Line 244... Line 257...
244
  }
257
  }
245
  \text{Dessin=\dessin}
258
  \text{Dessin=\dessin}
246
 }
259
 }
247
}
260
}
248
 
261
 
249
# On affiche differement les lettres deja tapées
262
%% On affiche differement les lettres deja tapées
250
\text{z=position(\rep[\step-1],\lettre1)}
263
\text{z=position(\rep[\step-1],\lettre1)}
251
\text{lettre=wims(replace internal item number \z by <span class="seen \w_class">\rep[\step-1]</span> in \lettre)}
264
\text{lettre=wims(replace internal item number \z by <span class="seen \w_class">\rep[\step-1]</span> in \lettre)}
252
 
-
 
253
# On repartit les lettres par groupes de 10 maxi par ligne
-
 
254
\text{lettre2=\lettre[1..10]
-
 
255
<br/>\lettre[11..20]
-
 
256
<br/>\lettre[21..30]
-
 
257
<br/>\lettre[31..-1]}
-
 
258
\text{lettre2=wims(replace internal , by in \lettre2)}
265
\text{lettre2=wims(items2words \lettre)}
259
 
-
 
260
 
266
 
261
\text{z=position(\rep[\step-1],\mot)}
267
\text{z=position(\rep[\step-1],\mot)}
262
\for{k in \z}{
268
\for{k in \z}{
263
  \text{MOT=wims(replace internal item number \k by \rep[\step-1] in \MOT)}
269
  \text{MOT=wims(replace internal item number \k by \rep[\step-1] in \MOT)}
264
}
270
}
-
 
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
  }
265
 
276
}
266
\text{MOT1=wims(makelist <span class="w">x</span> for x in \MOT)}
277
\text{MOT1=wims(makelist <span class="w">x</span> for x in \MOT)}
267
\text{MOT2=wims(items2words \MOT1)}
278
\text{MOT2=wims(items2words \MOT1)}
268
\text{MOT2=wims(replace internal _ by &nbsp; in \MOT2)}
279
\text{MOT2=wims(replace internal _ by &nbsp; in \MOT2)}
269
\text{nstep=}
280
\text{nstep=}
270
\text{nstep=\jok isitemof \MOT and \step<30 and \cnt<6 ? r \step}
281
\text{nstep=\jok isitemof \MOT and \step<30 and \cnt<6 ? r \step}