Weird script behaviour
Amy Eschman
amy.eschman at pstnet.com
Thu Jul 21 11:58:13 UTC 2005
Eddie,
The problem you are having is that when you Run an object from script as
opposed to on a Procedure, you must manually set the input properties.
The reason your script is working when your subject passes is because
you have placed the object on the Procedure following the InLine. You
need to add a line of script to your InLine that sets the input
properties for the EndPrac object prior to the EndPrac.Run command. The
easiest way to do this is to set the input properties as you want them
in the object, place it on the Procedure (which you have already done),
then compile the script. In the full script (Script option from the
View menu), search for "EndPrac.Input" (use Ctrl+F to open a search
window). Copy the entire line related to the InputMask setup for the
object and paste it into your InLine prior to the EndPrac.Run command.
For example, if I were doing this using the BasicRT example, I would
find the following line relevant to the Stimulus object, which is
collecting input in that experiment:
Stimulus.InputMasks.Add Keyboard.CreateInputMask("12",
c.GetAttrib("CorrectAnswer"), CLng(Stimulus.Duration), CLng("1"),
ebEndResponseActionTerminate, CLogical("Yes"), "", "", "ResponseMode:All
ProcessBackspace:Yes")
As an alternative to call the Run method from script, you could use two
different InLine objects before and after the EndPrac object. The
InLine before would be used to set the text, and the InLine after would
be used to jump back...
InLine Before.....
If Feedback.ACCStats.Mean > .90 Then
EndPrac.Text = "Press the space bar if you are ready for real
trials.\n\nIf you have questions, ask now."
Else
EndPrac.Text = "Your accuracy so far is <90%.\n\nPress the space
bar
for more practice."
Feedback.ACCStats.Reset
End If
InLine After....
If Feedback.ACCStats.Mean < .90 Then
Goto Label1
End If
This really doesn't save you much, but is simply a different option.
Hope this helps.
Amy Eschman
Psychology Software Tools
-----Original Message-----
From: eprime at mail.talkbank.org [mailto:eprime at mail.talkbank.org] On
Behalf Of Eddie Dubourg
Sent: Thursday, July 21, 2005 7:40 AM
To: eprime at mail.talkbank.org
Subject: Weird script behaviour
An experiment is being designed here, which has an accuracy test, if the
subject has less than 90% accuracy, the practice is rerun, using the
following inline object script - which you may recognise as being a
slightly
modified version of the the script from the User Guide (which didn't
work
either).
If Feedback.ACCStats.Mean > .90
Then
EndPrac.Text = "Press the space bar if you are ready for real
trials.\n\nIf you have questions, ask now."
Else
EndPrac.Text = "Your accuracy so far is <90%.\n\nPress the space
bar
for more practice."
Feedback.ACCStats.Reset
EndPrac.Run
Goto Label1
End If
Immediately after this scriptlet there is a text object (called EndPrac)
which displays the result, this is set up for infinite duration, Space
is
the allowable response. Now, if the subject passes, everything is fine,
and
the actual trials commence, but if the subject gets below 90%, pressing
the
space bar does absolutely nothing. If the duration is not set to
infinite,
it times out and goes to label1 quite happily (but if you give a
duration
suitably long to press the space bar, again it is not recognised) and
re-runs the trials.
Anyone have any bright ideas why processing the fail in the script
should in
some way stop the following text object recognising the space bar?
All the best
Eddie Dubourg
Computing/Technical Support Officer
Theoretical and Applied Linguistics
University of Edinburgh
More information about the Eprime
mailing list