n=$counter
sometext=!record 53 of lang/remarks.$taal
#@ duurder,goedkoper,indexcijfer,kostte
helptext=$empty
kostte=!item 4 of $sometext
!if $level=0
    R=$counter
!else
    R=$level
!endif
tabel=$empty
antwoordtabel=$empty
tekst=$empty
mnd=!randitem $maand
jaar2=!date +%Y
jaar1=$[$jaar2-1]
jaar0=$[$jaar2-2]
# er zijn 41 artikelen in de lijst boodschappen.nl
PP=!shuffle 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41

!if $R=1
    options=5
    inputs=0
    choice=!record 67 of lang/remarks.$taal
    gelijk=!item 1 of $choice
    goedkoper=!item 2 of $choice
    duurder=!item 3 of $choice
    vraag=!randint 1,$options
    !for p=1 to $options
	inflatie=!randint 200,800
	pm=!randitem 1,-1
	!if $pm=1
	    stelling=!item 1 of $sometext
	!else
	    stelling=!item 2 of $sometext
	!endif        
	inflatie=$[$pm*$inflatie/100]
	pp=!item $p of $PP
	prod=!record $pp of lang/boodschappen.$taal
	product=!item 1 of $prod
	omschrijving=!item 2 of $prod
	pr=!randitem 3,4
	prijs0=!item $pr of $prod
	prijs1=$[(round(100*($prijs0+($inflatie*$prijs0/100))))/100]
	prijs2=$[(round(100*($prijs1+($inflatie*$prijs1/100))))/100]
	index1=$[(round(10000*$prijs1/$prijs0))/100]
	index2=$[(round(10000*$prijs2/$prijs0))/100]
	
	tabel=!append line <td>$product <em>( $omschrijving )</em></td><td>$index1</td><td>$index2</td><tr> to $tabel
	antwoordtabel=!append line <td>$product <em>( $omschrijving )</em></td><td>$index1 ($stelling)</td><td>$index2 ($stelling)</td><tr> to $antwoordtabel
	
	!if $p=$vraag
	    tekst=!record 54 of lang/remarks.$taal
	    #@ In $jaar0 $kostte <tt>$product</tt> <em>($omschrijving)</em> $prijs0 &euro;
	    prijzen=$prijs1,$prijs2
	    !if $prijs2 != $prijs0
		goedkoop=$pm
	    !else
		goedkoop=0
	    !endif    
	!endif
    !next p
    checkfile=$checkdir/multiplechoice.proc
    answer$n=$goedkoop
    ss=!record 55 of lang/remarks.$taal
    #@ Hieronder staat een tabel met indexcijfers op basis van <tt>$jaar0 = 100</tt><br>$tekst<br>Is dit artikel goedkoper of duurder geworden?<p>
    text=!record 72 of lang/remarks.$taal
    rr=!record 56 of lang/remarks.$taal
    #@<p><table $paperbg cellpadding="5" border="1" bgcolor="white"><th>produkt</th><th>indexcijfer<br>$mnd $jaar1</th><th>indexcijfer<br>$mnd $jaar2</th><tr>$antwoordtabel </table>
    question$n=$ss
    textanswer$n=$rr
    questiontype=0
    exotext=answer$n=$(answer$n) <center>$text <table><th><select name="reply$n"><option value="0">$gelijk</option><option value="-1">$goedkoper</option><option value="1">$duurder</option></select></th><th><input type="submit" style="$mybuttonstyle" value="$send"></th></table> 
 !exit
!endif

