Specify key press before proceding to the next trial
David McFarlane
mcfarla9 at msu.edu
Thu Oct 3 17:40:54 UTC 2013
Just off the top of my head...
First, to limit keyboard responses to 1-9, just set Allowable to
"123456789", or to "{NUMBER}", for your keyboard input mask -- see
the tutorial in the Getting Started Guide that came with E-Prime (and
while you are at it, work through *all* the tutorials in the User's
Guide), and see the "{key} nomenclature" topic in the E-Basic Help facility.
Then for your loop exit, in place of 'If strHit = "Result" Then' you
could use something like
If ((Stage1Word.InputMasks(1).RESP <> "") and (strHit = "Result")) Then
this assumes that InputMask(1) is your keyboard input mask, and
InputMask(2) is your mouse input mask, which from your code seems to
apply here.
-----
David McFarlane
E-Prime training
online: http://psychology.msu.edu/Workshops_Courses/eprime.aspx
Twitter: @EPrimeMaster (https://twitter.com/EPrimeMaster)
/----
Stock reminder: 1) I do not work for PST. 2) PST's trained staff
take any and all questions at https://support.pstnet.com , and they
strive to respond to all requests in 24-48 hours, so make full use of
it. 3) In addition, PST offers several instructional videos on their
YouTube channel (http://www.youtube.com/user/PSTNET ). 4) If you do
get an answer from PST staff, please extend the courtesy of posting
their reply back here for the sake of others.
\----
At 10/3/2013 12:01 PM Thursday, Deiniol Skillicorn wrote:
>Hello fellow eprimers,
>I have a task where participants are presented with cues and they
>must rate them on a 1-9 scale. They then get feedback.
><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
>
>I want participants to enter a digit and then move onto the next
>slide by pressing another button. Also, I only want them to be able
>to move on if they have entered a digit from 1 to 9.
>I am using the echoclient (on the Stage1word slide) so that
>participants can see the digit they are entering. I have read around
>and the mouse seems to be a good method to move onto the next slide.
>I have set up a text box at the bottom of the stage1word slide to
>act as a button and called the text box "result"
>Participants are able to enter a digit and proceed to the next
>trials unsing the mouse. However, they can also proceed to the next
>trial by NOT entering a reponse or by entering a response outside
>the specified range (i.e. 1-9).
> Here is the inline code I am using. I think I need to specifiy an
> if..then rule for numebrs thta have been logged but I have no idea how.
>Any suggestions would be appreciated
>
>Deiniol
>
> 'Designate "theState" as the Default Slide State, which is the
> 'current, ActiveState on the Slide object "Stimulus"
> Dim theState as SlideState
> Set theState = Stage1Word.States("Default")
> Dim strHit As String
> Dim theMouseResponseData As MouseResponseData
> Dim nResponseCount As Long
>
>Do While Stage1Word.InputMasks.IsPending()
> 'If the counts do not match, there are responses to process.
> If nResponseCount <> Stage1Word.InputMasks(2).Responses.Count Then
> nResponseCount = nResponseCount + 1
> 'Get the mouse response
> Set theMouseResponseData =
> CMouseResponseData(Stage1Word.InputMasks(2).Responses(nResponseCount))
> 'Determine string name of SlideImage or SlideText object at
> 'mouse click coordinates. Assign that value to strHit
> strHit = theState.HitTest(theMouseResponseData.CursorX,
> theMouseResponseData.CursorY)
> 'Compare string name where mouse click occurred to CorrectAnswer
> 'attribute on each trial, and score response
> 'NOTE: This comparison is case sensitive
> If strHit = "Result" Then
> 'Goto label2
> Stage1Word.InputMasks(1).Timeout
> Stage1Word.InputMasks(2).Timeout
> End If
> End If
>
>
>
> 'Give some time back (required)
>Sleep 10
>DoEvents
>Loop
--
You received this message because you are subscribed to the Google Groups "E-Prime" group.
To unsubscribe from this group and stop receiving emails from it, send an email to e-prime+unsubscribe at googlegroups.com.
To post to this group, send email to e-prime at googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/e-prime/524dac7a.3306320a.0eb7.09d5SMTPIN_ADDED_MISSING%40gmr-mx.google.com.
For more options, visit https://groups.google.com/groups/opt_out.
More information about the Eprime
mailing list