!set titb=Exemple de source sans slib
!set keyw=
!set datm=20050430
!set prev=
!set next=
!set upbl=mark
!set dat1=19000101
!set dat2=24000101


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

:content

!read primitives.phtml 1, embed, definition, &nbsp; 

<pre class="cc">
<div class="variable">
$m_title{Marquer les articles}
$m_text{cnt_record = $m_wims($m_recordcnt datamark)}
$m_text{H = $m_randint(\cnt_record)}
$m_text{texte = $m_randrow($m_wims($m_record 0 of datamark))}
$m_text{texte = $m_wims($m_embraced randitem \texte)}
$m_text{test = $m_wims($m_char 1 <tt class="w">to</tt> 2 of $m_wims($m_replace $m_internal ?? $m_by || <tt class="w">in</tt> \texte))}
$m_text{u = \test $m_issametext || ? 1&#58; 0}
$m_matrix{texte = $m_slib(text/cutchoices \texte)}
$m_text{cntrow = $m_rows(\texte)}
$m_text{TEXTE = }
$m_text{rep = }
$m_text{cnt = 0}
$m_text{texte = $m_wims($m_replace $m_internal , $m_by XXX <tt class="w">in</tt> \texte)}
<tt class="comm">\for</tt>{i = 1 <tt class="w">to</tt> \cntrow}{
  $m_text{H = \texte[\i;]}
  $m_text{cnt_w=$m_wims(wordcnt \H)}
  $m_text{j = \i%2}
  $m_text{rep = \j = \u ? \rep, $m_wims($m_values \cnt + x <tt class="w">for</tt> x = 1 <tt class="w">to</tt> \cnt_w)}
  $m_integer{cnt = \cnt+\cnt_w}
  $m_text{TEXTE = \TEXTE, $m_wims($m_words2items \H)}
}
</div>
</pre>
<div class="aide">Ce qui précède remplace les mots du texte par des item, et calcule la
position des mots qu'il sera demandé de sélectionner, c'est-à-dire des mots se 
trouvant entre les points d'interrogation
</div>
<pre class="cc">
<div class="variable">
$m_text{TEXTE = $m_wims($m_nonempty <tt class="w">items</tt> \TEXTE)}
$m_text{TEXTE1 = $m_wims($m_replace $m_internal XXX $m_by  <tt class="w">in</tt> \TEXTE)} 
$m_text{rep = $m_wims($m_nonempty <tt class="w">items</tt> \rep)}
</div>
<div class="statement">
$m_statement{
&lt;p style="background-color &#58; #AAFFFF;
padding &#58; 1%;
margin &#58; 5% 15%;"> 
<tt class="comm">\for</tt>{k = 1 <tt class="w">to</tt> \cnt}{
   <tt class="comm">\if</tt>{XXX isin \TEXTE[\k]}{
       <tt class="comm">\embed</tt>{<tt class="reply">reply1</tt>,\k},
       }{<tt class="comm">\embed</tt>{<tt class="reply">reply1</tt>,\k}
       }
   }
}
</div>
<div class="variable">
$m_answer{}{\rep;\TEXTE1}{<tt class="type">type=mark</tt>}{<tt class="type">option=split</tt>}
</div>
</pre>

