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


grondgetal=10
exp=2,3,4,5,6,7,9,10,11,12
exp=!shuffle $exp

!if $R=1
    !for p=1 to $aantal_vragen
	!if $negatief=0
	    exp1=!item $p of $exp
	    som=!htmlmath $grondgetal^$exp1
	    G=!htmlmath $GOED
	    GOED=1
	    !for r=1 to $exp1
		GOED=!append word 0 to $GOED
	    !next r
	    GOED=!nospace $GOED
	!else
	    exp1=!item $p of $exp
	    exp2=$[-1*$exp1]
	    som=!htmlmath $grondgetal^$exp2
	    G=!htmlmath $GOED
	    GOED=0.
	    !for r=1 to $[$exp1-1]
		GOED=!append word 0 to $GOED
	    !next r
	    GOED=$GOED 1
	    GOED=!nospace $GOED	
	!endif
	sommen=!append line <td><font size=+1>$som&nbsp;<font size=+2>=&nbsp;</font><input size="40" name="ant$p"></td><tr> to $sommen
	SOMMEN=!append line <td><font size=+1>$som&nbsp;<font size=+2>=&nbsp;</font><input size="40" name="ant$p" value=$GOED></td><tr> to $SOMMEN
	antwoorden=!append line <td><font size=+1>$som&nbsp;<font size=+2>=&nbsp;</font>$GOED</td><tr> to $antwoorden
	GOED$n=!append item $GOED  to $(GOED$n)
    !next p
!endif

!if $R=2
    !for p=1 to $aantal_vragen
	a=!randitem 1,2,3,4,5,6,7,8,9	
	!if $negatief=0
	    exp1=!item $p of $exp
	    som=$a*$grondgetal^$exp1
	    som=!htmlmath $som
	    GOED=$a
	    !for r=1 to $exp1
		GOED=!append word 0 to $GOED
	    !next
	    GOED=!nospace $GOED
	!else
	    exp1=!item $p of $exp
	    exp2=$[-1*$exp1]
	    som=$a*$grondgetal^$exp2
	    som=!htmlmath $som
	    GOED=0.
	    !for r=1 to $[$exp1-1]
		GOED=!append word 0 to $GOED
	    !next r
	    GOED=$GOED $a
	    GOED=!nospace $GOED	
	!endif
	sommen=!append line <td><font size=+1>$som&nbsp;<font size=+2>=&nbsp;</font><input size="40" name="ant$p"></td><tr> to $sommen
	SOMMEN=!append line <td><font size=+1>$som&nbsp;<font size=+2>=&nbsp;</font><input size="40" name="ant$p" value=$GOED></td><tr> to $SOMMEN
	antwoorden=!append line <td><font size=+1>$som&nbsp;<font size=+2>=&nbsp;</font>$GOED</td><tr> to $antwoorden
	GOED$n=!append item $GOED  to $(GOED$n)
    !next p
!endif

!if $R>2
    !for p=1 to $aantal_vragen
	grondgetal=10
	exp1=!randitem 3,4,5,6,7,9,10
	s1=!randitem 1,2,3,4,5,6,7,8,9
	s2=!randitem 0,1,2,3,4,5,6,7,8,9
	s3=!randitem 0,1,2,3,4,5,6,7,8,9
	s4=!randitem 0,1,2,3,4,5,6,7,8,9
	s5=!randitem 0,1,2,3,4,5,6,7,8,9
	s6=!randitem 0,1,2,3,4,5,6,7,8,9
	s7=!randitem 0,1,2,3,4,5,6,7,8,9
	!if $R=2
	    s=!nospace $s1.$s2 $s3
	    getal=$s1 $s2 $s3
	    q=2
	    #q isdecimalen achter de "komma"
	!endif
	!if $R=3
	    s=!nospace $s1.$s2 $s3 $s4
	    getal=$s1 $s2 $s3 $s4
	    q=3
	!endif
	!if $R=4
	    s=!nospace $s1.$s2 $s3 $s4 $s5
	    getal=$s1 $s2 $s3 $s4 $s5
	    q=4
	    exp1=$[$exp1+1]
	!endif
	!if $R=5
	    s=!nospace $s1.$s2 $s3 $s4 $s5 $s6
	    getal=$s1 $s2 $s3 $s4 $s5 $s6
	    q=5
	    exp1=$[$exp1+2]
	!endif
	!if $R>5
	    s=!nospace $s1.$s2 $s3 $s4 $s5 $s6 $s7
	    getal=$s1 $s2 $s3 $s4 $s5 $s6 $s7
	    q=6
	    exp1=$[$exp1+3]
	!endif

	!if $negatief=0
	    som=!htmlmath $s*$grondgetal^$exp1
	    GOED=$getal
	    !for r=1 to $[$exp1-$q]
		GOED=!append word 0 to $GOED
	    !next r		
	!else
	    exp=$[-1*$exp1]
	    som=!htmlmath $s*$grondgetal^$exp
	    s=$[1*$s]
	    GOED=0.
	    !for r=1 to $[$exp1 - 1]
		GOED=!append word 0 to $GOED
	    !next r	
	    GOED=$GOED $getal
	!endif
	    GOED=!nospace $GOED


	nummer=!item $p of $telwoorden
	sommen=!append line <td><font size=+1>$som&nbsp;<font size=+2>=&nbsp;</font><input size="40" name="ant$p"></td><tr> to $sommen
	SOMMEN=!append line <td><font size=+1>$som&nbsp;<font size=+2>=&nbsp;</font><input size="40" name="ant$p" value=$GOED></td><tr> to $SOMMEN
	antwoorden=!append line <td><font size=+1>$som&nbsp;<font size=+2>=&nbsp;</font>$GOED</td><tr> to $antwoorden
	GOED$n=!append item $GOED  to $(GOED$n)
    !next p
!endif



!if $taal=nl
    !if $negatief=0
	nivo_title=Schrijf een macht als een grooooot getal
	groot=groot
    !else
	nivo_title=Schrijf een macht als een klein getal
	groot=klein
    !endif
    hint=Kijk in de help pagina
    Nummer=!item $n of $rangwoorden
    !if $wims_user=supervisor and $printbaar=0
	opgave$n=<table cellpadding='10' cellspacing='5'><td>$Nummer opgave<br>Schrijf dit getal zonder macht</td><tr>$SOMMEN</table>
    !else
	opgave$n=<table cellpadding='10' cellspacing='5'><td>$Nummer opgave<br>Schrijf dit getal zonder macht</td><tr>$sommen</table>
    !endif
    antwoord$n=<table cellpadding='10' cellspacing='5'><td>$Nummer opgave<br>Schrijf dit getal zonder macht</small></td><tr>$antwoorden</table>
!else
    !if $negatief=0
	nivo_title=Rewrite the power as a very large number
	groot=large 
    !else
	nivo_title=Rewrite the power as a very small number
	groot=small
    !endif
    hint=Look into the help-pages
    Nummer=!item $n of $rangwoorden
    !if $wims_user=supervisor and $printbaar=0
	opgave$n=<table cellpadding='10' cellspacing='5'><td>$Nummer exercise<br>Rewrite as a very $groot number<br></td><tr>$SOMMEN</table>
    !else
	opgave$n=<table cellpadding='10' cellspacing='5'><td>$Nummer exercise<br>Rewrite as a very $groot number</td><tr>$sommen</table>
    !endif
    antwoord$n=<table cellpadding='10' cellspacing='5'><td>$Nummer exercise<br>Rewrite as a very $groot number</td><tr>$antwoorden</table>
!endif
