Subversion Repositories wimsdev

Rev

Rev 5271 | Rev 5907 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
4602 bpr 1
type=datalist
4375 bpr 2
textarea="data1 data2 data3 data4 data5"
3
 
4
:Mélange de lettres
5
Faire un mot avec des lettres. Jusqu'à 5 listes de mots peuvent être entrées. 
6
Un mot au hasard dans chaque liste est pris à chaque fois. Une indication
7
peut être mise pour chaque mot.
8
<p>
9
<span class="wims_warning">$wims_name_warning</span>. Vous devez vérifier
10
que d'autres mots ne sont pas faisables avec les mêmes lettres
11
ou mettre une indication qui permette de différencier.
12
<p>
13
Auteur du modèle : Bernadette Perrin-Riou <bpr@math.u-psud.fr>
14
</p>
15
:%%%%%%%%%%%%%%%%%      ATTENTION      %%%%%%%%%%%%%%%%%%%%
16
 
17
Enlevez l'en-tête ci-dessus si vous détruisez les balises pour le modèle !
18
(Ce sont les lignes qui commencent par un ':'.)
19
Sinon l'exercice risque de ne pas pouvoir repasser sous Createxo.
20
 
21
:%%%%%%%% Paramètres d'exemples à redéfinir %%%%%%%%%%%%%%%%%
22
 
23
:\title{Faire un mot avec des lettres }
5147 bpr 24
:\author{Bernadette, Perrin-Riou}
4375 bpr 25
:\email{bpr@math.u-psud.fr}
26
 
27
:Consigne
28
\text{instruction=Composer un mot avec toutes les lettres proposées.}
29
 
30
:Nombre de mots (au maximum 5)
31
Le nombre de mots doit être inférieur à 5 et inférieur au nombre de listes
32
remplies ci-dessous.
33
\integer{N=3}
34
 
35
:Première liste de mots
5271 bpr 36
Mettre un mot (ou groupe de mots) par ligne, suivi éventuellement d'une indication. S'il s'agit
37
d'un groupe de mots, remplacer l'espace par  <tt>_</tt>.
4375 bpr 38
\text{data1=bille, un jeu
39
domino,un jeu}
40
:Seconde liste de mots
41
\text{data2=enfant
42
mère
43
père}
44
:Troisième liste de mots 
45
\text{data3=maison
46
immeuble
47
villa
48
habitation
49
}
50
:Quatrième liste de mots
51
\text{data4=}
52
:Cinquième liste de mots
53
\text{data5=}
54
 
55
:%%%%%%%%%%%%%% Rien à modifier avant l'énoncé %%%%%%%%%%%%%%%%
56
\matrix{data1=\data1}
57
\text{mot1=wims(nonempty items \data1[;1])}
58
\text{mot1=items(\mot1)>=2 ? shuffle(\mot1)}
59
\text{mot1=\mot1[1]}
60
\text{indication1=wims(select \data1 where column 1 issametext \mot1)}
61
\text{indication1=\indication1[2]}
62
\text{indication1=\indication1 issametext ? xxx}
63
\text{mot=\mot1}
64
\matrix{indication=\indication1}
65
\matrix{data2=\data2}
66
\text{mot2=wims(nonempty items \data2[;1])}
67
\text{mot2=items(\mot2)>=2 ? shuffle(\mot2)}
68
\text{mot2=\mot2[1]}
4734 bpr 69
\if{\mot2!=}{
4375 bpr 70
 \text{indication2=wims(select \data2 where column 1 issametext \mot2)}
71
 \text{indication2=\indication2[2]}
72
 \text{indication2=\indication2 issametext ? xxx}
73
 \text{mot=wims(append item \mot2 to \mot)}
74
 \matrix{indication=wims(append line \indication2 to \indication)}
75
}
76
\matrix{data3=\data3}
77
\text{mot3=wims(nonempty items \data3[;1])}
78
\text{mot3=items(\mot3)>=2 ? shuffle(\mot3)}
79
\text{mot3=\mot3[1]}
4734 bpr 80
\if{\mot3!=}{
4375 bpr 81
  \text{indication3=wims(select \data3 where column 1 issametext \mot3)}
82
  \text{indication3=\indication3[2]}
83
  \text{indication3=\indication3 issametext ? xxx}
84
  \text{mot=wims(append item \mot3 to \mot)}
85
  \matrix{indication=wims(append line \indication3 to \indication)}
86
}
87
 
