Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently December 23rd, 2024, 4:03 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 15 posts ] 
Author Message
 Post subject: Clock Timer in Quizz
PostPosted: February 4th, 2010, 5:44 am 
Offline

Joined: December 13th, 2008, 3:15 pm
Posts: 152
Location: Brasil
Opus: 7
OS: Windows 7 x64
System: Asus P5Q3 Deluxe, Core 2 Duo E8500, 8 Gb DDR3 1333 mhz, His IceQ5 5770 HD Graphic Card, Samsung T220 Monitor; Lenovo G550 T6600, 4 GB DDR3 - 15,6".
After reading some topics and downloading various clocks and timers of this forum, I implemented the clock in my project.

Thanks to valuable tips from friends, I circled several possible problems. Even so, I am struggling with the script in two situations.

How to implement in the navigation of the pages ( back and forward buttons) one script to check out the clock and if it equals or exceeds the limit, the publication goes to the final page of the test (I put two minutes as an example, but I think the syntax may not be correct)?
And if the time limit has not been reached yet, the User can navigate through the pages without problems, thanks to the command entered in else ...

Before inserting this script to check the timeout, the script to pause and resume the clock in the change of pages operated without problems. The biggest problem occurs when the User returns to page 1, because the clock back to the initial 00:00 and is stopped.

How to prevent this, after all the User must navigate freely through the pages and your only limitation should be the timeout, when it is submitted, the final page (Scr_End).

Then again, I ask the help of partners in solving these problems.


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

_________________
"To the ignorant, old age is the winter of life, for the wise, is the season of harvest."
It is not easy to translate the world into a binary code of 0s and 1s, but in scripts, anything is possible!


Top
 Profile  
 
 Post subject:
PostPosted: February 4th, 2010, 8:07 am 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
Hi Nillson,

There are more problem items than I can spend time right now.

First, I recommend that when you have narrowed down a problem/action to a specific script... post some or all of that code here in a code-box. Good that you posted your work-in-progress pub, but I for one will not take time to access it today. If someone sees your Code, they may readily spot a 'fix' for you.

Second, the Clock Object. Check out this post.
viewtopic.php?t=2922&highlight=clock+object
Also, do a search on clock object (both terms).

You could create a Student Timer and Control without using a clock object. Search forum for some combination of these terms: quiz timer countdown time-lapse elapsed etc. etc. I am positive there are numerous examples to download too.

_________________
_good things come to those who wait(0)_


Top
 Profile  
 
 Post subject: Problematic scripts...
PostPosted: February 4th, 2010, 4:10 pm 
Offline

Joined: December 13th, 2008, 3:15 pm
Posts: 152
Location: Brasil
Opus: 7
OS: Windows 7 x64
System: Asus P5Q3 Deluxe, Core 2 Duo E8500, 8 Gb DDR3 1333 mhz, His IceQ5 5770 HD Graphic Card, Samsung T220 Monitor; Lenovo G550 T6600, 4 GB DDR3 - 15,6".
Lar_123, thanks for the tips.

When I downloaded a few some examples of clocks (there is one that you posted, in particular, that helped me with the scripts) also saw some examples of countdowns.

Really, a countdown would do, if there was a need for the test show, in the final page as long as the User has led to resolve all issues. The clock, stuck to scripts enables better control over time spent on the page than just a traditional countdown, or am I wrong?

So I'll post the the scripts used on the first page and addition to the code used in the navigation buttons.

- Script of clock in the page 01 -
Code:
myClock = CreateClock("ScriptClock","clock_var","[mm]:[ss]")
if (myClock != null)
{
  clock_var = myClock;
}
myClock.Start()

else (myClock !> 0)
{
  clock_var = myClock;
}
myClock.Continue()


First problem:
This code on page 01 creates the clock and starts the same. The problem is from else in code, because if the User back into the first page, the clock is already counting the time returns to zero and is stopped.
Without else code, the clock seems to be recreated again, restart from zero, when the User returns to the first page.

Now the code navigation buttons on the page. How to set a time limit correct, so that if it is reached, the User go to the final page, otherwise, go to next page of the test.

- script in forward button -
Code:
myClock.Pause()

