How to define which areas can be clicked on a slide?

84 views
Skip to first unread message

Marie-France Larsson

unread,
Jun 24, 2014, 11:19:07 AM6/24/14
to e-p...@googlegroups.com

Hi!

I seem to have reached a deadend again. I cannot for the life of me figure out how to define which areas can be valid for a mouse click on a slide, in this case it should be on SlideImages and SlideImages only. The way it is now, a click anywhere on the slide will make the experiment go forward to the next trial. However, I would like the experiment to go forward only after the participant clicks on one of the SlideImages. A mouse click anywhere else on the slide should not have any effect. Is this something that I can fix with the "Duration/Input" settings in the slide's properties or will it require InLine code?

Thank you for your input!

Kind regards,
Marie-France

Paul Groot

unread,
Jun 24, 2014, 6:11:58 PM6/24/14
to e-p...@googlegroups.com


--
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+u...@googlegroups.com.
To post to this group, send email to e-p...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/e-prime/27cb52b9-e02a-4160-8873-9d5393596479%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Marie-France Larsson

unread,
Jun 26, 2014, 7:12:42 AM6/26/14
to e-p...@googlegroups.com
Hi Paul!
Thank you very much for the links, great examples! I had managed to log the answers with script that is a bit similar to the one found in your examples, but the problem that I have is that the pictures on my slide do not cover the entire canvas, meaning that participants can click beside a picture, and the experiment will still go forward, but without a valid answer in the log. Since my participants will be children, there is a high risk that they will click a bit randomly, and I want to avoid missing values as much as possible by making the rest of the canvas "unclickable". I am trying to build an If / Else statement to solve it, I'm not sure that's the best way to go, but hopefully it can work.
Regards,
Marie-France

Paul Groot

unread,
Jun 30, 2014, 5:05:45 AM6/30/14
to e-p...@googlegroups.com
Hi Marie-France,

I think this can be solved by modifying the exit condition of the ClickList (in my ImageSelectionExample script for example). By setting the number of cycles to a large number it is possible to accept multiple clicks withing one trial. Typically, the list would be exited after hitting a specific number of images. This can be done by calling the ClickList.Terminate function in the HandleClick inline as soon as the terminate condition is met. The ClickList will repeat as long as the Terminate function is not called, so this will solve the stray clicks. Note that every click (accepted or not) will add a new line to the edat output file.

Paul





victoria...@york.ac.uk

unread,
Sep 21, 2016, 4:57:11 AM9/21/16
to E-Prime
Hi Paul,

I'm trying to get EPrime to log the co-ordinates of a mouse click in edat. The inline is currently:



Dim theState As SlideState
Set theState = Card1.States("Default")

Dim strHit As String
Dim theMouseResponseData As MouseResponseData

If Card1.InputMasks.Responses.Count > 0 Then

Set theMouseResponseData = CMouseResponseData(Card1.InputMasks.Responses(1))

strHit = theState.HitTest(theMouseResponseData.CursorX, theMouseResponseData.CursorY)
If strHit = c.GetAttrib("CorrectAnswer") Then
    Card1.ACC = 1
Else
    Card1.ACC = 0
End If

End If

I think c.Log could be used here? Unfortunately your example scripts are no longer accessible through the links you posted above.

Thanks very much

Victoria

David McFarlane

unread,
Sep 21, 2016, 9:56:12 AM9/21/16
to e-p...@googlegroups.com
Victoria,

No, do not use c.Log -- that by itself will not add any attributes to
the log, it will only add another line to the log using the currently
defined attributes.

Instead, use c.SetAttrib. E.g.,

If strHit = c.GetAttrib("CorrectAnswer") Then
Card1.ACC = 1
Else
Card1.ACC = 0
End If
c.SetAttrib "Card1.ACC", Card1.ACC

-- David McFarlane
> --
> 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+u...@googlegroups.com.
> To post to this group, send email to e-p...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/e-prime/cd911bed-99db-45f3-8892-9cff55e6235e%40googlegroups.com.

Victoria Knowland

unread,
Sep 21, 2016, 11:28:59 AM9/21/16
to e-p...@googlegroups.com
Perfect- thank you David!


> To post to this group, send email to e-p...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/e-prime/cd911bed-99db-45f3-8892-9cff55e6235e%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "E-Prime" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/e-prime/rvpiFUuU7Fs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to e-prime+unsubscribe@googlegroups.com.

To post to this group, send email to e-p...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Dr Victoria Knowland
Department of Psychology
University of York
Heslington, York YO10 5DD UK

Office: Psychology, C127
Phone: 01904 324359   
Email: victoria...@york.ac.uk 
Reply all
Reply to author
Forward
0 new messages