mathviewpanel=$module_title:/:+:-:*:^
rounding=0
mathview=0
!readproc $remarkdir/rounding.$taal
image=0
questiontype=7
embed=0
n=$counter
!if $level=0
    R=$counter
!else
    R=$level
!endif
javascript=js/javainput.js
# produceerd een <tr>
XSIZE=650
smallfont=16
largefont=22
# applettext => letterlijke 
math=1
checkfile=$checkdir/simplify.proc

arglist=$empty
formula$n=$empty
letters=x,y,a,b,c,d,f,h,k,m,p,z
letters=!shuffle $letters
x=!item 1 of $letters
y=!item 2 of $letters
z=!item 3 of $letters
a=!randint 2,4
b=!randint 1,4
b=$[$a+$b]
c=!randitem -5,-3,-2,2,3,5
d=!randitem -8,-6,-4,4,6,8
question$n=!record 8 of lang/remarks.$taal
#@ herleid de volgende macht <br><font size=-1>dus schrijf anders</font>
sometext=!record 29 of lang/remarks.$taal
helptext=<a onmouseover="return escape('<img src=$module_dir/gifs/exo2.jpg>')">$sometext</a>
# var1 is used for checking  "literal typing" of question

!if $R=1
    var1=$x^$a/$x^$b
    tot=!exec pari $var1\
    printtex($var1)
    formula=\frac{$x^{$a}}{$x^{$b}}
    answer$n=!line 1 of $tot
    tex=!line 2 of $tot
    texanswer$n=$formula \rightarrow $tex
    varlist=!varlist $(answer$n)
    wims_rawmath_variables=$varlist
    applettext=$x^$a/($x^$b)=
    !if $wims_user=supervisor
	exotext=<font color=green>correct answer: $(answer$n)
    !endif
 !exit
!endif

!if $R=2
    a=$[-1*$a]
    var1=($c*$x^$a)/($d*$x^$b) 
    tot=!exec pari $var1\
    printtex($var1)
    formula=\frac{$c\cdot $x^{$a}}{$d\cdot $x^{$b}}
    answer$n=!line 1 of $tot
    tex=!line 2 of $tot
    texanswer$n=$formula \rightarrow $tex
    varlist=!varlist $(answer$n)
    wims_rawmath_variables=$varlist
    applettext=($c*$x^($a))/($d*$x^$b)=
    !if $wims_user=supervisor
	exotext=<font color=green>correct answer: $(answer$n)
    !endif 
 !exit
!endif


!if $R=3
    var1=($c*$x)^$a/$x^$b
    tot=!exec pari (($c*$x)^$a)/($x^$b)\
    printtex((($c*$x)^$a)/($x^$b))
    formula=\frac{\left($c \cdot $x \right)^{$a}}{$x^{$b}}
    answer$n=!line 1 of $tot
    tex=!line 2 of $tot
    texanswer$n=$formula \rightarrow $tex
    varlist=!varlist $(answer$n)
    wims_rawmath_variables=$varlist
    applettext=(($c*$x)^$a)/($x^$b)=
    !if $wims_user=supervisor
	exotext=<font color=green>correct answer: $(answer$n)
    !endif
 !exit
!endif

!if $R>3
    var1=($c*$x)^$a/($d*$x)^$b 
    tot=!exec pari (($c*$x)^$a)/(($d*$x)^$b)\
    printtex((($c*$x)^$a)/(($d*$x)^$b))
    formula=\frac{\left($c\cdot $x\right)^{$a}}{\left($d\cdot $x\right)^{$b}}
    answer$n=!line 1 of $tot
    tex=!line 2 of $tot
    texanswer$n=$formula \rightarrow $tex
    varlist=!varlist $(answer$n)
    wims_rawmath_variables=$varlist
    applettext=(($c*$x)^$a)/(($d*$x)^$b)=
    !if $wims_user=supervisor
	exotext=<font color=green>correct answer: $(answer$n)
    !endif
 !exit
!endif
