<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<font face="Georgia"></font>If you want to do it from the seaside
side, you could use Comet (the "self pusher" below).<br>
<br>
When the question is rendered, start a timer:<br>
<br>
startTimerProcess<br>
<br>
timerProcess := [<br>
[<br>
(Delay forSeconds: howLong) wait.<br>
self pusher javascript: [ :script |<br>
script << (script jQuery: #whatsHisName) load
html: [ :h | ...update with new content...]<br>
].<br>
].<br>
timerProcess := nil.<br>
] forkAt: Processor userBackgroundPriority.<br>
<br>
<font face="Georgia">If the timer expires, the<br>
<br>
</font> script << (script jQuery: #whatsHisName)
...update with new content...<br>
<br>
could move to the next question. If the user answers before the time
expires, then kill the timer and start a new one (if needed)<br>
<br>
timerProcess terminate.<br>
timerProcess := nil.<br>
self startTimerProcess.<br>
<br>
Cheers,<br>
Bob<br>
<br>
On 9/18/10 11:44 AM, Alberto Bacchelli wrote:
<blockquote cite="mid:4C94DE73.2090509@usi.ch" type="cite">Hi,
<br>
<br>
I am trying to implement a sort of questionnaire.
<br>
There is one question per "page" (each page is simply
<br>
a div element that is rendered or not), and each page
<br>
has a time limit.
<br>
<br>
This means that I would like to show an ajax countdown in the
<br>
page, and I want to automatically change the page when the
<br>
time expires.
<br>
<br>
I have no idea on how to implement this,
<br>
since in my opinion it would involve a separate
<br>
thread that takes care of the timing issue.
<br>
And I wouldn't know what's the way to deal with
<br>
threads in seaside.
<br>
<br>
Do you have any pointer/suggestion for me?
<br>
<br>
Thank you,
<br>
Alberto
<br>
_______________________________________________
<br>
seaside mailing list
<br>
<a class="moz-txt-link-abbreviated" href="mailto:seaside@lists.squeakfoundation.org">seaside@lists.squeakfoundation.org</a>
<br>
<a class="moz-txt-link-freetext" href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a>
<br>
<br>
</blockquote>
</body>
</html>