# :type a(bx-c)=d
mathviewpanel=$module_title:x=:<=>
!if $rounding=-1
    rounding=0
    !readproc $remarkdir/rounding.$taal
!endif
!if $usage=2
    image=0
!endif
questiontype=0
n=$counter
!if $level=0
    R=$counter
!else
    R=$level
!endif

exotext=$empty
keuze=!randitem 1,2
checkfile=exos/checkfile1.proc
!if $subject=3
    varlist=x
    question$n=!record 1 of lang/remarks.$taal
    #@ Los de volgende vergelijking op:<br>
    sometext=!record 2 of lang/remarks.$taal
    helptext=!record 3 of lang/remarks.$taal
    cols=15
    rows=2
    # berekeniningen laten zien
    var3=0
    helptext=<a onmouseover="return escape('$helptext')">$sometext</a>
!else
    varlist=x
    # maximaal aantal pijlen=tussenstappenn
    var1=5
    # aantal pijlen=tussenstappen
    var2=1
    # berekeniningen laten zien
    var3=1
    question$n=!record 4 of lang/remarks.$taal
    #@ Los de volgende vergelijking op:<br>
    sometext=!record 2 of lang/remarks.$taal
    helptext=!record 5 of lang/remarks.$taal
    cols=25
    rows=5
    inputs=1
    questiontype=7
    javascript=js/exo1.js
    embed=1
    XSIZE=650
    exotext=<a onmouseover="return escape('$helptext')">$sometext</a>
    helptext=$empty
!endif

# question$n = html/ascii vraag
# formula$n  = latex/html versie van de formule
# answer$n = nakijk wiskundige goede antwoorden
# textanswer$n= text/ascii/html versie met uitleg van het goede antwoord
# texanswer$n is latexformule van goede antwoord
!if $R=1
    a=!randitem -5,-4,-3,-2,-1,2,3,4,5
    p=!randitem 2,3,4,5
    x=$[$p*$a]
    c=!randint 2,10
    d=!randitem -8,-7,-6,-5,-4,-3,-2,-1,2,3,4,5,6,7,8
    !if $keuze=1
	b=$[($a*$c+($d))*$p]
	formula$n=$a \cdot \left( $b - $c x \right) \,=\, $d x \rightarrow
	tex=$[$a*$b] - $[$a*$c] x \,=\, $d x \rightarrow  $[$a*$b] \,=\, $[($d) + ($a)*($c)] x\rightarrow x \,=\, $x 
    !else
	b=$[(-1*$a*$c+($d))*$p]
	formula$n=$a \cdot \left( $b  + $c x \right) \,=\, $d x \rightarrow
	tex=$[$a*$b] + $[$a*$c] x \,=\, $d x \rightarrow  $[$a*$b] \,=\, $[($d) - ($a)*($c)] x\rightarrow x \,=\, $x 
    !endif
    answer$n=$x
    texanswer$n=\rightarrow $tex
 !exit
!endif

!if $R=2
    a=!randitem -7,-6,-5,-4,-3,-2,-1,2,3,4,5,6,7
    b=!randitem -10,-9,-8,-7,-6,-5,-4,-3,-2,-1,1,2,3,4,5,6,7,8,9,10
    d=!randitem -10,-9,-8,-7,-6,-5,-4,-3,-2,2,3,4,5,6,7,8,9,10
    c=!randint 2,10
    !if $keuze=1
	!if $[($a)*$c+($d)]=0
	    c=$[$c+1]
	!endif
	tot=!exec pari A=($a*($b))/(($a)*$c+($d))\
	printtex(A)
	formula$n=$a \cdot \left( $b - $c x \right) \,=\, $d x \rightarrow
	tex=$[$a*$b] - $[$a*$c] x \,=\, $d x \rightarrow  $[$a*$b] \,=\, $[($d) + ($a)*($c)] x 
    !else
	!if $[-1*($a)*$c+($d)]=0
	    c=$[$c+1]
	!endif
	tot=!exec pari A=($a*($b))/(-1*($a)*($c)+($d))\
	printtex(A)
	formula$n=$a \cdot \left( $b + $c x\right) \,=\, $d x \rightarrow
	tex=$[$a*$b] + $[$a*$c] x \,=\, $d x \rightarrow  $[$a*$b] \,=\, $[($d) - ($a)*($c)] x
    !endif
    answer$n=!line 1 of $tot
    t=!line 2 of $tot
    texanswer$n=\rightarrow $tex \rightarrow x \,=\, $t
 !exit