!if $R=2
    exotext=$empty
    cols=8
    rows=1
    questiontype=0
    rounding=100
    !readproc $remarkdir/rounding.$taal
    XSIZE=650
    inputs=3
    checkfile=exos/checkfile2.proc
    varlist=$empty
    arglist=$empty
    options=!randitem 2,3,4
    vraag=!randint 1,$options
    tt=!record 54 of lang/remarks.$taal

    !for p=1 to $options
	inflatie=!randint 200,800
	pm=!randitem 1,-1
	inflatie=$[$pm*$inflatie/100]
	pp=!item $p of $PP
	prod=!record $pp of lang/boodschappen.$taal
	product=!item 1 of $prod
	omschrijving=!item 2 of $prod
	pr=!randitem 3,4
	prijs0=!item $pr of $prod
	prijs1=$[(round(100*($prijs0+($inflatie*$prijs0/100))))/100]
	prijs2=$[(round(100*($prijs1+($inflatie*$prijs1/100))))/100]
	index1=$[(round(10000*$prijs1/$prijs0))/100]
	index2=$[(round(10000*$prijs2/$prijs0))/100]
	tabel=!append line <td>$product <em>( $omschrijving )</em></td><td>$index1</td><td>$index2</td><tr> to $tabel
	antwoordtabel=!append line <td>$product <em>( $omschrijving )</em></td><td>index: $index1 <br>&euro; $prijs1 </td><td>index: $index2<br>&euro;  $prijs2 </td><tr> to $antwoordtabel
	
	!if $p=$vraag
	    dit_artikel=$product
	    #@ In $jaar0 $kostte <tt>$product</tt> <em>($omschrijving)</em> $prijs0 &euro;
	    tekst=$tt
	    prijzen=$prijs1,$prijs2
	    verandering=$[(round(10000*($prijs2 - $prijs1)/$prijs1))/100]
	!endif
    !next p
    answer$n=$prijzen,$verandering
    options=3
    ss=!record 57 of lang/remarks.$taal
    rr=!record 58 of lang/remarks.$taal
    vv=!record 73 of lang/remarks.$taal
    change=!record 74 of lang/remarks.$taal
    question$n=$ss
    textanswer$n=$rr
    exotext=$vv
    inputtext1=$dit_artikel $jaar1 
    inputtext2=$dit_artikel $jaar2 
    inputtext3=$change
 !exit
!endif

!if $R=3
    rounding=10
    !readproc $remarkdir/rounding.$taal
    n=$counter
    checkfile=exos/checkfile2.proc
    options=!randitem 4,5,6
    inputs=0
    vraag=!randint 1,$options
    !for p=1 to $options
	inflatie=!randint 200,800
	pm=!randitem 1,-1
	inflatie=$[$pm*$inflatie/100]
	pp=!item $p of $PP
	prod=!record $pp of lang/boodschappen.$taal
	product=!item 1 of $prod
	omschrijving=!item 2 of $prod
	pr=!randitem 3,4
	prijs0=!item $pr of $prod
	prijs1=$[(round(100*($prijs0+($inflatie*$prijs0/100))))/100]
	index1=$[(round(10000*$prijs1/$prijs0))/100]
	answer$n=!append item $index1 to $(answer$n)
	antwoordtabel=!append line <td>$product <em>( $omschrijving )</em></td><td>$prijs0</td><td>$prijs1</td><td><input size="10" name=reply$n value="$index1" readonly></td><tr> to $antwoordtabel
	!if $wims_user=supervisor
	    tabel=$antwoordtabel
	!else
	    tabel=!append line <td>$product <em>( $omschrijving )</em></td><td>$prijs0</td><td>$prijs1</td><td><input size="10" name=reply$n></td><tr> to $tabel
	!endif
    !next p
    ss=!record 59 of lang/remarks.$taal
    rr=!record 60 of lang/remarks.$taal
    vv=!record 75 of lang/remarks.$taal
    question$n=$ss
    textanswer$n=$rr
    exotext=$vv <center><input type="submit" style="$mybuttonstyle" value="$send">
 !exit
!endif

!if $R>3
    rounding=10
    !readproc $remarkdir/rounding.$taal
    options=!randitem 4,5,6
    vraag=!randint 1,$options
    checkfile=exos/checkfile2.proc
    inputs=0
    !for p=1 to $options
	inflatie=!randint 200,800
	pm=!randitem 1,-1
	inflatie=$[$pm*$inflatie/100]
	pp=!item $p of $PP
	prod=!record $pp of lang/boodschappen.$taal
	product=!item 1 of $prod
	omschrijving=!item 2 of $prod
	pr=!randitem 3,4
	prijs0=!item $pr of $prod
	prijs1=$[(round(100*($prijs0+($inflatie*$prijs0/100))))/100]
	index1=$[(round(10000*$prijs0/$prijs1))/100]
	answer$n=!append item $index1 to $(answer$n)
	antwoordtabel=!append line <td>$product <em>( $omschrijving )</em></td><td>$prijs0</td><td>$prijs1</td><td><input size="10" name=reply$n value="$index1"  readonly></td><tr> to $antwoordtabel
	!if $wims_user=supervisor
	    tabel=$antwoordtabel
	!else
	    tabel=!append line <td>$product <em>( $omschrijving )</em></td><td>$prijs0</td><td>$prijs1</td><td><input size="10" name=reply$n></td><tr> to $tabel
	!endif
    !next p
    ss=!record 61 of lang/remarks.$taal
    rr=!record 62 of lang/remarks.$taal
    vv=!record 76 of lang/remarks.$taal
    question$n=$ss
    textanswer$n=$rr
    exotext=$vv <center><input type="submit" style="$mybuttonstyle" value="$send">
 !exit
!endif

