bewerking=bewerking2.proc

!if $taal=nl
    nivo_title=Breuken & Decimalen<br>Groter,Kleiner of Gelijk?
    somtekst1=Bekijk de volgende sommetjes en bereken<br>\
    <em>het liefst zonder rekenmachine</em> of groter,kleiner of gelijk.
!else
    nivo_title=Fractions & Decimals<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=!randint 1,$[2*$n]
	c=!randint 1,$[2*$n]
	b=!randint 7,21
	d=$b
    !endif
    !if $R=2
	a=!randint 1,10
	c=$[$n*$a]
	b=!randint 11,16
	d=$[$n*$b]
    !endif
    !if $R>2
	a=!randint 1,6
	b=!randint 6,20
	c=!randint 2,6
	d=!randint 6,20
    !endif    
    !if $negatief=1
	a=$[-1*$a]
	c=$[-1*$c]
	p=!randitem -1,1
	b=$[$p*$b]
	d=$[$p*$d]
    !endif
    keuze=!randitem 1,2
    !if $keuze=1
	A=($a)/($b)
	B=$[round((10^$n)*($c)/($d))/(10^$n)]
	A$n=\frac{$a}{$b}
	B$n=\,\, $B
    !else
	A=$[round((10^$n)*($a)/($b))/(10^$n)]
	B=($c)/($d)
	A$n=\,\, $A
	B$n=\frac{$c}{$d}
    !endif
    totaal=!append line if(($A)>($B),1,0) to $totaal
    totaal=!append line if(($A)<($B),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
