inputs=0
rows=1
image=0
helptext=$empty
applet=1
plot=0
draw=0
questiontype=0
XSIZE=600
!if $rounding<1
    rounding=100
!endif
!readproc $remarkdir/rounding.$taal
checkfile=exos/checkfile2.proc
n=$counter
!if $level=0    
    R=$counter
!else
    R=$level
!endif
question$n=!record 52 of lang/remarks.$taal
#@ Vul de tabel in aan de hand van de schuifapplet
VAR1=!record 43 of lang/remarks.$taal
#@ x,tijd,minuten,dagen,maanden,seconden
VAR2=!record 44 of lang/remarks.$taal
#@ y,hoeveelheid,afstand,opbrengst,omzet,hoogte

r=!randitem 1,2,3,4,5,6
TIJD=!item $r of $VAR1
H=!item $r of $VAR2

tabel1=$empty
tabel2=$empty    
tabel3=$empty
tot=$empty    

!if $options < 4 or $options>9
    options=6
!endif
!if $wims_user=supervisor
    readonly=$empty
!else
    readonly=readonly
!endif

keuze=!randitem 1,0
getal=!randint 5,200
p=!randint 80,220
!if $p=100
    p=120
!endif
p=$[$p/100]
!if $R=1
    !for s=1 to $options
	getal$s=$[$s-1]
	tabel1=!append line <th>$(getal$s)</th> to $tabel1
    	tot=!append item $[round($rounding*$getal*$p^($(getal$s)))/(1.0*$rounding)] to $tot
    !next s	
 !goto READY
!endif
    
!if $R=2 
    r=!randitem 2,3,4
    !for s=1 to $options
	getal$s=$[$r*$s-$r]
	tabel1=!append line <th>$(getal$s)</th> to $tabel1
	tot=!append item $[round($rounding*$getal*$p^($(getal$s)))/(1.0*$rounding)] to $tot
    !next s	
 !goto READY
!endif
    
!if $R=3
    r=!randitem 1,2,3,4
    q=!randitem -8,-7,-6,-5,-4,-3,-2
    !for s=1 to $options
	getal$s=$[$q+$r*($s-1)]
	tabel1=!append line <th>$(getal$s)</th> to $tabel1
	tot=!append item $[round($rounding*$getal*$p^($(getal$s)))/(1.0*$rounding)] to $tot
    !next s	
 !goto READY
!endif

!if $R >3
    t=!randitem 1/2,1/3,1/4,3/4,2/3,5/3,7/4,7/3,8/5,9/4,3/8,5/8,7/8,8/9
    !for s=1 to $options
	G=$s*$t
	pari_vraag=!append line $G to $pari_vraag
	tot=!append item $[round($rounding*$getal*$p^($G))/(1.0*$rounding)] to $tot	
    !next s	
    pari_antwoord=!exec pari $pari_vraag
    !for s=1 to $options
	getal=!line $s of $pari_antwoord
	ans=!item $s of $tot
	tabel1=!append line <th>$getal</th> to $tabel1
	tabel2=!append line <th><input size="12" name="reply$n"></th> to $tabel2
	tabel3=!append line <th><input size="12" name="reply$n" value="$ans" $readonly></th> to $tabel3
    !next s	   
    texanswer$n= \begin{bf} $H \end{bf} \,\, =\,\, $getal \cdot $p^{^{\begin{bf} $TIJD \end{bf} } }
    textanswer$n=<table border="1" width="100%" cellpadding="8" $paperbg><th>$TIJD</th>$tabel1<tr><th>$H</th>$tabel3</table>
    !if $wims_user=supervisor
	sometext=$(textanswer$n)
    !else
	sometext=<table border="1" width="100%" cellpadding="8" $paperbg><th>$TIJD</th>$tabel1<tr><th>$H</th>$tabel2</table>    
    !endif
!endif

:READY    
!for s=1 to $options
    ans=!item $s of $tot
    answer$n=!append item $ans to $(answer$n)
    tabel2=!append line <th><input size="12" name="reply$n"></th> to $tabel2
    tabel3=!append line <th><input size="12" name="reply$n" value="$ans" $readonly></th> to $tabel3 
!next s
F=$getal*$p^x  
texanswer$n= \begin{bf} $H \end{bf} \,\, =\,\, $getal \cdot $p^{^{\begin{bf} $TIJD \end{bf} } }
textanswer$n=<table border="1" width="100%" cellpadding="8" $paperbg ><th>$TIJD</th>$tabel1<tr><th>$H</th>$tabel3</table>
!if $wims_user=supervisor
    sometext=$(textanswer$n)
!else
    sometext=<table border="1" width="100%" cellpadding="8" $paperbg><th>$TIJD</th>$tabel1<tr><th>$H</th>$tabel2</table>
!endif
exotext=$empty
object$n=<applet codebase="$appletdir" archive="jcm1.0-config.jar" code="SimpleGraph.class" width="640" height="480">\
    <param name="UseFunctionInput" value="no">\
    <param name="CanvasColor" value="255 255 224">\
    <param name="PanelBackground" value="255 255 224">\
    <param name="BackgroundColor" value="255 255 224">\
    <param name="UseGrid" value="yes">\
    <param name="Function" value="$F">\
    <param name="GraphColor" value="red">\
    <param name="UsePanner" value="yes">\
    <param name="UseZoomButtons" value="yes">\
    <param name="UseMouseZoom" value="yes">\
    <param name="UseLimitsPanel" value="yes">\
    <param name="Limits" value="-20 20 -20 20">\
    <param name="Xlabel" value="$TIJD (de x-as)">\
    <param name="Ylabel" value="$H (de y-as)">\
    $ojava</applet><br>$sometext<br><center><input type="submit" style="$mybuttonstyle" value="$send">