if (myClock >= "02:00")
{
  clock_var = myClock;
}
  GotoPage("Scr_End")
else
{
  GotoForwardPage()
}


What horrible script, is not it? Everything good about pause the clock when changing page because a script on the next page does the clock continue, but the rest ...

Instead of going to the next page, the User drops the final page and end of game! Terrible!

How to fix it, so that the timeout to be recognized and publication take the User to the final page? If the timeout is not reached, the User is the next page or return to earlier, as the button is clicked.

As suggested by you, will be checking the pots with clock objects while I wait aid of the noble companions.

_________________
"To the ignorant, old age is the winter of life, for the wise, is the season of harvest."
It is not easy to translate the world into a binary code of 0s and 1s, but in scripts, anything is possible!


Top
 Profile  
 
 Post subject:
PostPosted: February 4th, 2010, 6:42 pm 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Nilson,

I started to look at and fix this problem, but your imp has bits of script all over the place that cause it to fail - you need to remove these before continuing. Start with the on-show (page) that cause the page to skip to the end.

As for the code try this:

myClock.Pause()

if (clock_var >= "02:00")
{
GotoPage("Scr_End")
}
else
{
GotoForwardPage()
}


You'll need to adjust the backwards button as well. Update the imp and reposted when working an I'll look at the start page problem.

Mack

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
 Post subject: It doens't work...
PostPosted: February 6th, 2010, 8:33 pm 
Offline

Joined: December 13th, 2008, 3:15 pm
Posts: 152
Location: Brasil
Opus: 7
OS: Windows 7 x64
System: Asus P5Q3 Deluxe, Core 2 Duo E8500, 8 Gb DDR3 1333 mhz, His IceQ5 5770 HD Graphic Card, Samsung T220 Monitor; Lenovo G550 T6600, 4 GB DDR3 - 15,6".
Mack, the publication goes is the end why the script does not work! Not the way this it, or the way you put it, changing the variable name. Whether the script is attached to OnShow of the page or the next and back button (which in my view would be ideal), the publication goes to the final page.

I believe the script of the clock is not built correctly, or the need to create a variable to check the time on the clock and if it equals or exceeds the limit, lead to publication until the final page. But have not found a correct way to do this. I need a light here...

_________________
"To the ignorant, old age is the winter of life, for the wise, is the season of harvest."
It is not easy to translate the world into a binary code of 0s and 1s, but in scripts, anything is possible!


Top
 Profile  
 
 Post subject:
PostPosted: February 6th, 2010, 11:00 pm 
Offline

Joined: November 11th, 2004, 4:05 am
Posts: 636
Location: Christchurch, NZ
The pub has script errors on every page that should be repaired before you ask for help...
The script errors are very basic; Learn how to fix basic errors yourself.

The example pub you are working with was not designed to be modified unless you know what you are doing. I suggest you learn more about scripting before you attempt to modify it;

You are making people who want to help waste their time...

Paul


Top
 Profile  
 
 Post subject: Sorry guys...
PostPosted: February 6th, 2010, 11:19 pm 
Offline

Joined: December 13th, 2008, 3:15 pm
Posts: 152
Location: Brasil
Opus: 7
OS: Windows 7 x64
System: Asus P5Q3 Deluxe, Core 2 Duo E8500, 8 Gb DDR3 1333 mhz, His IceQ5 5770 HD Graphic Card, Samsung T220 Monitor; Lenovo G550 T6600, 4 GB DDR3 - 15,6".
Ok, Paul... sorry. This is not my intention...

Work of a newbie...

I will pay more attention in these scripts of pages and try fix the errors...

I'll post a new file here, as soon as I rewrite these scripts ...

Thanks!

_________________
"To the ignorant, old age is the winter of life, for the wise, is the season of harvest."
It is not easy to translate the world into a binary code of 0s and 1s, but in scripts, anything is possible!


Top
 Profile  
 
 Post subject:
PostPosted: February 6th, 2010, 11:35 pm 
Offline

Joined: November 11th, 2004, 4:05 am
Posts: 636
Location: Christchurch, NZ
With regard to the syntax errors in the on-show scripts::

This line is wrong::

else (myClock !> 0)

Should be::

else (myClock != 0)

