bewerking=bewerking2.proc

!if $taal=nl
    nivo_title=Breuken & Breuken<br>Groter,Kleiner of Gelijk?
    somtekst1=Bekijk de volgende sommetjes,<br> en vul in groter,kleiner of gelijk.
    
!else
    nivo_title=Fractions & Fractions<br>Bigger,Smaller or Equal?
    somtekst1=Fill in, bigger,smaller or equal:
!endif    

totaal=$empty
R=$graad
    
!for n=1 to $aantal_sommen
    !if $graad=0
	R=$n
    !endif
	!if $R=1
	# a/b ? c/d
	    a=!randitem 3,4,5,6,7
	    b=!randitem 5,6,7,8,9,10
	    c=!randitem $[$n*$a],$[$n*$a+1],$[$n*$a-1],$[$n*$a+2],$[$n*$a-2]
	    d=$[$n*$b]
	    p=-1
	    q=1
	    r=-1
	    s=1
	!endif
	!if $R=2
	    a=!randitem 1,2,3
	    b=!randitem 4,5,6,7
	    c=!randitem 1,2,3
	    d=!randitem $[$b+1],$[$b-1],$[$b+2],$[$b-2]
	    p=-1
	    q=1
	    r=-1
	    s=1
	!endif
	!if $R>2
	    a=!randitem 1,2,3,4,5,6
	    b=!randint 6,20
	    c=!randitem 1,2,3,4,5,6
	    d=!randint 6,20
	    p=!randitem -1,1
	    q=!randitem -1,1
	    r=!randitem -1,1
	    s=!randitem -1,1

	!endif    
    !if $negatief=1
	a=$[$p*$a]
	b=$[$q*$b]
	c=$[$r*$c]
	d=$[$s*$d]
	#a/b ? c/d
	#ap/bq ? cr/ds
    !endif
    A$n=\frac{$a}{$b}
    B$n=\frac{$c}{$d}
    totaal=!append line if(($a/$b)>($c/$d),1,0) to $totaal
    totaal=!append line if(($a/$b)<($c/$d),1,0) to $totaal
!next n

totaal=!exec pari $totaal
i=1
!for n=1 to $aantal_sommen
    a1=!line $i of $totaal
    a2=!line $[$i+1] of $totaal
    !if $a1=1
	GOED$n=groter
	goed$n=$(A$n) > $(B$n)
    !else
	!if $a2=1
	    GOED$n=kleiner
	    goed$n=$(A$n) < $(B$n)
	!else
	    GOED$n=gelijk
	    goed$n=$(A$n) = $(B$n)	    
	!endif	
    !endif
    i=$[$i+2]		
!next n
