n=$counter
!if $level=0
    R=$counter
!else
    R=$level
!endif
!if $rounding<10
    rounding=0
    !readproc $remarkdir/rounding.$taal
!endif
questiontype=0
checkfile=$checkdir/number.proc
arglist=x
varlist=$empty
cols=10
rows=5
question$n=!record 3 of lang/remarks.$taal
exotext=!record 19 of lang/remarks.$taal
exotext=<small>$exotext</small>
lijn=!record 4 of lang/remarks.$taal

!if $R = 1
    a=!randitem 2,3,4,5,6,7,8,9,10
    b=!randitem 0,1,2,3,4,5,6,7,8,9,10
    c=!randitem 0,1,2,3,4,5,6,7,8,9,10
!endif
!if $R = 2
    a=!randitem 2,3,4,5,6,7,8,9,10
    b=!randitem 0,1,2,3,4,5,6,7,8,9,10
    c=!randitem 0,1,2,3,4,5,6,7,8,9,10
    pm1=!randitem -1,1
    pm2=!randitem -1,1
    pm3=!randitem -1,1
    a=$[$pm1*$a]
    b=$[$pm2*$b]
    c=$[$pm3*$c]
!endif
!if $R = 3
    a1=!randitem 2,3,4,5,6,7,8,9,10
    b1=!randitem 0,1,2,3,4,5,6,7,8,9,10
    c1=!randitem 0,1,2,3,4,5,6,7,8,9,10
    a2=!randitem 2,3,4,5,6,7,8,9,10
    b2=!randitem 1,2,3,4,5,6,7,8,9,10    
    c2=!randitem 1,2,3,4,5,6,7,8,9,10
    a=$a1/$a2
    b=$c1/$c2
    c=$c1/$c2
!endif
!if $R >3
    a1=!randitem 2,3,4,5,6,7,8,9,10
    b1=!randitem 0,1,2,3,4,5,6,7,8,9,10
    c1=!randitem 0,1,2,3,4,5,6,7,8,9,10
    a2=!randitem 2,3,4,5,6,7,8,9,10
    b2=!randitem 1,2,3,4,5,6,7,8,9,10
    c2=!randitem 1,2,3,4,5,6,7,8,9,10
    pm1=!randitem -1,1
    pm2=!randitem -1,1
    pm3=!randitem -1,1
    a=$pm1*$a1/$a2
    b=$pm1*$c1/$c2
    c=$pm1*$c1/$c2
!endif

functie=($a)*x^2 + ($b)*x + ($c)
S=-1*($b)/(2*$a)
tot=!exec pari printtex($functie)\
$S\
printtex($S)

formula$n=!line 1 of $tot
answer$n=!line 2 of $tot
texanswer$n=!line 3 of $tot
keuze=!randitem 1,0
!if $keuze=1
    F=!randitem f,g,h,k,p,w
    formula$n=$F\left( x \right)\,\,\,=\,\,\, $(formula$n)
!else
    formula$n=y\,\,\,=\,\,\, $(formula$n)
!endif
textanswer$n=$lijn x = $(answer$n)
texanswer$n= x = \frac{-1 \cdot b}{2 \cdot a} = $(texanswer$n)


!if $image=1 or $teaching=1
    XSIZE=150
    YSIZE=150
    plaatje=\
    transparent white\
    xrange $[$(answer$n) - 3],$[$(answer$n) + 3]\
    yrange -40,40\
    vline 0,0,blue\
    hline 0,0,blue\
    linewidth 2\
    dvline $(answer$n),0,red\
    curve green,$functie

    !if $printexo=1
	draw=1
	plot=0
	image$n=$plaatje
    !else
	insdraw_size=150,150
	!insdraw $plaatje
	helptext=!record 11 of lang/remarks.$taal
	#@Hier</a> staat een klein grafiekje van de functie
	#helptext=<a href="javascript:showimage();">$helptext
	helptext=<a onmouseover="this.T_OPACITY=85;this.T_PADDING=10;this.T_WIDTH=$XSIZE;this.T_BORDERCOLOR='gold';this.T_BORDERWIDTH=1;return escape('<img src= $wims_ref_name?&session=$session&module=$module&cmd=getins&special_parm=insert-1.gif>')"><font color=blue>$helptext</font>
    !endif
!endif



