Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently December 22nd, 2024, 7:04 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Using Slider as a timer
PostPosted: November 29th, 2004, 10:30 pm 
Offline

Joined: November 3rd, 2004, 8:05 pm
Posts: 22
Opus: Pro 9
OS: Windows 10 Home 64-bit
System: HP Spectre x360 Intel Core i7-8550U CPU @ 1.80GHz, 16Gb Ram
I am trying to create an educational quiz, where students receive more points the quicker they answer the question.

I thought it would be a good idea to show the timer visually - and thought about using a slider to illustrate it. However, I haven't mastered opuscript yet, and don't seem to be able to understand how a slider works - let alone change it to suit my needs!

Can anyone point me in the right direction?

Any help would be greatly appreciated - thanks


For this message staffam has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject:
PostPosted: November 30th, 2004, 11:15 am 
Offline

Joined: November 3rd, 2004, 2:35 pm
Posts: 117
Location: Swansea, South Wales
I used a frame inside a frame to create the slider. The inner frame sliding within the outer.

I then used a ticker trigger to move the inner down a certain amount per 'tick'.

So with a 300 pixel high frame being slid down 5 pixels per second you get a sort of sliding timer for 1 minute.

See example.


You do not have the required permissions to view the files attached to this post.


For this message leiafee has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject:
PostPosted: November 30th, 2004, 11:24 am 
Offline

Joined: October 25th, 2004, 12:27 pm
Posts: 526
Location: Digital Workshop
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,


You do not have the required permissions to view the files attached to this post.

_________________
Robin Garrett
Digital Workshop Technical Support


For this message Robin Garrett has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject:
PostPosted: November 30th, 2004, 7:57 pm 
Offline

Joined: November 3rd, 2004, 8:05 pm
Posts: 22
Opus: Pro 9
OS: Windows 10 Home 64-bit
System: HP Spectre x360 Intel Core i7-8550U CPU @ 1.80GHz, 16Gb Ram
Many thanks to both of you - exactly what I wanted to achieve :D


For this message staffam has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject: 2 minutes
PostPosted: January 26th, 2005, 11:43 am 
Offline

Joined: November 19th, 2004, 1:36 pm
Posts: 178
Location: Birmingham
How would one change it to display a time of 2 minutes as start, then countdown from there.. but not using 120 in the display.. but 2:00 then 1:59 etc..?


For this message Craig Gilman has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: 2 minutes
PostPosted: January 26th, 2005, 2:03 pm 
Offline

Joined: October 25th, 2004, 12:27 pm
Posts: 526
Location: Digital Workshop
Craig Gilman wrote:
How would one change it to display a time of 2 minutes as start, then countdown from there.. but not using 120 in the display.. but 2:00 then 1:59 etc..?


You could achieve this by creating two variables; 'mins' and 'secs', then using a series of looped actions to decrease the 'secs' variable by 1 after each second has elapsed. You would also need to incorporate If statements to decrease the 'mins' variable when 'secs' reaches zero (and set 'secs' back to 59). To ensure that the 'secs' variable shows the leading zero (i.e; displays 09, instead of just 9), you can use the String.format() function.

Please find below a link to download a modified publication which demonstrates this.

Kind regards,


You do not have the required permissions to view the files attached to this post.

_________________
Robin Garrett
Digital Workshop Technical Support


For this message Robin Garrett has been thanked by : mackavi


Top
 Profile Visit website  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot] and 78 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group