n=$teller
bewerking=bewerking2.proc
!if $graad=0
    R=$teller
!else
    R=$graad
!endif

PLAATJE=1
!if $aantal_vragen < 3 
    aantal_vragen = 3
!endif
!if $R=1
    XRANGE=-6,6
    YRANGE=-6,6
    XSCHAAL=1
    YSCHAAL=1
    curves=x^2,x^2+1,x^2-1,x^2-2,x^2-3,x^2+2,x^2+3,x^2-4,x^2+4,x^2+5,x^2-5
    curves=!shuffle $curves
    GOED$n=!randint 1,$aantal_vragen
    goedecurve=!item $(GOED$n) of $curves
    opgave$n=!texmath f(x)=$goedecurve
    antwoord$n=!htmlmath f(x)=$goedecurve
!endif
!if $R=2
    XRANGE=-6,6
    YRANGE=-6,6
    XSCHAAL=1
    YSCHAAL=1
    curves=-x^2,-x^2+1,-x^2-1,-x^2-2,-x^2-3,-x^2+2,-x^2+3,-x^2+4,-x^2-4,-x^2+5,-x^2-5
    curves=!shuffle $curves
    GOED$n=!randint 1,$aantal_vragen
    goedecurve=!item $(GOED$n) of $curves
    opgave$n=!texmath f(x)=$goedecurve
    antwoord$n=!htmlmath f(x)=$goedecurve
!endif
!if $R=3
    XRANGE=-5,5
    YRANGE=-5,5
    XSCHAAL=1
    YSCHAAL=1
    curves=x^2,x^2+1,x^2-1,x^2-2,x^2-3,x^2+2,x^2+3,-x^2,-x^2+1,-x^2-1,-x^2-2,-x^2-3,-x^2+2,-x^2+3
    curves=!shuffle $curves
    GOED$n=!randint 1,$aantal_vragen
    goedecurve=!item $(GOED$n) of $curves
    opgave$n=!texmath f(x)=$goedecurve
    antwoord$n=!htmlmath f(x)=$goedecurve

!endif
!if $R>3
#bolleboosjes
    XRANGE=-5,5
    YRANGE=-50,50
    XSCHAAL=1
    YSCHAAL=10
    curves=x^3,-x^3,x^3+3,-x^3+3,x*(x^2-4),-x*(x^2-4),x*(x^2-16),-x*(x^2-16),x*(x^2-9),-x*(x^2-9)
    curves=!shuffle $curves
    GOED$n=!randint 1,$aantal_vragen
    goedecurve=!item $(GOED$n) of $curves
    opgave$n=!texmath f(x)=$goedecurve
    antwoord$n=!htmlmath f(x)=$goedecurve
!endif
!if $R=5
    XRANGE=-6,6
    YRANGE=-6,6
    XSCHAAL=1
    YSCHAAL=1
    curves=sqrt(x),-sqrt(x),2+sqrt(x),2-sqrt(x),4+sqrt(x),4-sqrt(x),sqrt(x-1),-sqrt(x-1),sqrt(x-2),-sqrt(x-2)
    curves=!shuffle $curves
    GOED$n=!randint 1,$aantal_vragen
    goedecurve=!item $(GOED$n) of $curves
    opgave$n=!texmath f(x)=$goedecurve
    antwoord$n=!htmlmath f(x)=$goedecurve
!endif

XSIZE=200
YSIZE=200
transparent=NEE
!readproc $authordir/ruitjespapier.proc	

!for p=1 to $aantal_vragen

    curve=!item $p of $curves
    plaatje$p=$ruitjespapier\
    linewidth 2\
    curve red,$curve
    !if $p=$(GOED$n)
	goedeplaatje$n=$(plaatje$p)
    !endif	
!next

knipperen=0
!if $taal=nl
    nivo_title=Welke formule hoort bij welke grafiek?
    somtekst$n=Klik op de curve die hoort bij de onderstaande formule:<br>
    hint=<p align="left"><font color=$fontcolor2>Algemene Hint:</font><br>\
    <font color=$fontcolor1>Neem een handig getal om de functie te controleren<br>\
    Stel de functie is <em>f(x)=x<sup><small>2</small></sup>-4</em><br>\
    Wanneer wordt <em>f(x)=0</em><br>\
    Bij <em>x<sup><small>2</small></sup>-4=0 --> x=2 <font size="+1">V</font> x=-2</em><br>\
    Dus de grafiek van <em>f</em> snijdt de <em>x-as</em> dus in de punten (-2:0) en (2:0) <br>OK ?</p>
!else
    nivo_title=Which graph belongst to the equation?
    somtekst$n=Click on the graph that belongs to the function:<br>
    hint=no hint.
!endif
