Subversion Repositories wimsdev

Rev

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

Rev Author Line No. Line
11375 bpr 1
type=order
4375 bpr 2
textarea="data1 data2 data3 data4 data5"
3
 
13477 obado 4
:Mix of letters
5
<p>Make a word with letters. Up to 5 word lists can be entered.
6
   A random word in each list is taken each time.
7
   An indication can be made for each word.</p>
11544 obado 8
<p><span class="wims_warning">$wims_name_warning</span>.
13477 obado 9
  You must verify that other words are not feasible with the same letters
10
  or put an indication that allows differentiation.</p>
11544 obado 11
<p>Author of the model: Bernadette Perrin-Riou <bpr@math.u-psud.fr></p>
4375 bpr 12
:%%%%%%%%%%%%%%%%%      ATTENTION      %%%%%%%%%%%%%%%%%%%%
13
 
11544 obado 14
Remove the above header if you destroy the model tags! (The lines starting
15
with a ':'.) Otherwise the exercise might not be taken back by Createxo.
4375 bpr 16
 
11544 obado 17
:%%%%%%%% Sample parameters to be redefined %%%%%%%%%%%%%%%%%
4375 bpr 18
 
13477 obado 19
:\title{Make a word with letters}
5147 bpr 20
:\author{Bernadette, Perrin-Riou}
4375 bpr 21
:\email{bpr@math.u-psud.fr}
5724 bpr 22
:\credits{}
4375 bpr 23
 
13477 obado 24
:Instructions
25
\text{instruction=Compose a word with all the proposed letters.}
4375 bpr 26
 
27
:Nombre de mots (au maximum 5)
28
Le nombre de mots doit être inférieur à 5 et inférieur au nombre de listes
29
remplies ci-dessous.
30
\integer{N=3}
31
 
13477 obado 32
:First word list
33
Put a word (or group of words) per line, possibly followed by an indication.
34
If it is a group of words, replace the space with <span class="tt">_</span>.
35
\text{data1=tree, a plant
36
domino, a game}
37
 
38
:Second word list
39
\text{data2=child
40
mother
13481 obado 41
father}
13477 obado 42
 
43
:Third word list
44
\text{data3=house
45
building
4375 bpr 46
villa
13477 obado 47
dwelling
4375 bpr 48
}
13477 obado 49
 
50
:Fourth word list
4375 bpr 51
\text{data4=}
13477 obado 52
 
53
:Fifth word list
4375 bpr 54
\text{data5=}
55
 
11544 obado 56
:%%%%%%%%%%%%%% Nothing to modify until statement %%%%%%%%%%%%%%%%
13481 obado 57
\css{<style type="text/css">
58
  .word_jumble{
59
    font-size:large;
60
    padding:6px;
61
    margin-left:10px;
62
    border: 1px solid #555;
63
  }</style>}
64
 
4375 bpr 65
\matrix{data1=\data1}
66
\text{mot1=wims(nonempty items \data1[;1])}
67
\text{mot1=items(\mot1)>=2 ? shuffle(\mot1)}
68
\text{mot1=\mot1[1]}
69
\text{indication1=wims(select \data1 where column 1 issametext \mot1)}
70
\text{indication1=\indication1[2]}
71
\text{indication1=\indication1 issametext ? xxx}
72
\text{mot=\mot1}
73
\matrix{indication=\indication1}
74
\matrix{data2=\data2}
75
\text{mot2=wims(nonempty items \data2[;1])}
76
\text{mot2=items(\mot2)>=2 ? shuffle(\mot2)}
77
\text{mot2=\mot2[1]}
4734 bpr 78
\if{\mot2!=}{
4375 bpr 79
 \text{indication2=wims(select \data2 where column 1 issametext \mot2)}
80
 \text{indication2=\indication2[2]}
81
 \text{indication2=\indication2 issametext ? xxx}
82
 \text{mot=wims(append item \mot2 to \mot)}
83
 \matrix{indication=wims(append line \indication2 to \indication)}
84
}
85
\matrix{data3=\data3}
86
\text{mot3=wims(nonempty items \data3[;1])}
87
\text{mot3=items(\mot3)>=2 ? shuffle(\mot3)}
88
\text{mot3=\mot3[1]}
4734 bpr 89
\if{\mot3!=}{
4375 bpr 90
  \text{indication3=wims(select \data3 where column 1 issametext \mot3)}
91
  \text{indication3=\indication3[2]}
92
  \text{indication3=\indication3 issametext ? xxx}
93
  \text{mot=wims(append item \mot3 to \mot)}
94
  \matrix{indication=wims(append line \indication3 to \indication)}
95
}
96
 
