n=$counter
!if $rounding=-1
    rounding=0
    !readproc $remarkdir/rounding.$taal
!endif
mathviewpanel=$module_title:x_1=:and:x_2=:sqrt()
impossible=0
questiontype=0
checkfile=$checkdir/number.proc
arglist=x
cols=15
rows=4
kleuren=red,blue,green,orange,purple
kleuren=!shuffle $kleuren
color1=!item 1 of $kleuren
color2=!item 2 of $kleuren
exotext=$empty
question$n=!record 2 of lang/remarks.$taal
sometext=!record 6 of lang/remarks.$taal
helptext=!record 23 of lang/remarks.$taal
stext=!record 24 of lang/remarks.$taal
helptext=<a onmouseover="return escape('$helptext')">$stext</a>
raaklijn=!item 1 of $sometext
raken=!item 2 of $sometext
!if $usage=2
    image=0
!endif

!if $level=0
    R=$counter
!else
    R=$level
!endif        

!if $R=1
    #c(x+a)(x+b)=0
    a=!randitem -6,-5,-4,-3,-2,-1,2,3,4,5,6
    b=!randitem -6,-5,-4,-3,-2,-1,2,3,4,5,6
    c=!randitem -4,-3,-2,-1,2,3,4
    !if $a=$b
	a=$[$a-1]
    !endif
    curve1=$c*(x+$a)*(x+$b)
    C1=!htmlmath $curve1 = 0
    form1=!exec pari printtex($curve1) 
    formula$n= $form1 \,=\, 0
    x1=$[-1*$a]
    x2=$[-1*$b]
    tex_x1=$x1
    tex_x2=$x2
    y1=0
    y2=0
    textanswer$n=!record 5 of lang/remarks.$taal
    #@ We ontbinden de vergelijking eerst in factoren, <br>dus de vergelijking wordt dan $C1 <br>
    texanswer$n=\left[ \begin{array}{l} x_{1} = $tex_x1\\ x_{2} = $tex_x2  \end{array}\right.
    answer$n=$x1,$x2
    !if $image=1 or $teaching=1
	XRANGE=-15,15
	YRANGE=-50,50
	curve1=curve $color1,$curve1
	curve2=hline 0,0,$color2
	!readproc exos/image1.proc
    !endif
  !exit
!endif

!if $R=2
    keuze=!randitem 1,2
    #c(x+a)(x+b)=0
    a=!randitem -9,-8,-7,-6,-5,-4,-3,-2,-1,2,3,4,5,6,7,8,9
    b=!randitem -9,-8,-7,-6,-5,-4,-3,-2,-1,2,3,4,5,6,7,8,9
    c=!randitem -4,-3,-2,-1,2,3,4
    !if $a=$b
	a=$[$a-1]
    !endif
    d=!randitem -10,-9,-8,-7,-6,-5,-4,-3,-2,-1,1,2,3,4,5,6,7,8,9,10
    !if $keuze=1
        e=$[$a*$b*$c + $d]
        curve1=$c*x^2+$[$a*$c+$b*$c]*x+$e
        curve2=$d
        C1=!htmlmath $curve1 = $d
        form1=!exec pari printtex($curve1) 
        formula$n= $form1 \,=\, $d
    !else
        e=$[$a*$c + $b*$c + $d]
        curve1=$c*x^2+$[$a*$c+$b*$c + $d]*x+$[$a*$b*$c]
        curve2=$d*x
        C1=!htmlmath $curve1 = $d*x
        form1=!exec pari printtex($curve1) 
        formula$n= $form1 \,=\, $d x
    !endif
    x1=$[-1*$a]
    x2=$[-1*$b]
    tex_x1=$x1
    tex_x2=$x2
    y1=0
    y2=0
    textanswer$n=!record 5 of lang/remarks.$taal
    #@ We ontbinden de vergelijking eerst in factoren, <br>dus de vergelijking wordt dan $C1 <br>
    texanswer$n=\left[ \begin{array}{l} x_{1} = $tex_x1\\ x_{2} = $tex_x2  \end{array}\right.
    answer$n=$x1,$x2
    !if $image=1 or $teaching=1
	XRANGE=-15,15
	YRANGE=-50,50
	curve1=curve $color1,$curve1
	curve2=curve $color2,$curve2
	!readproc exos/image1.proc
    !endif
  !exit
!endif

!if $R=3
    keuze=!randitem 1,2
    #c(x+a)(x+b)=0
    a=!randitem -9,-8,-7,-6,-5,-4,-3,-2,-1,2,3,4,5,6,7,8,9
    b=!randitem -9,-8,-7,-6,-5,-4,-3,-2,-1,2,3,4,5,6,7,8,9
    c=!randitem -1/4,-3/4,-1/3,-2/3,-1/2,1/2,1/3,2/3,1/4,3/4,1/5
    !if $a=$b
	a=$[$a-1]
    !endif
    d=!randitem -1/4,-3/4,-1/3,-2/3,-1/2,1/2,1/3,2/3,1/4,3/4,1/5
    !if $keuze=1
        tot=!exec pari A=$c*x^2+($a*$c+$b*$c)*x+($a*$b*$c+$d)\
        printtex(A)\
        printtex($d)
        curve1=$c*x^2+$[$a*$c+$b*$c]*x+$e
        curve2=$d
        C1=!htmlmath $curve1 = $d
        form1=!line 2 of $tot
        form2=!line 3 of $tot
        formula$n= $form1 \,=\, $form2
    !else
        tot=!exec pari A=$c*x^2+($a*$c+$b*$c+$d)*x+($a*$b*$c)\
        printtex(A)\
        printtex($d*x)
        curve1=$c*x^2+$[$a*$c+$b*$c + $d]*x+$[$a*$b*$c]
        curve2=$d*x
        C1=!htmlmath $curve1 = $d*x
        form1=!line 2 of $tot
        form2=!line 3 of $tot
        formula$n= $form1 \,=\, $form2
    !endif
    x1=$[-1*$a]
    x2=$[-1*$b]
    tex_x1=$x1
    tex_x2=$x2
    y1=0
    y2=0
    textanswer$n=!record 5 of lang/remarks.$taal
    #@ We ontbinden de vergelijking eerst in factoren, <br>dus de vergelijking wordt dan $C1 <br>
    texanswer$n=\left[ \begin{array}{l} x_{1} = $tex_x1\\ x_{2} = $tex_x2  \end{array}\right.
    answer$n=$x1,$x2
    !if $image=1 or $teaching=1
	XRANGE=-15,15
	YRANGE=-50,50
	curve1=curve $color1,$curve1
	curve2=curve $color2,$curve2
	!readproc exos/image1.proc
    !endif
  !exit
!endif

!if $R>3
    #c(x+a)(x+b)=0
    a=!randitem -9,-8,-7,-6,-5,-4,-3,-2,-1,2,3,4,5,6,7,8,9
    b=!randitem -9,-8,-7,-6,-5,-4,-3,-2,-1,2,3,4,5,6,7,8,9
    c=!randitem -3,-2,-1,-1/2,-1/3,1/3,1/2,2,3,4
    !if $a=$b
	a=$[$a-1]
    !endif
    d=!randitem 2,3,4,5,6
    e=!randitem 6,7,8,9,10
    f=!randitem 1,2,3,4,5
    tot=!exec pari A=$c*x^2+($a*$c+$b*$c-$d)*x+($a*$b*$c+$e)\
    printtex(A)\
    B=($e-$f)/$d\
    printtex(B)
    curve1=$c*x^2+$[$a*$c+$b*$c-$d]*x+($a*$b*$c+$e)
    curve2=-1*$d*x+$e
    C1=!htmlmath $curve1 = $d
    form1=!line 2 of $tot
    g=!line 4 of $tot
    form2=$f-$d \left(x-$g\right)
    formula$n= $form1 \,=\, $form2
    x1=$[-1*$a]
    x2=$[-1*$b]
    tex_x1=$x1
    tex_x2=$x2
    y1=0
    y2=0
    textanswer$n=!record 5 of lang/remarks.$taal
    #@ We ontbinden de vergelijking eerst in factoren, <br>dus de vergelijking wordt dan $C1 <br>
    texanswer$n=\left[ \begin{array}{l} x_{1} = $tex_x1\\ x_{2} = $tex_x2  \end{array}\right.
    answer$n=$x1,$x2
    !if $image=1 or $teaching=1
	XRANGE=-15,15
	YRANGE=-90,90
	curve1=curve $color1,$curve1
	curve2=curve $color2,$curve2
	!readproc exos/image1.proc
    !endif
  !exit
!endif


