0 votes

I want to ask a question with countdown and be able to validate submitted answer.
If answer is in invalid format, I want countdown to continue, and show prompt asking to enter answer in correct format.
Also, if countdown reaches zero, I would like to detect it and just skip the question.

I have tried various things, but counter will reset if i do anything like this:

*label: start

*question: Is thing?
    *countdown: 10.seconds
    *save: answer
    *if: not (sub program checking if answer is valid - I can implement this)
        Format is WRONG!
        *goto: start

        --dont know how to implement this
      *if: not answer.size = 0 BUT times is up:
            TOO SLOW
    --following is documented way to check for times up, but not sufficient for above case
     *if: answer.size = 0
            TOO SLOW, 
            *goto: end

In addition to that, it does not work, if countdown reaches zero, but there is non empty answer in textbox, because "answer.size = 0" will not be true. And I don't know how to workaround that.

Thanks for answers.

by (150 points)
reshown by

1 Answer

+1 vote
Best answer

Hello! I think you might be able to use GuidedTrack's calendar::now function to make sure the countdown continues correctly (i.e., with the time that the user had left when they submitted an incorrect answer). Here's some code that should hopefully do what you're aiming to do: https://www.guidedtrack.com/programs/15878/edit - I hope that helps, but please do let me know if you had something else in mind. Thanks!

by (620 points)
selected by

thanks, I completely missed calendar functionality in documentation.
It can be used to solve my second question as well.

Thank you! I'm very glad this was helpful!! :)

Welcome to Guidedtrack Q&A, where you can ask questions and receive answers from other members of the community.
123 questions
133 answers
205 users