97
\matrix{data4=\data4}
98
\text{mot4=wims(nonempty items \data4[;1])}
99
\text{mot4=items(\mot4)>=2 ? shuffle(\mot4)}
100
\text{mot4=\mot4[1]}
101
\if{\mot4!=}{
102
  \text{indication4=wims(select \data4 where column 1 issametext \mot4)}
103
  \text{indication4=\indication4[2]}
104
  \text{indication4=\indication4 issametext ? xxx}
4734 bpr 105
  \text{mot=wims(append item \mot4 to \mot)}
4375 bpr 106
  \matrix{indication=wims(append line \indication4 to \indication)}
107
}
108
 
109
\matrix{data5=\data5}
110
\text{mot5=wims(nonempty items \data5[;1])}
111
\text{mot5=items(\mot5)>=2 ? shuffle(\mot5)}
112
\text{mot5=\mot5[1]}
113
\if{\mot5!=}{
114
  \text{indication5=wims(select \data5 where column 1 issametext \mot5)}
115
  \text{indication5=\indication5[2]}
116
  \text{indication5=\indication5 issametext ? xxx}
4734 bpr 117
  \text{mot=wims(append item \mot5 to \mot)}
4375 bpr 118
  \matrix{indication=wims(append line \indication5 to \indication)}
119
}
120
 
121
\integer{N1=items(\mot)}
122
\text{bat=shuffle(\N1)}
123
\integer{N=min(\N1,\N)}
124
 
125
\text{mot=\mot[\bat]}
126
\matrix{indication=\indication[\bat;]}
127
\text{mot1=wims(text expand \mot[1] using 01)}
128
\text{mot1=wims(words2items \mot1)}
5271 bpr 129
\text{mot1=wims(replace internal _ by &nbsp; in \mot1)}
4375 bpr 130
 
131
\text{mot2=wims(text expand \mot[2] using 01)}
132
\text{mot2=wims(words2items \mot2)}
5271 bpr 133
\text{mot2=wims(replace internal _ by &nbsp; in \mot2)}
4375 bpr 134
 
135
\text{mot3=wims(text expand \mot[3] using 01)}
136
\text{mot3=wims(words2items \mot3)}
5271 bpr 137
\text{mot3=wims(replace internal _ by &nbsp; in \mot3)}
4375 bpr 138
 
139
\text{mot4=wims(text expand \mot[4] using 01)}
140
\text{mot4=wims(words2items \mot4)}
5271 bpr 141
\text{mot4=wims(replace internal _ by &nbsp; in \mot4)}
4375 bpr 142
 
143
\text{mot5=wims(text expand \mot[5] using 01)}
144
\text{mot5=wims(words2items \mot5)}
5271 bpr 145
\text{mot5=wims(replace internal _ by &nbsp; in \mot5)}
4375 bpr 146
\text{Mot=}
147
\text{STEP=wims(makelist r x for x=1 to \N)}
148
\text{STEP=r1}
149
\nextstep{\STEP}
150
 
11544 obado 151
::You don't need to modify this in general.
152
 
4375 bpr 153
\statement{
13481 obado 154
  <div class="spacer">
155
  \for{a=1 to \step-1}{
156
    \if{\a <= \N}{
157
    <span class="word_jumble">
158
      \Mot[\a;]
159
      \if{ \indication[\a;] notsametext xxx }{ <em class="indication">(\indication[\a;])</em>}
160
    </span>
161
    }
4375 bpr 162
  }
13481 obado 163
  </div>
164
  \if{\step <= \N}{
165
    <p class="instruction">\instruction</p>
166
    <div class="wimscenter">
167
      \embed{r \step,50 x 50}
168
      \if{ \indication[\step;] notsametext xxx }{
169
        (<span class="indication">\indication[\step;]</span>)
170
      }
171
    </div>
172
  }
4375 bpr 173
}
11544 obado 174
 
4375 bpr 175
\answer{}{\mot1}{type=dragfill}{option=nonstop}
176
\answer{}{\mot2}{type=dragfill}{option=nonstop}
177
\answer{}{\mot3}{type=dragfill}{option=nonstop}
178
\answer{}{\mot4}{type=dragfill}{option=nonstop}
179
\answer{}{\mot5}{type=dragfill}{option=nonstop}
180
 
181
\text{Mot=\reply1
182
\reply2
183
\reply3
184
\reply4
185
\reply5}
186
\text{Mot=wims(replace , by in \Mot)}
187
\matrix{Mot=\Mot}
188
\text{STEP=\step <= \N ? r \step:}