checkfile=$checkdir/multiplechoice.proc
!if $questiontype=0
    questiontype=1
!endif
!set n=$counter
image=0
multiimage=0
R=$counter
soort=!randitem 0,1
keus=!randitem 0,1
    
!if $soort=1
    Domein=!record 14 of lang/remarks.$taal
    x=x
    !if $keus=1
	DB=D_f \,:\,
    !else
	DB=D_f \,=\,
    !endif
!else
    Domein=!record 15 of lang/remarks.$taal
    x=y
    !if $keus=1
	DB=B_f \,:\,
    !else
	DB=B_f \,=\,	
    !endif    
!endif
    
txt1=!record 16 of lang/remarks.$taal
# De schrijfwijzen voor Domein en Bereik.
txt2=!record 17 of lang/remarks.$taal
question$n=$txt1<p>$txt2<p><p align=center>
helptext=$empty
# Welke schrijfwijze voor het <tt>$Domein</tt> komt overeen met?
records=!shuffle 1,2,3,4,5,6,7,8
options=4

answer$n=!randint 1,$options
a=!randint -200,200
plus=!randint 1,200
b=$[$a+$plus]

!if $R=1
    !for p=1 to $options
	num=!item $p of $records
	vraag=!record $num of exos/lijst1.def
	!if $p=$(answer$n)
	    formula$n=!line 5 of $vraag
	    formula$n=$DB $(formula$n)
	    ex$p=!line 1 of $vraag
	    texanswer$n=$(ex$p)
	!else
	    keuze=!randitem 1,2,3,4
	    ex$p=!line $keuze of $vraag
	!endif
	ex$p=$DB $(ex$p)
    !next p
    !exit
!endif

!if $R=2
    !for p=1 to $options
	num=!item $p of $records
	vraag=!record $num of exos/lijst1.def
	!if $p=$(answer$n)
	    formula$n=!line 1 of $vraag
	    formula$n=$DB $(formula$n)
	    ex$p=!line 5 of $vraag
	    texanswer$n=$(ex$p)
	!else
	    keuze=!randitem 5,6,7,8
	    ex$p=!line $keuze of $vraag
	!endif
	ex$p=$DB $(ex$p)
    !next p
    !exit
!endif

!if $R>2
    options=!randitem 5,6,7,8
    k=!randitem 1,2
    !if $k=1
	!for p=1 to $options
	    num=!item $p of $records
	    vraag=!record $num of exos/lijst1.def
	    !if $p=$(answer$n)
		formula$n=!line 5 of $vraag
		formula$n=$DB $(formula$n)
		ex$p=!line 1 of $vraag
		texanswer$n=$(ex$p)
	    !else
		keuze=!randitem 1,2,3,4
		ex$p=!line $keuze of $vraag
	    !endif
	    ex$p=$DB $(ex$p)
	!next p
    !else
	!for p=1 to $options
	    num=!item $p of $records
	    vraag=!record $num of exos/lijst1.def
	    vraag=!replace internal @ by , in $vraag
    	    !if $p=$(answer$n)
		formula$n=!line 1 of $vraag
		formula$n=$DB $(formula$n)
		ex$p=!line 5 of $vraag
		texanswer$n=$(ex$p)
	    !else
		keuze=!randitem 5,6,7,8
		ex$p=!line $keuze of $vraag
	    !endif
	    ex$p=$DB $(ex$p)
	!next p
    !endif
    !exit
!endif

