%% This file is generated by preprocessor!
%% Do not edit it by hand.
%% Edit the source file cpp/metals.cpp.



\language{en}
\author{XIAO Gang}
\email{xiao@unice.fr}
\format{html}
\text{data=wims(record 0 of table)}
\integer{end=rows(\data)}
\integer{confparm1=\confparm1 notitemof 1,2,3,4?0}
\integer{confparm2=\confparm2 notitemof 1,2,3,4?0}
\text{empty=}
\integer{confparm3=\confparm3 issametext \empty or \confparm3<7 or
 \confparm3>\end?54}
\text{list=wims(values x for x=1 to \end)}
\text{confparm4=wims(listintersect \confparm4 and \list)}
\integer{given=\confparm1>0?\confparm1:randint(1..4)}
\integer{cp=\confparm2=\confparm1?0:\confparm2}
\text{remain=wims(listcomplement \given in 1,2,3,4)}
\text{remain=\candouble issametext yes and \given != 1?\given,\remain}
\integer{ask=\cp>0 and \cp isitemof \remain?\cp:randitem(\remain)}
\title{Metal y no metal 10}
\text{Pdata=wims(record 0 of position)}
\text{pdata=\Pdata}
\text{empty=}
\if{\confparm4 notsametext \empty and \selective notsametext no}{
 \text{pdata=row(\confparm4,\pdata)}
}
\text{totname=column(3,\pdata)}
\text{totsymbole=column(2,\pdata)}
\integer{pdatacnt=min(\confparm3,rows(\pdata))}
\integer{tot=10}
\integer{beg=item(\tot,1,1,1,1,2,2,2,2,3,3,3,3,4,4)}
\integer{cut=random(\beg..\tot-\beg)}
\integer{length=\tot-\beg+1}
\text{given=\given notitemof 2,3?randitem(2,3)}
\integer{xsize=item(\given-1,50,100)}
\text{metals=column(1,wims(select \pdata where column 5 isitemof 2,3,7))}
\text{nonmetals=column(1,wims(select \pdata where column 5 notitemof 2,3,7))}
\text{metals=\data[\metals;\given]}
\text{nonmetals=\data[\nonmetals;\given]}
\text{metals=item(1..\cut,shuffle(\metals))}
\text{nonmetals=item(1..\tot-\cut,shuffle(\nonmetals))}
\text{size=\xsize[]x30x\length}
\statement{Clasifica los elementos mostrados más abajo en "metales" y
"no metales".
<p>
Metales: \embed{reply 1,\size}
<p>
No metales: \embed{reply 2,\size}
}
\answer{Metals}{\rmet;\metals}{type=dragfill}
\answer{Non-metals}{\rnon;\nonmetals}{type=dragfill}
\text{totans=\rmet,\rnon}
\text{noans=wims(listcomplement \totans in \metals,\nonmetals)}
\text{totans=\totans,\noans}
\text{clean=}
\text{check=}
\for{t=1 to \tot}{
 \text{ans=\totans[\t]}
 \if{\ans isitemof \rmet}{
  \text{clean=\clean a metal,}
  \text{check=\ans isitemof \metals?\check 1,:\check 0,}
 }{
  \if{\ans isitemof \rnon}{
   \text{clean=\clean a non-metal,}
   \text{check=\ans isitemof \nonmetals?\check 1,:\check 0,}
  }{
   \text{clean=\clean neighther metal nor non-metal,}
   \text{check=\check 0,}
  }
 }
}
\condition{\totans[1] is \clean[1]}{\check[1]=1}
\condition{\totans[2] is \clean[2]}{\check[2]=1}
\condition{\totans[3] is \clean[3]}{\check[3]=1}
\condition{\totans[4] is \clean[4]}{\check[4]=1}
\condition{\totans[5] is \clean[5]}{\check[5]=1}
\condition{\totans[6] is \clean[6]}{\check[6]=1}
\condition{\totans[7] is \clean[7]}{\check[7]=1}
\condition{\totans[8] is \clean[8]}{\check[8]=1}
\condition{\totans[9] is \clean[9]}{\check[9]=1}
\condition{\totans[10] is \clean[10]}{\check[10]=1}