88
\matrix{data4=\data4}
89
\text{mot4=wims(nonempty items \data4[;1])}
90
\text{mot4=items(\mot4)>=2 ? shuffle(\mot4)}
91
\text{mot4=\mot4[1]}
92
\if{\mot4!=}{
93
  \text{indication4=wims(select \data4 where column 1 issametext \mot4)}
94
  \text{indication4=\indication4[2]}
95
  \text{indication4=\indication4 issametext ? xxx}
4734 bpr 96
  \text{mot=wims(append item \mot4 to \mot)}
4375 bpr 97
  \matrix{indication=wims(append line \indication4 to \indication)}
98
}
99
 
100
\matrix{data5=\data5}
101
\text{mot5=wims(nonempty items \data5[;1])}
102
\text{mot5=items(\mot5)>=2 ? shuffle(\mot5)}
103
\text{mot5=\mot5[1]}
104
\if{\mot5!=}{
105
  \text{indication5=wims(select \data5 where column 1 issametext \mot5)}
106
  \text{indication5=\indication5[2]}
107
  \text{indication5=\indication5 issametext ? xxx}
4734 bpr 108
  \text{mot=wims(append item \mot5 to \mot)}
4375 bpr 109
  \matrix{indication=wims(append line \indication5 to \indication)}
110
}
111
 
112
\integer{N1=items(\mot)}
113
\text{bat=shuffle(\N1)}
114
\integer{N=min(\N1,\N)}
115
 
116
\text{mot=\mot[\bat]}
117
\matrix{indication=\indication[\bat;]}
118
\text{mot1=wims(text expand \mot[1] using 01)}
119
\text{mot1=wims(words2items \mot1)}
5271 bpr 120
\text{mot1=wims(replace internal _ by &nbsp; in \mot1)}
4375 bpr 121
 
122
\text{mot2=wims(text expand \mot[2] using 01)}
123
\text{mot2=wims(words2items \mot2)}
5271 bpr 124
\text{mot2=wims(replace internal _ by &nbsp; in \mot2)}
4375 bpr 125
 
126
\text{mot3=wims(text expand \mot[3] using 01)}
127
\text{mot3=wims(words2items \mot3)}
5271 bpr 128
\text{mot3=wims(replace internal _ by &nbsp; in \mot3)}
4375 bpr 129
 
130
\text{mot4=wims(text expand \mot[4] using 01)}
131
\text{mot4=wims(words2items \mot4)}
5271 bpr 132
\text{mot4=wims(replace internal _ by &nbsp; in \mot4)}
4375 bpr 133
 
134
\text{mot5=wims(text expand \mot[5] using 01)}
135
\text{mot5=wims(words2items \mot5)}
5271 bpr 136
\text{mot5=wims(replace internal _ by &nbsp; in \mot5)}
4375 bpr 137
\text{Mot=}
138
\text{STEP=wims(makelist r x for x=1 to \N)}
139
\text{STEP=r1}
140
\nextstep{\STEP}
141
 
142
\statement{
143
\for{a=1 to \step-1}{ 
144
  \if{\a <= \N}{
145
  <div style="font-size:large;padding:6px; margin-left:10px;wdith:50%;
5271 bpr 146
  border: 1px solid #555555;">\Mot[\a;]  
4375 bpr 147
  \if{ \indication[\a;] notsametext xxx }{ (\indication[\a;]) }</div>
148
  }
149
}
150
\if{\step <= \N}{
151
\instruction
152
<p>
153
<center>\embed{r \step,50 x 50} 
154
\if{ \indication[\step;] notsametext xxx }{
155
(<span style="font-size:large;">\indication[\step;]</span>) }
156
</center>
157
}
158
}
159
\answer{}{\mot1}{type=dragfill}{option=nonstop}
160
\answer{}{\mot2}{type=dragfill}{option=nonstop}
161
\answer{}{\mot3}{type=dragfill}{option=nonstop}
162
\answer{}{\mot4}{type=dragfill}{option=nonstop}
163
\answer{}{\mot5}{type=dragfill}{option=nonstop}
164
 
165
\text{Mot=\reply1
166
\reply2
167
\reply3
168
\reply4
169
\reply5}
170
\text{Mot=wims(replace , by in \Mot)}
171
\matrix{Mot=\Mot}
172
\text{STEP=\step <= \N ? r \step:}