Subversion Repositories wimsdev

Rev

Rev 15179 | Blame | Compare with Previous | Last modification | View Log | RSS feed

type=order
textarea="instruction data1 data2 data3 data4 data5"
iEdit="instruction"

:Mix of letters
<p>Make a word with letters. Up to 5 word lists can be entered.
   A random word in each list is taken each time.
   An indication can be made for each word.</p>
<p><span class="wims_warning">$wims_name_warning</span>.
  You must verify that other words are not feasible with the same letters
  or put an indication that allows differentiation.</p>
<p>Author of the model: <a href="mailto:bernadette.m.riou@orange.fr">Bernadette Perrin-Riou</a></p>
:%%%%%%%%%%%%%%%%%      ATTENTION      %%%%%%%%%%%%%%%%%%%%

Remove the above header if you destroy the model tags! (The lines starting
with a ':'.) Otherwise the exercise might not be taken back by Createxo.

:%%%%%%%% Sample parameters to be redefined %%%%%%%%%%%%%%%%%

:\title{Make a word with letters}
:\author{Bernadette, Perrin-Riou}
:\email{bpr@math.u-psud.fr}
:\credits{}

:Instructions
\text{instruction=Compose a word with all the proposed letters.}

:Number of words (maximum 5)
The number of words must be less than 5
 and less than the number of lists completed below.
\integer{N=3}

:First word list
Put a word (or group of words) per line, possibly followed by an indication.
If it is a group of words, replace the space with <span class="tt">_</span>.
\text{data1=tree, a plant
domino, a game}

:Second word list
\text{data2=child
mother
father}

:Third word list
\text{data3=house
building
villa
dwelling
}

:Fourth word list
\text{data4=}

:Fifth word list
\text{data5=}

:%%%%%%%%%%%%%% Nothing to modify until statement %%%%%%%%%%%%%%%%
\css{<style>
  .word_jumble{
    font-size:large;
    padding:6px;
    margin-left:10px;
    border: 1px solid #555;
  }</style>}

\matrix{data1=\data1}
\text{mot1=wims(nonempty items \data1[;1])}
\text{mot1=items(\mot1)>=2 ? shuffle(\mot1)}
\text{mot1=\mot1[1]}
\text{indication1=wims(select \data1 where column 1 issametext \mot1)}
\text{indication1=\indication1[2]}
\text{indication1=\indication1 issametext ? xxx}
\text{mot=\mot1}
\matrix{indication=\indication1}
\matrix{data2=\data2}
\text{mot2=wims(nonempty items \data2[;1])}
\text{mot2=items(\mot2)>=2 ? shuffle(\mot2)}
\text{mot2=\mot2[1]}
\if{\mot2!=}{
  \text{indication2=wims(select \data2 where column 1 issametext \mot2)}
  \text{indication2=\indication2[2]}
  \text{indication2=\indication2 issametext ? xxx}
  \text{mot=wims(append item \mot2 to \mot)}
  \matrix{indication=wims(append line \indication2 to \indication)}
}

\matrix{data3=\data3}
\text{mot3=wims(nonempty items \data3[;1])}
\text{mot3=items(\mot3)>=2 ? shuffle(\mot3)}
\text{mot3=\mot3[1]}
\if{\mot3!=}{
  \text{indication3=wims(select \data3 where column 1 issametext \mot3)}
  \text{indication3=\indication3[2]}
  \text{indication3=\indication3 issametext ? xxx}
  \text{mot=wims(append item \mot3 to \mot)}
  \matrix{indication=wims(append line \indication3 to \indication)}
}

\matrix{data4=\data4}
\text{mot4=wims(nonempty items \data4[;1])}
\text{mot4=items(\mot4)>=2 ? shuffle(\mot4)}
\text{mot4=\mot4[1]}
\if{\mot4!=}{
  \text{indication4=wims(select \data4 where column 1 issametext \mot4)}
  \text{indication4=\indication4[2]}
  \text{indication4=\indication4 issametext ? xxx}
  \text{mot=wims(append item \mot4 to \mot)}
  \matrix{indication=wims(append line \indication4 to \indication)}
}

\matrix{data5=\data5}
\text{mot5=wims(nonempty items \data5[;1])}
\text{mot5=items(\mot5)>=2 ? shuffle(\mot5)}
\text{mot5=\mot5[1]}
\if{\mot5!=}{
  \text{indication5=wims(select \data5 where column 1 issametext \mot5)}
  \text{indication5=\indication5[2]}
  \text{indication5=\indication5 issametext ? xxx}
  \text{mot=wims(append item \mot5 to \mot)}
  \matrix{indication=wims(append line \indication5 to \indication)}
}

\integer{N1=items(\mot)}
\text{bat=shuffle(\N1)}
\integer{N=min(\N1,\N)}

\text{mot=\mot[\bat]}
\matrix{indication=\indication[\bat;]}
\text{mot1=wims(text expand \mot[1] using 01)}
\text{mot1=wims(words2items \mot1)}
\text{mot1=wims(replace internal _ by &nbsp; in \mot1)}

\text{mot2=wims(text expand \mot[2] using 01)}
\text{mot2=wims(words2items \mot2)}
\text{mot2=wims(replace internal _ by &nbsp; in \mot2)}

\text{mot3=wims(text expand \mot[3] using 01)}
\text{mot3=wims(words2items \mot3)}
\text{mot3=wims(replace internal _ by &nbsp; in \mot3)}

\text{mot4=wims(text expand \mot[4] using 01)}
\text{mot4=wims(words2items \mot4)}
\text{mot4=wims(replace internal _ by &nbsp; in \mot4)}

\text{mot5=wims(text expand \mot[5] using 01)}
\text{mot5=wims(words2items \mot5)}
\text{mot5=wims(replace internal _ by &nbsp; in \mot5)}

\text{Mot=}
\text{STEP=wims(makelist r x for x=1 to \N)}
\text{STEP=r1}
\nextstep{\STEP}

::You don't need to modify this in general.

\statement{
  \for{a=1 to \step-1}{
    \if{\a <= \N}{
      <div class="word_jumble">\Mot[\a;]
      \if{ \indication[\a;] notsametext xxx }{<em class="indication">(\indication[\a;])</em>}</div>
    }
  }
  \if{\step <= \N}{
    <div class="instruction">\instruction</div>
    <div class="wimscenter">
      \embed{r \step,50 x 50}
      \if{ \indication[\step;] notsametext xxx }{
      <span class="indication">(\indication[\step;])</span> }
    </div>
  }
}

\answer{}{\mot1}{type=dragfill}{option=nonstop}
\answer{}{\mot2}{type=dragfill}{option=nonstop}
\answer{}{\mot3}{type=dragfill}{option=nonstop}
\answer{}{\mot4}{type=dragfill}{option=nonstop}
\answer{}{\mot5}{type=dragfill}{option=nonstop}

\text{Mot=\reply1
\reply2
\reply3
\reply4
\reply5}
\text{Mot=wims(replace , by in \Mot)}
\matrix{Mot=\Mot}
\text{STEP=\step <= \N ? r \step:}