Subversion Repositories wimsdev

Rev

Go to most recent revision | Details | 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 }
24
:\author{Bernadette Perrin-Riou}
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
36
Mettre un mot par ligne, suivi éventuellement d'une indication.
37
\text{data1=bille, un jeu
38
domino,un jeu}
39
:Seconde liste de mots
40
\text{data2=enfant
41
mère
42
père}
43
:Troisième liste de mots 
44
\text{data3=maison
45
immeuble
46
villa
47
habitation
48
}
49
:Quatrième liste de mots
50
\text{data4=}
51
:Cinquième liste de mots
52
\text{data5=}
53
 
54
:%%%%%%%%%%%%%% Rien à modifier avant l'énoncé %%%%%%%%%%%%%%%%
55
\matrix{data1=\data1}
56
\text{mot1=wims(nonempty items \data1[;1])}
57
\text{mot1=items(\mot1)>=2 ? shuffle(\mot1)}
58
\text{mot1=\mot1[1]}
59
\text{indication1=wims(select \data1 where column 1 issametext \mot1)}
60
\text{indication1=\indication1[2]}
61
\text{indication1=\indication1 issametext ? xxx}
62
\text{mot=\mot1}
63
\matrix{indication=\indication1}
64
\matrix{data2=\data2}
65
\text{mot2=wims(nonempty items \data2[;1])}
66
\text{mot2=items(\mot2)>=2 ? shuffle(\mot2)}
67
\text{mot2=\mot2[1]}
4734 bpr 68
\if{\mot2!=}{
4375 bpr 69
 \text{indication2=wims(select \data2 where column 1 issametext \mot2)}
70
 \text{indication2=\indication2[2]}
71
 \text{indication2=\indication2 issametext ? xxx}
72
 \text{mot=wims(append item \mot2 to \mot)}
73
 \matrix{indication=wims(append line \indication2 to \indication)}
74
}
75
\matrix{data3=\data3}
76
\text{mot3=wims(nonempty items \data3[;1])}
77
\text{mot3=items(\mot3)>=2 ? shuffle(\mot3)}
78
\text{mot3=\mot3[1]}
4734 bpr 79
\if{\mot3!=}{
4375 bpr 80
  \text{indication3=wims(select \data3 where column 1 issametext \mot3)}
81
  \text{indication3=\indication3[2]}
82
  \text{indication3=\indication3 issametext ? xxx}
83
  \text{mot=wims(append item \mot3 to \mot)}
84
  \matrix{indication=wims(append line \indication3 to \indication)}
85
}
86
 
87
\matrix{data4=\data4}
88
\text{mot4=wims(nonempty items \data4[;1])}
89
\text{mot4=items(\mot4)>=2 ? shuffle(\mot4)}
90
\text{mot4=\mot4[1]}
91
\if{\mot4!=}{
92
  \text{indication4=wims(select \data4 where column 1 issametext \mot4)}
93
  \text{indication4=\indication4[2]}
94
  \text{indication4=\indication4 issametext ? xxx}
4734 bpr 95
  \text{mot=wims(append item \mot4 to \mot)}
4375 bpr 96
  \matrix{indication=wims(append line \indication4 to \indication)}
97
}
98
 
99
\matrix{data5=\data5}
100
\text{mot5=wims(nonempty items \data5[;1])}
101
\text{mot5=items(\mot5)>=2 ? shuffle(\mot5)}
102
\text{mot5=\mot5[1]}
103
\if{\mot5!=}{
104
  \text{indication5=wims(select \data5 where column 1 issametext \mot5)}
105
  \text{indication5=\indication5[2]}
106
  \text{indication5=\indication5 issametext ? xxx}
4734 bpr 107
  \text{mot=wims(append item \mot5 to \mot)}
4375 bpr 108
  \matrix{indication=wims(append line \indication5 to \indication)}
109
}
110
 
111
\integer{N1=items(\mot)}
112
\text{bat=shuffle(\N1)}
113
\integer{N=min(\N1,\N)}
114
 
115
\text{mot=\mot[\bat]}
116
\matrix{indication=\indication[\bat;]}
117
\text{mot1=wims(text expand \mot[1] using 01)}
118
\text{mot1=wims(words2items \mot1)}
119
 
120
\text{mot2=wims(text expand \mot[2] using 01)}
121
\text{mot2=wims(words2items \mot2)}
122
 
123
\text{mot3=wims(text expand \mot[3] using 01)}
124
\text{mot3=wims(words2items \mot3)}
125
 
126
\text{mot4=wims(text expand \mot[4] using 01)}
127
\text{mot4=wims(words2items \mot4)}
128
 
129
\text{mot5=wims(text expand \mot[5] using 01)}
130
\text{mot5=wims(words2items \mot5)}
131
 
132
\text{Mot=}
133
\text{STEP=wims(makelist r x for x=1 to \N)}
134
\text{STEP=r1}
135
\nextstep{\STEP}
136
 
137
\statement{
138
\for{a=1 to \step-1}{ 
139
  \if{\a <= \N}{
140
  <div style="font-size:large;padding:6px; margin-left:10px;wdith:50%;
141
  border : 1px solid #555555;">\Mot[\a;]  
142
  \if{ \indication[\a;] notsametext xxx }{ (\indication[\a;]) }</div>
143
  }
144
}
145
\if{\step <= \N}{
146
\instruction
147
<p>
148
<center>\embed{r \step,50 x 50} 
149
\if{ \indication[\step;] notsametext xxx }{
150
(<span style="font-size:large;">\indication[\step;]</span>) }
151
</center>
152
}
153
}
154
\answer{}{\mot1}{type=dragfill}{option=nonstop}
155
\answer{}{\mot2}{type=dragfill}{option=nonstop}
156
\answer{}{\mot3}{type=dragfill}{option=nonstop}
157
\answer{}{\mot4}{type=dragfill}{option=nonstop}
158
\answer{}{\mot5}{type=dragfill}{option=nonstop}
159
 
160
\text{Mot=\reply1
161
\reply2
162
\reply3
163
\reply4
164
\reply5}
165
\text{Mot=wims(replace , by in \Mot)}
166
\matrix{Mot=\Mot}
167
\text{STEP=\step <= \N ? r \step:}