n=$counter
!if $level=0
    R=$counter
!else
    R=$level
!endif
cols=20
rows=4
math=0
!if $rounding<10
    rounding=0
    !readproc $remarkdir/rounding.$taal
!endif
#rotzakken....
checkfile=$checkdir/coord.proc
text=!record 10 of lang/remarks.$taal
ss=!record 17 of lang/remarks.$taal
#@ Bepaal de Co&ouml;rdinaten van de snijpunten met de <em>x-</em>as.<br>Gebruik de <em>abc-formule</em>,er zijn geen snijpunten,de twee snijpunten zijn,en,het ene snijpunt is 
question$n=!item 1 of $text
question$n=$(question$n)<br><small><em>$ss</em></small>

geen=!item 2 of $text
twee=!item 3 of $text
en=!item 4 of $text
ene=!item 5 of $text
#functie=(Cx -A)(x+B)= Cx^2 +xCB -xA -AB = Cx^2 +x(CB-A) -AB
#a= C
#b= CB-A
#c= AB

!if $R = 1
    a=!randitem -1,1
    b=!randitem -5,-4,-3,-2,-1,1,2,3,4,5
    c=!randitem -10,-8,-6,-4,-2,-1,1,2,4,6,8,10 
!endif
!if $R = 2
    a=!randitem -1,-2,-3,1,2,3
    b=!randitem -5,-4,-3,-2,-1,1,2,3,4,5
    c=!randitem -10,-8,-6,-4,-2,-1,1,2,4,6,8,10 
!endif
!if $R = 3
    a=!randitem -1,-2,-3,1,2,3
    b=!randitem -5,-4,-3,-2,-1,1,2,3,4,5
    c=!randitem -10,-8,-6,-4,-2,-1,1,2,4,6,8,10 
!endif
!if $R >3
    a=!randitem -1,-2,-3,1,2,3
    b=!randitem -5,-4,-3,-2,-1,1,2,3,4,5
    c=!randitem -10,-8,-6,-4,-2,-1,1,2,4,6,8,10 
!endif
    
functie=($a)*x^2 + ($b)*x + ($c)
    
!if $[$b*$b - 4*($a)*($c)] >= 0
    x1=(-1*$b + sqrt($b*$b - 4*($a)*($c)))/(2*($a))
    x2=(-1*$b - sqrt($b*$b - 4*($a)*($c)))/(2*($a))
    tot=!exec maxima expand($x1);\
    expand($x2);
    x1=!line 1 of $tot
    x2=!line 2 of $tot
    X1tex=!texmath $x1
    X2tex=!texmath $x2

    !if $[$b*$b - 4*($a)*($c)] > 0
	texanswer$n= \left[ \begin{array}{l}\left( $X1tex : 0\right)\\ \left( $X2tex : 0\right)\end{array}\right.
	answer$n=$x1,0,$x2,0
	punten=points red,$[$x1],0,$[$x2],0
	textanswer$n=$twee ($x1:0) $en ($x2:0)
    !else
	texanswer$n= \left( $X1tex : 0 \right)
	answer$n=$x1,0
	punten=point $[$x1],0,red
	textanswer$n=$ene ($x1:0)  
    !endif    
    checkfile=$checkdir/coord.proc
!else
    textanswer$n=$geen
    answer$n=nil
    texanswer$n= \,\,\, \varnothing
    var1=0
    # LET OP: er zijn geen snijpunten, dus een andere checkfile nodig
    checkfile=exos/checkfile2.proc
!endif	
    
formula$n=!texmath $functie
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

!if $image=1 or $teaching=1
    XSIZE=150
    YSIZE=150
    plaatje=\
    transparent white\
    xrange -10,10\
    yrange -100,100\
    vline 0,0,blue\
    hline 0,0,blue\
    linewidth 2\
    dvline $S,0,red\
    curve green,$functie\
    linewidth 6\
    $punten
    !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>
	#helptext=<a onmouseover="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

