Please help! i need a timer for each question

so i need to make a basic math quiz, it must only use random numbers and symobols (±?*) it must not give negative numbers in its answers (its for 3-8yr olds) must only ask 10 questions and must have 3 levels with different time restarins on each. 1 unlimited time per question 2 20 sec per questions 3 10 seconds, this is what i have so far (please be kind its self taught in last 3 weeks) please help with how i can get the time (which fires straight away and counts down) to work per question i tried nesting ifs but i cant get it to work and been stuck over a week now :frowning:1

see the countdown example here App Inventor Tutorials and Examples: Countdown | Pura Vida Apps

Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun.

Please export and post your .aia file.

We need to see your Clock1 attributes and your
input facilities.

It would also help work up fixes.

heres the aia file hope this helps. im getting more confused. but thank you for the help
MoleMash.aia (2.0 MB)

I’ve looked through your project, and have some observations …

Your Screen handling is wasteful of yours and our time. Please see the Screens FAQ at FAQ Section: Screens and read the articles on many screens and why you shouldn’t open Screen1.

Retire your rubber stamp.

Your timing considerations can be handled by use of two extra global variables, all within the same screen:

  • Start game Instant (Clock1.SystemTime taken at start of session)
  • Session milliseconds End Deadline (Clock1.SystemTime plus session time limit (1 year for no limit)
  • Level number (for deciding to show the time limit or not)

Does your division problem generator need to be restricted to integer quotients?

Screen1 blocks Screen6 blocks

Screen2 blocks

P.S. The Project -> pulldown has a Save As option. Time to rename your project. It’s not Mole Mash.

thank you and yes we have to use different pages for each, and the math restrictions are must be whole number between 1-12 and * / must not have negitive answers.
i made a seperate screen for results but am retireing it as i can get it to show in the notification.
ignore pages 4/5 aswell as they are just copys i been trying to get them all working on one page first.

Is this just to give each team member something to do, or
is this for presentation purposes?

global operator

When would the operator change?

  • Once per level (all ‘+’ ?) ?
  • Once per question, regardless of level?

See attached for my take on problem generation, using a value procedure to build a random question and return it in a dictionary, augmented by value procedures to extract the 4 parts of a problem by name.

Division is clear of fractions. and there are no negative numbers.

I tidied up scoring a bit.

Your Notifiers are still a bit of a mess, since you don’t use the proper Notifier block to offer a yes/no choice (2 buttons), and you haven’t renamed the Notifier components to associate them with their questions (Play again?) (Got it, next question please).

All work was done in Screen3, infinite time, with Clock1 ignored.

Screen switching was changed to the close screen block, to avoid filling the Android stack. See the Screens FAQ at FAQ Section: Screens
All lone blocks are draggable.

answer global index global question global Score global timer MathMush.aia (2.0 MB) num1 num2 question

symbol when notifier1 AfterChoosing when notifier2 AfterChoosing Uploading: when Screen3 Initialize.png…when Screen3 Initialize

its just for the display purpose in the presintation, and the operator is supposed to change every question. thank you

so all i need todo now is get my timer working (20 seconds per questions on level 1)
can i still use my counter code i had previously?

Search in the Gallery for countdown apps. There are lots of them.

Did it work before?
What did it count?

yes it was counting the questions asked then it would pop up a message witht the final score.

As I recall, your move counter code was substantially correct, except for a little inefficiency.

You had a sequence

If answer is correct then

  • praise
  • increase score
  • increase move counter
  • get next question


  • complain
  • increase move counter
  • get next question

end if

I shortened it to …

If answer is correct then

  • praise
  • increase score


  • complain

end if
increase move counter
get next question

My version was equivalent, but shorter.

1 Like

i have read through almost all of the count down timers however i cannot get any to work withing my “question” function. all i need it to do is count down per question and reset when the question resets. i have tried adding the timer to the question and onto the next question button. but neither work. and thank you for all your advise

How did you try this Keith? Please show your Blocks where you try to start the timer and what happens when the timer reaches 0. Is the problem with your Blocks or your CountDown timer code?

Here is a simple count up timer (Button1 and Clock1) and a count down timer (Button2 and Clock2)

What you do in your app depends on when you want to start the count down.


is it possible to call a variable from one screen to another?
for instance your final score on screeen 3 then when the quiz is finished it directs you to screen 6 which displays your score?


Use TinyDB to transfer values across screens.

MathQuiz.aia (2.0 MB)
ok so i have taken everything into acount and i keep playing around with it but i can only get either the timer to tkae 1 off when i press the next button or the timer runs in background, i need it to count doen per question and repeat when the next question is loaded and continue until all 10 questions have been asked. (please see the test page as this is where the working code is). even y lecturers have no idea how to do this so hopefully im missing something silly

thank you all in advance