!if $taal=nl
    somtekst1=Reken de volgende som uit<br>\
    en vereenvoudig de uitkomst zo ver mogelijk:<br>
    nivo_title=integer getal en breuk.
!else
    somtekst1=Calculate and fill in the blancs<br>\
    and don't forget to reduce the outcome:<br>
    nivo_title=Integer and Fraction.    
!endif
bewerking=bewerking1.proc
    
!if $negatief=0
    lijst_a=!shuffle 1,2,3,4,1,2,3,4
    lijst_b=!shuffle 4,5,6,7,4,5,6,7
    lijst_c=!shuffle 2,3,4,5,6,7,8,9,10,11,12,13,14,15
!else
    lijst_a=!shuffle 1,2,3,4,5,6,-1,-2,-3,-4,-5,-6
    lijst_b=!shuffle 6,7,8,9,10,11,12,-6,-7,-8,-9,-10,-11,-12
    lijst_c=!shuffle 2,3,4,5,6,7,8,-2,-3,-4,-5,-6,-7,-8
!endif
    
totaal=$empty
R=$graad
!for n=1 to $aantal_sommen
pm=!randitem 1,-1
mp=!randitem 1,-1
    !if $graad=0
	R=$n
    !endif	
    !if $R=1
	a=!item $n of $lijst_a
	b=$[abs($a)+1]
	c=!item $n of $lijst_c	
    !endif		
    !if $R=2
    	a=!item $n of $lijst_a
	b=!randitem 7,8,9,10,11,12,13,14,15
	c=!item $n of $lijst_c
    !endif
    !if $R=3
	a=!item $n of $lijst_a
	b=!item $n of $lijst_b
	c=!item $n of $lijst_c	
    !endif
    !if $R>3
	a=!item $n of $lijst_a
	b=!item $n of $lijst_b
	b=$[2*$b+1]
	c=!item $n of $lijst_c
	c=$[2*$c+1]	
    !endif
    som$n=$c*($a)/($b) 
    opgave$n=$c \cdot  \frac{$a}{$b}
    totaal=!append line $(som$n) to $totaal
    totaal=!append line printtex($(som$n)) to $totaal 
!next n

totaal=!exec pari $totaal

i=1
!for n=1 to $aantal_sommen
    GOED$n=!line $i of $totaal
    goed$n=!line $[$i+1] of $totaal
    i=$[$i+2]	 
!next n