!endif

!if $R=3
    a=!randitem -7,-6,-5,-4,-3,-2,-1,2,3,4,5,6,7
    b=!randitem -10,-9,-8,-7,-6,-5,-4,-3,-2,-1,1,2,3,4,5,6,7,8,9,10
    d=!randitem -10,-9,-8,-7,-6,-5,-4,-3,-2,2,3,4,5,6,7,8,9,10
    c=!randint 2,10
    e=!randint 2,20
    !if $keuze=1
	!if $[($a)*$c+($d)]=0
	    c=$[$c+1]
	!endif
	tot=!exec pari A=($a*($b)-$e)/(($a)*$c+($d))\
	printtex(A)
	formula$n=$a \cdot \left( $b - $c x \right) \,=\, $d x + $e \rightarrow
	tex=$[$a*$b] - $[$a*$c] x \,=\, $d x + $e \rightarrow  $[$a*$b-$e] \,=\, $[($d) + ($a)*($c)] x 
    !else
	!if $[-1*($a)*$c+($d)]=0
	    c=$[$c+1]
	!endif
	tot=!exec pari A=($a*($b)-$e)/(-1*($a)*($c)+($d))\
	printtex(A)
	formula$n=$a \cdot \left( $b + $c x\right) \,=\, $d x + $e \rightarrow
	tex=$[$a*$b] + $[$a*$c] x \,=\, $d x +$e \rightarrow  $[$a*$b-$e] \,=\, $[($d) - ($a)*($c)] x
    !endif
    answer$n=!line 1 of $tot
    t=!line 2 of $tot
    texanswer$n=\rightarrow $tex \rightarrow x \,=\, $t
 !exit
!endif

!if $R>3
    a=!randitem 1/8,1/7,1/6,1/5,1/4,2/3,1/3,1/2,-1/8,-1/7,-1/6,-1/5,-1/4,-1/3,-2/3,-1/2
    b=!randitem -10,-9,-8,-7,-6,-5,-4,-3,-2,-1,1,2,3,4,5,6,7,8,9,10
    d=!randitem -10,-9,-8,-7,-6,-5,-4,-3,-2,2,3,4,5,6,7,8,9,10
    c=!randint 2,10
    e=!randint 2,20
    f=$[1/($a)]
    !if $keuze=1
	!if $[($a)*$c+($d)]=0
	    c=$[$c+1]
	!endif
	tot=!exec pari A=($a*($b)-$e)/(($a)*$c+($d))\
	printtex(A)\
	printtex($a)
	atex=!line 3 of $tot
	formula$n=$atex \cdot \left( $b - $c x \right) \,=\, $d x + $e \rightarrow
	tex=$b - $c x \,=\, $f \cdot \left( $d x + $e \right) \rightarrow $b - $c x \,=\, $[$f*$d] x + $[$f*$e] \right)
    !else
	!if $[-1*($a)*$c+($d)]=0
	    c=$[$c+1]
	!endif
	tot=!exec pari A=($a*($b)-$e)/(-1*($a)*($c)+($d))\
	printtex(A)\
	printtex($a)
	atex=!line 3 of $tot
	formula$n=$atex \cdot \left( $b + $c x\right) \,=\, $d x + $e \rightarrow
	tex=$b + $c x \,=\, $f \cdot \left( $d x + $e \right) \rightarrow $b + $c x \,=\, $[$f*$d] x + $[$f*$e] \right)
    !endif
    answer$n=!line 1 of $tot
    t=!line 2 of $tot
    texanswer$n=\rightarrow $tex \rightarrow x \,=\, $t
 !exit
!endif
