#list_of_things=['point','line','segment','circle','function','polygon','cone','ellipse','polynomial']
#customToolBar=0 , 1 , 10 , 16 , 6
# alleen integers in ggb file !! decimalen=0

n=$counter
R=$level
!if $level=0
    R=$counter
!endif
inputs=0
# geogebra
xmin=0
xmax=6
segments=$[$xmax-$xmin]
points=$[2*$segments]
appletcommand=$empty
showToolBar=true
showMenuBar=false
framePossible=false
ggb=ggb/grid1.ggb
width=640
height=480
list_of_things=[ 'segment','point' ];
customToolBar=" 0 | 15 || 40 | 41 | 42 | 6 "

# gnuplot
XSIZE=640
YSIZE=480
wordmax=300
questiontype=4
checkfile=exos/checkfile1.proc
math=0    
plot=0
draw=0
image=0
image$n=$empty

ss=!record 1 of lang/remarks.$taal
#@ Teken in de java-applet een toenamendiagram met een stapgrootte "1"<br>vanaf x=$xmin tot en met x=$xmax bij de grafiek. 
question$n=<a onmouseover="return escape('<img src=$wims_ref_name?&session=$session&module=$module&cmd=getins&special_parm=insert-1.gif>')">$ss</a>
    
exotext=!record 2 of lang/remarks.$taal
#@ Klik hier</a> voor de <b>grafiek</b>
exotext=<a href="javascript:showimage();">$exotext

helptext=!record 17 of lang/remarks.$taal
#@ <em>GeoGebra</a> help pagina's</em>

insplot_set=size 1.0,1.0; title ;autoscale y ; border 3; zeroaxis linetype 4 lw 3 ; tmargin 1 ; rmargin 1 ; grid linetype 2 ; xtics 1 
#; ytics 1
!if $R=1
    a=!randitem -3,-2,-1,1,2,3
    b=!randitem -5,-4,-3,-2,-1,0,1,2,3,4,5
    functie=$a*x+$b
    !for p=$[$xmin+1] to $xmax
	answer$n=!append item $p,0 to $(answer$n)
	answer$n=!append item $p,$a to $(answer$n)
	textanswer$n=!append line <li>Segment ($p:0) -- ($p:$a)</li> to $(textanswer$n)
    !next p
    !insplot [$xmin:$xmax] $functie notitle lt 1
 !exit
!endif

!if $R>1
    keuze=!randitem 1,2
    a=!randitem 0,1,2
    b=!randitem 3,4,5
    !if $keuze=1
	c=!randitem 1,2
    !else
	c=!randitem -1,-2
    !endif
	
    C=$[-1*($a)*($c) - ($b)*($c) + ($c)]
    tt=2*($c)*x + ($C)

    !for p=$xmin to $xmax
	y=!replace internal x by $p in $tt
	y=$[$y]
	q=$[1+$p]
	answer$n=!append item $q,0 to $(answer$n)
	answer$n=!append item $q,$y to $(answer$n)
	textanswer$n=!append line <li>Segment ($q:0) -- ($q:$y)</li> to $(textanswer$n)
    !next p
    
    functie=$c*(x-$a)*(x-$b)
    !insplot [$xmin:$xmax] $functie notitle lt 1
 !exit
!endif


