Rafael,
As an aside, Sandia National Labs has a Ravens-like stimulus set and
generating method that I am eager to turn into a PEBL test. I can't
distribute the copyrighted Raven's problems, but the workalike ones would
be fine.
The simplest and crudest way to 'abort' after 20 minutes is to do a check
of GetTime() against a global timestamp you record when the experiment
begins, and use SignalFatalError() to abort immediately. So, after the
instructions, you do:
gEndTime <- GetTime() + 20 * 60 * 1000 ##20 minute end time
and then, later you do
if(GetTime()>gEndTime)
{
SignalFatalError("Aborting because of timeout")
}
This will write the error message to the stderr.txt file, but the
participant won't see it. The problem is that it will abort abruptly;
ideally, you'd like the test to go to a final message screen telling
people they are done, and hopefully sending the data home.
What I do in cases like this is do a check after each trial. If you want
to use a loop() construct, you can do something like:
loop(i, stim)
{
......Trial code goes here
if(GetTime() > gEndTime)
{
break
}
}
or if you use a while loop:
cont <-1
while(cont)
{
.....Trial code goes here
if(GetTime()>gEndTime)
{
break
}
}
This will only check after each trial. You may also want to import that
into the trial code, so it will cut them off in the middle of a trial if
the time runs out. In that case, you can use one of the WithTimeout()
functions and make sure a timeout would happen when the clock runs out,
then check for the timeout signal and abort the trial, followed by the
experiment, with appropriate feedback about the time being complete. You
can also use a method like this to do a timer display that updates every
second.
For the second task, I'm not sure how to do that exactly, but I've used an
alternative with some success. To do exactly what you want, you could
include a separate binary file that you run using SystemCall(), or you
could open up a web browser to a specific web page which acts as a mail
gateway. But what I've done in the past is written a little client/server
code, and the experiment 'dials home' and uploads the data. This is much
easier than email, but it requires a lot to get it exactly right,
including a server with a public dns name or at least a static IP address,
and I've only done this with a Linux server. I can share this code with
you if you are interested. Actually, I have a server written in PEBL, and
another one that works similarly written in Python--the Python one is more
robust. The client code is actually buried in the launcher--there is a
button there about uploading data to server that I hope to support
someday. The transfer protocol is really simplistic (something like
sending the filename and the length followed by the data), but at least
the PEBL one will have trouble if you expect to have many people trying to
run/upload their data simultaneously. I did this with an at-home study of
crossword puzzle players, so I can share that experiment with you if you'd
like.
Shane
> Hello, all.
> I am PEBL-izing the Raven's APM and need help with two functions.
> I need one function that will end the program after a set cumulative time
> interval (like 20 minutes).
> The second one needs some explaining. I plan to do this experiment online,
> but will need the participants to complete this task (timed). I need a set
> of lines that will email the output file to me after the task is complete,
> so that the participant need only delete the program once they're
> finished.
> Thanks, Shane (who I assume will answer).
> Cheers,
> Rafael
> ------------------------------------------------------------------------------
> See everything from the browser to the database with AppDynamics
> Get end-to-end visibility with application monitoring from AppDynamics
> Isolate bottlenecks and diagnose root cause in seconds.
> Start your free trial of AppDynamics Pro today!
> http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk_______________________________________________
> Pebl-list mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/pebl-list
>
------------------------------------------------------------------------------
Get your SQL database under version control now!
Version control is standard for application code, but databases havent
caught up. So what steps can you take to put your SQL databases under
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk
_______________________________________________
Pebl-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pebl-list