!set titb=??
!set keyw=
!set datm=20050122
!set prev=
!set next=
!set upbl=cpp
!set dat1=19000101
!set dat2=24000101

!if $wims_read_parm!=$empty
 !goto $wims_read_parm
!endif

!exit

:content
L'exercice pour fonctionner demande qu'il 
ait été créé des fichiers <tt class="e">tableau_et</tt>, <tt class="e">tableau_ou</tt>... 
<p>
<pre class="fichier">
<div class="variable">
<tt class="d">target= et_est ou_ou la_la</tt>
<p>
<tt class="d">#if #TARGET(et_est)</tt>
 \title{Choix et/est}
 \text{Type=tableau_et}
<tt class="d">#endif</tt>
<p>
<tt class="d">#if #TARGET(ou_ou)</tt>
\title{Choix ou/où}
 \text{Type=tableau_ou}
<tt class="d">#endif</tt>
<p>
<tt class="d">#if #TARGET(la_la)</tt>
\title{Choix la/là/l'a}
 \text{Type=tableau_la}
<tt class="d">#endif</tt>
<p>
\language{fr}
\author{Jean-Baptiste Frondas}
\email{ambali@free.fr}
\computeanswer{no}
\format{html}
<p>
\text{tableau = wims(record 0 of \Type)}
\text{a = randomrow(\tableau)}
teste si le premier champ est une question
\text{testa= wims(nospace \a)}
\text{first = wims(replace internal ? by | in wims(char 1 of \testa))}
\text{u= \first issametext | ? 1 &#58; 0}
\text{u1 = \u = 0 ? -1&#58;1} 
\matrix{A = slib(text/cutchoices \a)}
\text{cntrow = rows(\A)}
\integer{cntQ = (\cntrow+\u1*\cntrow%2)/2}
\matrix{good1 = }
\text{rep = }
\for{i= 1 to \cntQ}{
  \text{good=\A[2*\i -\u;]}
  \text{cnt = items(\good)}
  \text{mix = shuffle(\cnt)}
  \matrix{good1=\good1
  \good[\mix]}
  \text{rep = \rep, position(1,\mix)}
}
\text{rep =wims(nonempty items \rep)}
\text{STEP = wims(makelist r x for x = 1 to \cntQ)}
\steps{\STEP}
</div>
<div class="statement">
\statement{
&lt;p style="text-align &#58; center;
background-color &#58; #FFFFFF;
padding &#58; 1%;
margin &#58; 5% 15%; ">
<p>
\for{k = 1 to \cntQ}{
    \A[2*\k-1-\u;]  \embed{r \k}
}
   \A[2*\cntQ+1-\u;]
&lt;p/>}
</div>
<p>
<div class="variable">
\answer{}{\rep[1];\good1[1;]}{type=menu}
\answer{}{\rep[2];\good1[2;]}{type=menu}
\answer{}{\rep[3];\good1[3;]}{type=menu}
\answer{}{\rep[4];\good1[4;]}{type=menu}
\answer{}{\rep[5];\good1[5;]}{type=menu}
\answer{}{\rep[6];\good1[6;]}{type=menu}
\answer{}{\rep[7];\good1[7;]}{type=menu}
\answer{}{\rep[8];\good1[8;]}{type=menu}
<p>
</div>
</pre>
