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 38... | Line 38... | ||
38 | :Tipus de disseny |
38 | :Tipus de disseny |
39 | Elecció del disseny: "Penjat", "Targes vermelles" o "Cranis" |
39 | Elecció del disseny: "Penjat", "Targes vermelles" o "Cranis" |
40 | \text{type=item(2,3 (Cranis), |
40 | \text{type=item(2,3 (Cranis), |
41 | 2 (Tarja_vermella, Tarja_verda), |
41 | 2 (Tarja_vermella, Tarja_verda), |
42 | 1 (Penjat))} |
42 | 1 (Penjat))} |
43 | 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=} |
|
44 | :Dades principals. |
46 | :Dades principals. |
45 | Introduïu a la primera columna les paraules en minúscules i en la segona una possible indicació. |
47 | 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>. |
48 | En el cas dels grups de paraules, reemplaça el blanc amb un <span class="tt">_</span>. |
47 | \text{data=éléphant,un animal |
49 | \text{data=éléphant,un animal |
48 | chandelier, la première lettre est c |
50 | chandelier, la première lettre est c |
Line 62... | Line 64... | ||
62 | \text{indication=\mot[2..-1]} |
64 | \text{indication=\mot[2..-1]} |
63 | \text{mot=\mot[1]} |
65 | \text{mot=\mot[1]} |
64 | \text{jok=—} |
66 | \text{jok=—} |
65 | \css{<style> |
67 | \css{<style> |
66 | .centrer{text-align:center;} |
68 | .centrer{text-align:center;} |
67 | .seen {opacity: |
69 | .seen {opacity:.5;font-weight: bold;} |
- | 70 | .lettres{display: flex; |
|
- | 71 | flex-wrap: wrap; |
|
- | 72 | justify-content: center;} |
|
68 | .lettres span{background-color:orange;font-size:20px;font-family:monospace;padding:0 |
73 | .lettres span{background-color:orange;font-size:20px;font-family:monospace;padding:0 .5em;} |
69 | .w {padding : 0 2px;} |
74 | .w {padding : 0 2px;} |
70 | .word {background-color:orange;font-size:20px;white-space: nowrap;} |
75 | .word {background-color:orange;font-size:20px;white-space: nowrap;} |
71 | .forget {background-color:red;color:white;font-size:20px;} |
76 | .forget {background-color:red;color:white;font-size:20px;} |
72 | .good {color:green;} |
77 | .good {color:green;} |
73 | .bad {color:red;} |
78 | .bad {color:red;} |
Line 78... | Line 83... | ||
78 | .dessin{border-right:1px dashed gray;} |
83 | .dessin{border-right:1px dashed gray;} |
79 | .small_col{width:25%;} |
84 | .small_col{width:25%;} |
80 | .large_col{max-width:75%;} |
85 | .large_col{max-width:75%;} |
81 | .floating{float:left;} |
86 | .floating{float:left;} |
82 | 87 | ||
83 | .type2 span {background-color:green;color:green; display: inline-block; min-height: 40px;width: 40px;padding:0 |
88 | .type2 span {background-color:green;color:green; display: inline-block; min-height: 40px;width: 40px;padding:0 .5em;margin:2px;} |
84 | .type2 span.red {background-color:red;color:red;} |
89 | .type2 span.red {background-color:red;color:red;} |
85 | .type1 {min-width:210px;} |
90 | .type1 {min-width:210px;} |
86 | .type2,.type3 {min-width:80px;} |
91 | .type2,.type3 {min-width:80px;} |
87 | </style> |
92 | </style> |
88 | } |
93 | } |
Line 100... | Line 105... | ||
100 | lines red,6,2,5,3 |
105 | lines red,6,2,5,3 |
101 | lines red,4,2,5,3} |
106 | lines red,4,2,5,3} |
102 | 107 | ||
103 | \text{Dessin=<img src="draw(200,200 |
108 | \text{Dessin=<img src="draw(200,200 |
104 | \dessin)" alt="\typename[1]"/>} |
109 | \dessin)" alt="\typename[1]"/>} |
105 | - | ||
106 | } |
110 | } |
107 | 111 | ||
108 | \text{contenu= } |
112 | \text{contenu= } |
109 | \if{\type=2}{ |
113 | \if{\type=2}{ |
110 | \text{contenu=\typename[2]} |
114 | \text{contenu=\typename[2]} |
Line 112... | Line 116... | ||
112 | 116 | ||
113 | \if{\type>1}{ |
117 | \if{\type>1}{ |
114 | \text{order=shuffle(6)} |
118 | \text{order=shuffle(6)} |
115 | \text{dessin= |
119 | \text{dessin= |
116 | <div class="pendu"> |
120 | <div class="pendu"> |
- | 121 | <span id="essai_4">\contenu</span> |
|
117 |
|
122 | <span id="essai_5">\contenu</span> |
118 | <span id="essai_6 |
123 | <span id="essai_6">\contenu</span> |
- | 124 | <span id="essai_1">\contenu</span> |
|
- | 125 | <span id="essai_2">\contenu</span> |
|
119 |
|
126 | <span id="essai_3">\contenu</span> |
120 |
|
127 | </div> |
121 | } |
128 | } |
122 | \text{Dessin=\dessin} |
129 | \text{Dessin=\dessin} |
123 | } |
130 | } |
124 | 131 | ||
125 | \text{nb=wims(charcnt \mot)} |
132 | \text{nb=wims(charcnt \mot)} |
126 | \text{mot1=wims(words2items wims(singlespace \mot))} |
133 | \text{mot1=wims(words2items wims(singlespace \mot))} |
127 | \text{mot=wims(replace internal , by _ in \mot1)} |
134 | \text{mot=wims(replace internal , by _ in \mot1)} |
128 | \text{mot=wims(text expand \mot using 10)} |
135 | \text{mot=wims(text expand \mot using 10)} |
129 | \text{mot=wims(words2items \mot)} |
136 | \text{mot=wims(words2items \mot)} |
130 | \text{blanc=position(_,\mot)} |
137 | \text{blanc=position(_,\mot)} |
131 | \text{MOT=wims(makelist \jok for x=1 to \nb)} |
138 | \text{MOT=wims(makelist \jok for x=1 to \nb)} |
132 | \for{a in \blanc}{ |
139 | \for{a in \blanc}{ |
133 | \text{MOT=wims(replace item number \a by _ in \MOT)} |
140 | \text{MOT=wims(replace item number \a by _ in \MOT)} |
134 | } |
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 | ||
135 | \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) } |
136 | \text{MOT2=wims(items2words \MOT1)} |
149 | \text{MOT2=wims(items2words \MOT1)} |
137 | \text{MOT2=wims(replace internal _ by in \MOT2)} |
150 | \text{MOT2=wims(replace internal _ by in \MOT2)} |
138 | 151 | ||
139 | \text{nstep=r1} |
152 | \text{nstep=r1} |
140 | 153 | ||
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} |
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} |
142 | \text{ |
155 | \text{accents=à,ä,â,é,è,ê,ë,î,ï,ô,ö,û,ù,ç} |
- | 156 | \text{ponctu=?,!,-} |
|
143 |
|
157 | \text{lettre1=\lettre1,\accents,\ponctu} |
- | 158 | \text{accents=wims(replace internal , by in \accents)} |
|
- | 159 | \text{ponctu=wims(replace internal , by in \ponctu)} |
|
144 | \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)} |
145 | \text{lettre2=\lettre} |
- | |
146 | \text{lettre2=\lettre2[1..10] |
- | |
147 | <br/>\lettre2[11..20] |
- | |
148 | <br/>\lettre2[21..30] |
- | |
149 | <br/>\lettre2[31..-1]} |
- | |
150 | \text{lettre2=wims(replace internal , by in |
161 | \text{lettre2=wims(replace internal , by in \lettre)} |
151 | \nextstep{\nstep} |
162 | \nextstep{\nstep} |
152 | \text{cnt=0} |
163 | \text{cnt=0} |
153 | 164 | ||
154 | \integer{reste=6 - \cnt} |
165 | \integer{reste=6 - \cnt} |
155 | \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 | ||
156 | \statement{ |
171 | \statement{ |
157 | <p class="instruction">\instruction</p> |
172 | <p class="instruction">\instruction</p> |
- | 173 | \if{\indication!=\empty}{ |
|
158 | <p |
174 | <p><em>\Indication : <span class="indication">\indication</span></em></p> |
- | 175 | } |
|
159 | <div class="floating small_col centrer type\type"> |
176 | <div class="floating small_col centrer type\type"> |
160 | <div class= |
177 | <div class="dessin"> |
- | 178 | <p>\message</p> |
|
- | 179 | \Dessin |
|
161 |
|
180 | </div> |
162 | </div> |
181 | </div> |
163 | <div class="floating large_col centrer"> |
182 | <div class="floating large_col centrer"> |
164 | <div |
183 | <div class="question">\motatrouver :<span class="word">\MOT2</span></div> |
165 | <div class="reponse"> |
184 | <div class="reponse"> |
166 | <label for="reply\step">\proposer : |
185 | <label for="reply\step">\proposer :</label> |
167 | \embed{r\step,1 |
186 | \embed{r\step,1 |
168 | default |
187 | default |
169 |
|
188 | maxlength="1" pattern="[a-z\accents\ponctu]" style="text-align:center;"} |
- | 189 | </div> |
|
- | 190 | <div class="lettres">\lettre2</div> |
|
170 | </div> |
191 | </div> |
171 | <div class="lettres">\lettre2</div> |
- | |
172 | </div> |
- | |
173 | - | ||
174 | <br style="clear:both;"/> |
- | |
175 | } |
192 | } |
176 | 193 | ||
177 | \answer{}{\rep1}{type=case}{option=noanalyzeprint} |
194 | \answer{}{\rep1}{type=case}{option=noanalyzeprint} |
178 | \answer{}{\rep2}{type=case}{option=noanalyzeprint} |
195 | \answer{}{\rep2}{type=case}{option=noanalyzeprint} |
179 | \answer{}{\rep3}{type=case}{option=noanalyzeprint} |
196 | \answer{}{\rep3}{type=case}{option=noanalyzeprint} |
Line 214... | Line 231... | ||
214 | 231 | ||
215 | \if{\rep[\step-1] notitemof \mot }{ |
232 | \if{\rep[\step-1] notitemof \mot }{ |
216 | \integer{cnt=\cnt+1} |
233 | \integer{cnt=\cnt+1} |
217 | \integer{reste=6 - \cnt} |
234 | \integer{reste=6 - \cnt} |
218 | \text{w_class=bad} |
235 | \text{w_class=bad} |
219 | - | ||
220 | \if {\reste > 0}{ |
236 | \if {\reste > 0}{ |
221 | \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)} |
222 | } |
238 | } |
223 | \if {\reste <= 0} { |
239 | \if {\reste <= 0} { |
224 | \text{message=<strong class="oef_condbad">\echec</strong>} |
240 | \text{message=<strong class="oef_condbad">\echec</strong>} |
225 | } |
241 | } |
226 | - | ||
227 | \if{\type = 1}{ |
242 | \if{\type = 1}{ |
228 | \text{dessin=\dessin |
243 | \text{dessin=\dessin |
229 | \pendu[\cnt;]} |
244 | \pendu[\cnt;]} |
230 | \text{Dessin=<img src="draw(200,200 |
245 | \text{Dessin=<img src="draw(200,200 |
231 | \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..."/>} |
232 | } |
247 | } |
233 | 248 | ||
234 | \if{\type>1}{ |
249 | \if{\type>1}{ |
235 | \integer{h=\order[\cnt]} |
250 | \integer{h=\order[\cnt]} |
236 | \text{jj=<span id="essai_\h">\contenu</span>} |
251 | \text{jj=<span id="essai_\h">\contenu</span>} |
237 | \if{\type=2}{ |
252 | \if{\type=2}{ |
238 | \text{dessin=wims(replace internal \jj by <span class="red">\typename[1]</span> in \dessin)} |
253 | \text{dessin=wims(replace internal \jj by <span class="red">\typename[1]</span> in \dessin)} |
239 | } |
254 | } |
240 | \if{\type=3}{ |
255 | \if{\type=3}{ |
241 | \text{dessin=wims(replace internal \jj by <img src="gifs/images/skull_and_crossbones50.png" alt="\typename[1]"/> in \dessin)} |
256 | \text{dessin=wims(replace internal \jj by <img src="gifs/images/skull_and_crossbones50.png" alt="\typename[1]"/> in \dessin)} |
242 | } |
257 | } |
243 | \text{Dessin=\dessin} |
258 | \text{Dessin=\dessin} |
244 | } |
259 | } |
245 | } |
260 | } |
246 | 261 | ||
247 |
|
262 | %% On affiche differement les lettres deja tapées |
248 | \text{z=position(\rep[\step-1],\lettre1)} |
263 | \text{z=position(\rep[\step-1],\lettre1)} |
249 | \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)} |
250 | - | ||
251 | # On repartit les lettres par groupes de 10 maxi par ligne |
- | |
252 | \text{lettre2=\lettre[1..10] |
- | |
253 | <br/>\lettre[11..20] |
- | |
254 | <br/>\lettre[21..30] |
- | |
255 | <br/>\lettre[31..-1]} |
- | |
256 | \text{lettre2=wims( |
265 | \text{lettre2=wims(items2words \lettre)} |
257 | - | ||
258 | 266 | ||
259 | \text{z=position(\rep[\step-1],\mot)} |
267 | \text{z=position(\rep[\step-1],\mot)} |
260 | \for{k in \z}{ |
268 | \for{k in \z}{ |
261 | \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)} |
262 | } |
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 | } |
|
263 | 276 | } |
|
264 | \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)} |
265 | \text{MOT2=wims(items2words \MOT1)} |
278 | \text{MOT2=wims(items2words \MOT1)} |
266 | \text{MOT2=wims(replace internal _ by in \MOT2)} |
279 | \text{MOT2=wims(replace internal _ by in \MOT2)} |
267 | \text{nstep=} |
280 | \text{nstep=} |
268 | \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} |
Line 273... | Line 286... | ||
273 | } |
286 | } |
274 | \text{MOT2=wims(items2words \MOT1)} |
287 | \text{MOT2=wims(items2words \MOT1)} |
275 | \text{MOT2=wims(replace internal _ by in \MOT2)} |
288 | \text{MOT2=wims(replace internal _ by in \MOT2)} |
276 | } |
289 | } |
277 | 290 | ||
278 | \condition{ |
291 | \condition{Avez-vous trouvé le mot ?}{\jok notitemof \MOT} |
279 | \condition{}{\cnt<=3}{option=hide} |
292 | \condition{}{\cnt<=3}{option=hide} |
280 | \condition{}{\cnt<=4}{option=hide} |
293 | \condition{}{\cnt<=4}{option=hide} |