That will fix the syntax error; Opusscript does not use "!>"

Syntax errors are those errors Opus tells you about under the script editor window. This is not the same as run-time errors, which show up when you try to run the pub.
Sometimes the best way to find these is to learn how to use the script console and Debug.trace statements...

Paul


Top
 Profile  
 
 Post subject: A last problem...
PostPosted: February 6th, 2010, 11:56 pm 
Offline

Joined: December 13th, 2008, 3:15 pm
Posts: 152
Location: Brasil
Opus: 7
OS: Windows 7 x64
System: Asus P5Q3 Deluxe, Core 2 Duo E8500, 8 Gb DDR3 1333 mhz, His IceQ5 5770 HD Graphic Card, Samsung T220 Monitor; Lenovo G550 T6600, 4 GB DDR3 - 15,6".
Paul, thanks for the patience and the ear pull!

Thanks to your advice, I fix the script of pages and navigation buttons.
Guy, I nothing ever fixed a error so fast!!!

Now the time of the publication is set and can not jump over to the final page before the time limit is reached! Amazing!!!

But one question still remains:

How to avoid that the clock is reset back to zero when the User returns to the first page? I do not know how, did not find any post that addressed the subject, nothing in opusscript help ...

Following is the script on the first page, for suggestions ...

Code:
myClock = CreateClock("ScriptClock","clock_var","[mm]:[ss]")
if (myClock == null)
{
  clock_var = myClock;
}
  myClock.Start()
else
{
  myClock.Continue()
}

_________________
"To the ignorant, old age is the winter of life, for the wise, is the season of harvest."
It is not easy to translate the world into a binary code of 0s and 1s, but in scripts, anything is possible!


Top
 Profile  
 
 Post subject:
PostPosted: February 7th, 2010, 1:48 am 
Offline

