Hi,
Thank you for your enquiry.
You could probably achieve this without the use of script. Simply draw a horizontal vector line on the page to signify the path along which the 'slider' will travel, then create a frame or button (this will be the object which moves) at the left-hand edge of this line.
Now open the properties of the vector line, select the General tab and make a note of the object's width.
Now open the actions for the frame or button you created and apply an On Show trigger, followed by a Move Horizontal action. In the
Across field, input the width of the vector line and in the
Duration field, input the total time you would like to give the user to answer the question.
That should give you a functional slider, but there is currently no scoring mechanism. To create a countdown score mechanism, simply add the following actions to the page:
Code:
On Show
Loop while <countdown> > 0
Delay 1.00
Subtract 1.00 from <countdown>
You will need to create the <countdown> variable as a publication variable with a default value matching the total time you wish to allow the user to answer the question.
You can now display the countdown on the page by inserting the <countdown> variable into a text object.
You can now add the feedback elements of the quiz, such as 'Try Again' messages when the incorrect answer is selected, a 'Correct' message when the right answer is given (perhaps also displaying the score awarded) and a 'Time's Up' message for when the timer reaches zero.
I have supplied below a link to download a sample publication which demonstrates a completed question.
I hope this helps. Please do not hesitate to contact me if you have any further queries.
Kind regards,