# Lees een boxplot
n=$counter
!if $level=0
    R=$counter
!else
    R=$level
!endif
checkfile=exos/checkfile10.proc
mathview=0
showmath=0
math=0
questiontype=0
helptext=$empty
image=1
draw=1
rows=1
XSIZE=600
YSIZE=200
delta=2
vline=$empty
hline=$empty
vtext=$empty
inputs=6

!if $R>0
    getal=!randitem 40,50,60
    xmin=!randint 1,$getal
    xmin=4
    xmin=10*(floor($xmin/10))
    d1=!randint 1,$getal
    d2=!randint 1,$getal
    d3=!randint 1,$getal
    d4=!randint 1,$getal
    d5=!randint 1,$getal
    d6=!randint 1,$getal
    x1=!randint $xmin,$d1
    x2=$[$x1+$d2]
    x3=$[$x2+$d3]
    x4=$[$x3+$d4]
    x5=$[$x4+$d5]
    xmax=$[$x5+$d6]
    xmax=$[10*(ceil($xmax/10))]
    step1=$[10*(round(($xmax-$xmin)/100))]
    step2=$[round($step1/2)]
    step3=$[round($step1/10)]
    spreidingsbreedte=$[$x5-$x1]
    answer$n=$x1,$x2,$x3,$x4,$x5
    var1=$[$xmin-$delta]
    var2=$[$xmax+$delta]
    !for p=$xmin to $xmax step $step3
	vline=!append line line $p,-1,$p,1,orange to $vline
    !next p
    !for p=$xmin to $xmax step $step2
	vline=!append line line $p,-1,$p,1.5,green to $vline
    !next p
    !for p=$xmin to $xmax step $step1
	vline=!append line line $p,-1,$p,2,blue to $vline
	vtext=!append line text black,$[$p-1.5],-0.5,huge,$p to $vtext
    !next p
    
    image$n=transparent white\
    xrange=$xmin-$delta,$xmax+$delta\
    yrange=-1,3\
    $vline\
    $vtext\
    linewidth 2\
    line $x5,1,$x5,3,black\
    line $x1,1,$x1,3,black\
    line $x1,2,$x2,2,black\
    line $x4,2,$x5,2,black\
    frect $x2,1,$x3,3,blue\
    frect $x3,1,$x4,3,red

    question$n=!record 61 of lang/remarks.$taal
    #@Lees uit de onderstaande boxplot af:
    textanswer$n=<ol>
    var1=!record 62 of lang/remarks.$taal
    #@Eerste kwartiel,Mediaan,Derde kwartiel,Spreidingsbreedte,Beginwaarde,Eindwaarde
    answer$n=$x2,$x3,$x4,$spreidingsbreedte,$x1,$x5
    !for p=1 to 6
	inputtext$p=!item $p of $var1
	aa=!item $p of $(answer$n)
	textanswer$n=!append line <li>$(inputtext$p) = $aa</li> to $(textanswer$n)
    !next p
    textanswer$n=$(textanswer$n)</ol>

 !exit
!endif
