!set title=Metal y no metal 4
!if $wims_read_parm!=$empty
 !goto $wims_read_parm
!endif
oef2wims_version=3.22
language=en
author=XIAO Gang
email=xiao@unice.fr

ansorder=r,r
varcnt=47
prevarcnt=33
postvarcnt=13
replycnt=2
choicecnt=0
conditioncnt=4
feedbackcnt=0
format=html

val1=$imagedir
val2=$confparm1
val3=$confparm2
val4=$confparm3
val5=$confparm4

!if $testcondition=yes
 !goto test
!endif
!if $status=waiting
 !exit
!endif

tmp0=!record 0 of table

val6=$(tmp0)
tmp=!translate internal $	$ to ; in $val6

tmp0=!rowcnt $tmp
val7=$[rint($(tmp0))]

!ifval $val2 notitemof 1,2,3,4
val2=$[rint(0)]
!endif

!ifval $val3 notitemof 1,2,3,4
val3=$[rint(0)]
!endif
val8=

!ifval $val4 issametext $val8 or $val4<7 or	 $val4>$val7
val4=$[rint(54)]
!endif
tmp0=!values x for x=1 to $val7

val9=$(tmp0)
tmp0=!listintersect $val5 and $val9

val5=$(tmp0)

!ifval $val2>0
val10=$[rint($val2)]
!else
tmp0=!randint 1, 4

val10=$[rint($(tmp0))]
!endif

!ifval $val3=$val2
val11=$[rint(0)]
!else
val11=$[rint($val3)]
!endif
tmp0=!listcomplement $val10 in 1,2,3,4

val12=$(tmp0)

!ifval \candouble issametext yes and $val10 != 1
val12=$val10,$val12
!endif

!ifval $val11>0 and $val11 isitemof $val12
val13=$[rint($val11)]
!else
tmp=!nonempty items $val12

tmp0=!randitem $tmp
val13=$[rint($(tmp0))]
!endif
tmp0=!record 0 of position

val14=$(tmp0)
val15=$val14
val8=
!if $val5 notsametext $val8 and \selective notsametext no 
tmp=!translate internal $	$ to ; in $val15

tmp=!row $val5 of $tmp
tmp0=!translate internal $\
$ to ; in $tmp
val15=$(tmp0)
!endif
tmp=!translate internal $	$ to ; in $val15

tmp=!column 3 of $tmp
tmp0=!translate internal $\
$ to ; in $tmp
val16=$(tmp0)
tmp=!translate internal $	$ to ; in $val15

tmp=!column 2 of $tmp
tmp0=!translate internal $\
$ to ; in $tmp
val17=$(tmp0)
tmp=!translate internal $	$ to ; in $val15

tmp0=!rowcnt $tmp
val18=$[rint(min($val4,$(tmp0)))]
val19=$[rint(4)]
tmp0=!item $val19 of 1,1,1,1,2,2,2,2,3,3,3,3,4,4

val20=$[rint($(tmp0))]
tmp0=!randint $val20, $val19-$val20

val21=$[rint($(tmp0))]
val22=$[rint($val19-$val20+1)]

!ifval $val10 notitemof 2,3
tmp=!nonempty items 2,3

tmp0=!randitem $tmp
val10=$(tmp0)
!endif
tmp0=!item $val10-1 of 50,100

val23=$[rint($(tmp0))]
tmp0=!select $val15 where column 5 isitemof 2,3,7

tmp=!translate internal $	$ to ; in $(tmp0)

tmp=!column 1 of $tmp
tmp1=!translate internal $\
$ to ; in $tmp
val24=$(tmp1)
tmp0=!select $val15 where column 5 notitemof 2,3,7

tmp=!translate internal $	$ to ; in $(tmp0)

tmp=!column 1 of $tmp
tmp1=!translate internal $\
$ to ; in $tmp
val25=$(tmp1)
val24=$(val6[$val24;$val10])
val25=$(val6[$val25;$val10])
tmp0=!shuffle $val24

tmp1=!item 1 to $val21 of $(tmp0)

val24=$(tmp1)
tmp0=!shuffle $val25

tmp1=!item 1 to $val19-$val21 of $(tmp0)

val25=$(tmp1)
val26=$(val23[])x30x$val22
replytype1=dragfill
replyname1=Metals
replygood1=?analyze 27;$val24
replytype2=dragfill
replyname2=Non-metals
replygood2=?analyze 28;$val25
question=__EXECUTED_1692754_EXERCISE__

!goto stat

!exit

:question
$()Clasifica los elementos mostrados más abajo en "metales" y	"no metales".	<p>	Metales:  
!read oef/embed.phtml reply 1,$val26 
$()	<p>	No metales:  
!read oef/embed.phtml reply 2,$val26 
$()	
$()
!exit

:hint
$()
$()
!exit

:help
$()
$()
!exit

:solution
$()
$()
!exit

:postdef
val29=$val27,$val28
tmp0=!listcomplement $val29 in $val24,$val25

val30=$(tmp0)
val29=$val29,$val30
val31=
val32=
!for val33 =1 to $val19 
val34=$(val29[$val33])
!if $val34 isitemof $val27 
val31=$val31 a metal,

!ifval $val34 isitemof $val24
val32=$val32 1,
!else
val32=$val32 0,
!endif
!else
!if $val34 isitemof $val28 
val31=$val31 a non-metal,

!ifval $val34 isitemof $val25
val32=$val32 1,
!else
val32=$val32 0,
!endif
!else
val31=$val31 neighther metal nor non-metal,
val32=$val32 0,
!endif
!endif
!next

!exit

:feedback

!exit

:test

!ifval $(val32[1])=1
 condtest1=1
!else
 condtest1=0
!endif
condname1=$(val29[1]) is $(val31[1])

!ifval $(val32[2])=1
 condtest2=1
!else
 condtest2=0
!endif
condname2=$(val29[2]) is $(val31[2])

!ifval $(val32[3])=1
 condtest3=1
!else
 condtest3=0
!endif
condname3=$(val29[3]) is $(val31[3])

!ifval $(val32[4])=1
 condtest4=1
!else
 condtest4=0
!endif
condname4=$(val29[4]) is $(val31[4])

!exit

:stat
vsavelist=19,24,25,26,27,28
embedcnt=2