Joined: November 11th, 2004, 4:05 am
Posts: 636
Location: Christchurch, NZ
The script you posted has another syntax error...
an else is supposed to be used ALONE between two brackets like this:

}
else
{

try this...

/********************************************/
myClock = CreateClock("ScriptClock","clock_var","[mm]:[ss]");

if (myClock == null)
{
clock_var = myClock;
myClock.Start();
}
else
{
myClock.Continue();
}
/********************************************/

Paul


Top
 Profile  
 
 Post subject: Not work...
PostPosted: February 7th, 2010, 5:05 pm 
Offline

Joined: December 13th, 2008, 3:15 pm
Posts: 152
Location: Brasil
Opus: 7
OS: Windows 7 x64
System: Asus P5Q3 Deluxe, Core 2 Duo E8500, 8 Gb DDR3 1333 mhz, His IceQ5 5770 HD Graphic Card, Samsung T220 Monitor; Lenovo G550 T6600, 4 GB DDR3 - 15,6".
Thanks for the tip, Paul. Again my lack of attention ...

Unfortunately it did not work. In this script, the clock will not start.

I tried to change the script, but I believe there is no solution for it.

It seems that this first page, the clock will always be initialized in zero,

because of the first lines of the script and I can not find a way to avoid this.

Logically, if the clock already exists, and the user goes back to the page 01, to there should be some command or script

to check the clock time is greater than the start point (zero)

and keep running it. I do not know how to solve this ...

I look forward suggestions on the best way to make this script working, avoiding the clock stopped in the initial value

Code:
myClock = CreateClock("ScriptClock","clock_var","[mm]:[ss]")
if (myClock == null)
{
  clock_var = myClock;
}
  myClock.Start() //Create and inicializate the clock

if (myClock >= "00:02")
{
  clock_var = myClock;
}
  myClock.Continue() //continue clock if user goes back to the page 01

_________________
"To the ignorant, old age is the winter of life, for the wise, is the season of harvest."
It is not easy to translate the world into a binary code of 0s and 1s, but in scripts, anything is possible!


Top
 Profile  
 
 Post subject:
PostPosted: February 7th, 2010, 8:20 pm 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
Quote:
Logically, if the clock already exists, and the user goes back to the page 01, to there should be some command or script to check the clock time is greater than the start point (zero) and keep running it. I do not know how to solve this ... I look forward suggestions on the best way to make this script working, avoiding the clock stopped

Older post had some comments about 'leaving' a page and returning... more about how Opus handles the clock object.: viewtopic.php?t=2922&highlight=clock+timer
(I do not use Clock objects, so I cannot assess the advice and approach discussed there... but you may find something that helps.)


Code:
  clock_var = myClock;

Two comments.
First clock_var is a variable, and myClock is an object. You could 'monitor' this in a Debug.trace statement... to see what value if any gets set into 'clock_var'.

Second. For your code in your last post, you have two IF conditions that execute exactly the same expression. Why? (as I read the code, the clockobject.Start() and the clockobject.Continue() will BOTH be executed since they are outside the IF statement's control.)

_________________
_good things come to those who wait(0)_


Top
 Profile  
 
 Post subject: Time Publication
PostPosted: February 19th, 2010, 1:03 pm 
Offline

Joined: December 13th, 2008, 3:15 pm
Posts: 152
Location: Brasil
Opus: 7
OS: Windows 7 x64
System: Asus P5Q3 Deluxe, Core 2 Duo E8500, 8 Gb DDR3 1333 mhz, His IceQ5 5770 HD Graphic Card, Samsung T220 Monitor; Lenovo G550 T6600, 4 GB DDR3 - 15,6".
Okay, guys. I resolved this by putting the script in a clock home. Thus, the creation script of the clock does not interfere in subsequent pages.

Now I'm battling a way to manage the time of this clock to the end of a specified time, say, 30 minutes, the test will go the final page of results. I put a script on the navigation buttons that checks the time clock and if it is less than the 30 minutes, the User will the results page ...

But I needed a way to check this time limit was more dynamic, without the intervention of the User clicks. I tried the following script.

Code:

if (clock_var >= "30:00")
{
   GotoPage("Scr_End")
}
else
{
   myClock.Continue()
}



It did not work. I also tried to create a variable for the publication, working on your test of it. The problem here is that the pub variable,
controlled by a ticker, restart when I change the page of the publication.
How to solve this?

_________________
"To the ignorant, old age is the winter of life, for the wise, is the season of harvest."
It is not easy to translate the world into a binary code of 0s and 1s, but in scripts, anything is possible!


Top
 Profile  
 
 Post subject:
PostPosted: February 22nd, 2010, 1:32 pm 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
Quote:
The problem here is that the pub variable, controlled by a ticker, restart when I change the page of the publication.

Yes of course this (restart) will happen as most standard actions and their triggers are associated with Pages, or certain objects on Pages. I suppose there are exceptions and ways to structure to not restart... a discussion on just that and on persistence... could take awhile.

One possible approach in the case of your Ticker action could be to launch another small Window -- this can be done so that you have TWO VIEWS open simultaneously. Caveat: I have not tried this for Ticker, so you'll just have to work through it. But the Views themselves are real simple... basically have a separate Chapter to hold that 'small' page and you can specify its location on the PC display, can specify which View is "in front".

You may have to Close one or both views by issuing specific action or command to do so.

BTW, it's possible your Scripting approach could be run in that second View (instead of using the Ticker). Also you could set-up your Clock object methods there too. Lots of possibilities.

_________________
_good things come to those who wait(0)_


Top
 Profile  
 
 Post subject: Thanks, this works...
PostPosted: February 23rd, 2010, 7:22 pm 
Offline

Joined: December 13th, 2008, 3:15 pm
Posts: 152
Location: Brasil
Opus: 7
OS: Windows 7 x64
System: Asus P5Q3 Deluxe, Core 2 Duo E8500, 8 Gb DDR3 1333 mhz, His IceQ5 5770 HD Graphic Card, Samsung T220 Monitor; Lenovo G550 T6600, 4 GB DDR3 - 15,6".
Thanks, Lar ...

Actually, his idea worked. I can take the time of publication while the user change the pages, and reached the set time, the variable takes the publication to the final page.

Best of all is that I don't leave the publication to start a new test, because the way the variable operation was placed in the new window, it stays as it is convenient.

Thanks again for the great idea!

_________________
"To the ignorant, old age is the winter of life, for the wise, is the season of harvest."
It is not easy to translate the world into a binary code of 0s and 1s, but in scripts, anything is possible!


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 45 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