!!!!!!  questions / rponses sur les petits calculs
!!!!! lu par var.init

!!!!!if $mode=0

!!! questions dans un ordre alatoire

nbsteps=4
ind=!shuffle 8
ind=!item 1 to 4 of $ind
questions=
reponses=
forms=


!for i in $ind
!goto Q$i

:Q1
!!!! question 1
!if $niv=2
t=!randint  1, 1000
t=$[$t/100]
!else
t=!randint  10, 500
t=$[$t/10]
!endif

quest=<br/>Prlever $t&nbsp;% d'une quantit Q c'est en prendre une part gale  
form=  $m_times Q.
forms=!append line $form to $forms
questions=!append line $quest  to $questions
cm=$[0.01*$t]
reponses=!append line $cm to $reponses
!goto NEXT

!!!! question 2 : du pourcentage au CM

:Q2
!if $niv=2
t=!randint  1, 1000
t=$[$t/100]
!else
t=!randint  10, 500
t=$[$t/10]
!endif
de=!randint 1,2
var=!item $de of Augmenter,Diminuer
sign=!item $de of +,-
quest=<br/> $var une quantit Q de $t&nbsp;%  c'est obtenir une quantit  gale 
questions=!append line $quest to $questions
form=  $m_times Q.
forms=!append line $form to $forms
cm=$[1 $sign 0.01*$t]
reponses=!append line $cm to $reponses
!goto NEXT

:Q3
!!!! question 3 : prlvements successifs
!if $niv=2
t=!randint  100, 1000
t=$[$t/100]
t2=!randint  100, 1000
t2=$[$t2/100]
!else
t=!randint  10, 500
t=$[$t/10]
t2=!randint  10, 500
t2=$[$t2/10]
!endif

quest=<br/>On prlve d'abord $t&nbsp;% d'une quantit Q ; de cette part on  prlve ensuite  $t2&nbsp;%. <br/>   
quest2=  Le second prlvement est une quantit gale  C $m_times Q, o C =
questions=!append line $quest $quest2  to $questions
cm=!exec pari 0.001*round(0.1*$t*$t2)
form= (arrondi au millime).
reponses=!append line $cm to $reponses
forms=!append line $form to $forms
!goto NEXT

!!!! question 4 : CM d'evolutions successives 
:Q4
!if $niv=2
t=!randint  100, 1000
t=$[$t/100]
t2=!randint  100, 1000
t2=$[$t2/100]
!else
t=!randint  10, 500
t=$[$t/10]
t2=!randint  10, 500
t2=$[$t2/10]
!endif
de=!randint 1,2
var1=!item $de of augmente,diminue
sign1=!item $de of +,-
de=!randint 1,2
var2=!item $de of augmente,diminue
sign2=!item $de of +,-
cm=

quest=<br/>Une quantit Q $var1 d'abord de $t&nbsp;% ; ensuite elle $var2  de $t2&nbsp;%. <br/>   
quest2= On obtient finalement  une quantit gale  C $m_times Q, o C = 
questions=!append line $quest $quest2  to $questions
form=  (arrondi au millime).
cm=$[(1 $sign1 0.01*$t)*(1 $sign2 0.01*$t2)]
cm=!exec pari 0.001*round(1000*(1 $sign1 0.01*$t)*(1 $sign2 0.01*$t2))
reponses=!append line $cm to $reponses
forms=!append line $form to $forms
!goto NEXT

:Q5
!!!! question 5 - compenser une evolution
!if $niv=2
t=!randint  1, 1000
t=$[$t/100]
!else
t=!randint  10, 500
t=$[$t/10]
!endif
de=!randint 1,2
var=!item $de of augment,diminu
sign=!item $de of +,-
inv=!item $de of -,+
cm=$[100 - 100/(1 $sign 0.01*$t)]
!if $de=2
cm=$[-$cm]
!endif

quest=<br/>Une quantit a  $var de $t&nbsp;%. 
quest2= Pour qu'elle revienne  sa valeur initiale elle devrait  subir  une
form= qcm, (arrondi au centime).
questions=!append line $quest  $quest2 to $questions
cm=!exec pari 0.01*round(100*$cm)
reponses=!append line $cm,$inv to $reponses
forms=!append line $form   to $forms
!goto NEXT

:Q6
!!!! question 6 - du CM au pourcentage
x=!randint  1, 1000
x=$[$x/100]
cm=$[0.01*$x]
quest=<br/>D'une quantit Q on a prlev une part gale  $cm $m_times Q. <br/>La part prleve reprsente
form=  &nbsp;%  de Q. 
questions=!append line $quest to $questions
reponses=!append line $x to $reponses
forms=!append line $form to $forms
!goto NEXT

:Q7
!!!! question 7 - du CM au pourcentage d'vol
!if $niv=2
t=!randint  1, 1000
t=$[$t/100]
!else
t=!randint  10, 500
t=$[$t/10]
!endif
de=!randint 1,2
sign=!item $de of +,-
cm=$[1 $sign 0.01*$t]

quest=<br/>Une quantit a t multiplie par $cm. Elle a donc subi une 
form=qcm, %
questions=!append line $quest  to $questions
reponses=!append line $t, $sign to $reponses
forms=!append line $form  to $forms
!goto NEXT

!!!!!!!!!!!!

:Q8
!!!! question 8 - augmenter de n*100%
cm=!randint  1, 9
t=$[($cm-1)*100]
quest=<br/>Une quantit a t multiplie par $cm. Elle a donc augment de
form= %
questions=!append line $quest  to $questions
reponses=!append line $t to $reponses
forms=!append line $form  to $forms
!goto NEXT

:NEXT
!next i


!!!! fin de la boucle de choix des 4 questions

!!!!!!endif
!!!! endif MODE 0