Re: More Newby Questions

2006-01-17 Thread Devin Asay

Ben,

Check out the pendingMessages function and the cancel command. Used  
in tandem, they can cancel all, well, pending messages generated by  
the send in time command.


Devin

On Jan 16, 2006, at 4:02 PM, Ben Bock wrote:

I have a timed quiz spread across several cards, each card has a  
Next Page button.  The quiz starts with a button.


To start the quiz, a button has:

on mouseUp
startTimer

go next

end mouseUp


The card script has:


on startTimer

send timesUp to me in 120 seconds

end startTimer

on timesUp

go card Finish Card

end timesUp



This works, but..

If the person finishes the quiz before the timer, I want them to be  
able to stop the timer process.  Otherwise, the timer may run out  
and send them to the Finished card after they have begun another  
task, and cause confusion.


So I made a button on the last page page of the quiz, an I'm  
Finished button.  The variable Nevermind is sent by this button:


on mouseUp

  NeverMind

  go next

end mouseUp


I have tried adding statements to the stack script, like:

if NeverMind then exit timesUp



or



on Nevermind exit startTimer

end NeverMind



Also variations of these.  Nothing works when I move through it,  
the timer simply runs out and moves to the Finish Card.



Any help appreciated.

Thank you,

Ben


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your  
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-revolution



Devin Asay
Humanities Technology and Research Support Center
Brigham Young University

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: More Newby Questions

2006-01-16 Thread Dave Cragg

On 16 Jan 2006, at 23:02, Ben Bock wrote:

I have a timed quiz spread across several cards, each card has a  
Next Page button.  The quiz starts with a button.


To start the quiz, a button has:

on mouseUp
startTimer
go next
end mouseUp


The card script has:


on startTimer
send timesUp to me in 120 seconds
end startTimer

on timesUp
go card Finish Card
end timesUp



It's probably better to place these handlers in the stack script.  
(see below)


Here are two possible approaches:

1.

In the stack script:
---
local sTimerOn

on startTimer
put true into sTimerOn
send timesUp to me in 120 seconds
end startTimer

on timesUp
  if sTimerOn then
go card Finish Card
  end if
end timesUp

on NeverMind
  put false into sTimerOn
end NeverMind
--

2.

In the stack script:
---
local sTimerID

on startTimer
send timesUp to me in 120 seconds
put the result into sTimerID
end startTimer

on timesUp
go card Finish Card

end timesUp

on NeverMind
 cancel sTimerID
end NeverMind
--

In both cases, the two mouseUp handlers you currently have should  
work fine.


Note that it's important that the script local variables (sTimerID  
or sTimerOn) are declared outside the handlers. In this way they can  
be be shared by all the handlers in the stack script.


Cheers
Dave
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution