User: jcordell

How to make a maths quiz dialplan

Below is a dialplan to make a maths quiz. This dial plan requiers swift voice synthisys which is not installed by default. You can replace the lines where this application is used with recordings of you own voice. Or you could use fastival.

Numbers are generated randomly between 1 and ten. You can make the quiz harder by increasing the range in the RAND function.


exten => s,1,Answer()
exten => s,n,Wait(.5)
exten => s,n,set(SUM=${RAND(1,10)})
exten => s,n,set(SUM1=${RAND(1,10)})
exten => s,n,swift(what is ${SUM} plus ${SUM1})
exten => s,n(getit),Read(TMP,,4,,2,4)
exten => s,n,set(RES=$${SUM}+${SUM1})
exten => s,n,Gotoif($${TMP} =${RES}?11,correct:12,wrong)

exten => 11,1(correct),Playback(yeah)
exten => 11,n,Goto(s,1)

exten => 12,1(wrong),playback(wrong-try-again-smarty)
;exten => 12,n,saydigits(${RES})
exten => 12,n,Goto(s,1)
 

Featured -

Search: