Using mouse click to select one of several alternative responses

2,724 views
Skip to first unread message

Richard Carvey

unread,
Dec 19, 2011, 10:26:41 AM12/19/11
to E-Prime
Hi,

I'm trying to build an experiment in which nine items are displayed on
screen, and participants need to select one fo them using the mouse. I
have seen a couple of people mention issues with clicks anywhere on
screen being registered as responses, but I would like to make sure
that only clicks within the bounds of the nine items are accepted, and
that the specific item clicked is logged. Clicking any of the nine
items should advanc the program, no one answer is correct or
incorrect.

If anybody could offer me some advice on how to achieve this, it would
be greatly appreciated. Annoyingly, whoever installed E-Prime (1.2,
btw) on this computer saw fit not install the help functions correctly/
at all.

Thanks,

Richard

Paul Groot

unread,
Dec 19, 2011, 5:44:32 PM12/19/11
to e-p...@googlegroups.com
Hi Richard,

You might have a look at the VAS example script I posted a while ago
on http://pfcgroot.nl/e-prime/83-example-scripts/80-visual-analogue-scale-example-for-e-prime.html.
This example contains a bit more script then you need, but the
ACK_HandleResponse function (in the user script tab) demonstrates how
you can use boundaries of (text-)objects as hit area for mouse clicks.
The core of this piece of script uses the Mouse.GetCursorPos and
Object.HitTest functions to implement two user confirmation buttons.
It can be easily adapted for more buttons. Also, instead of using the
boundaries of a slide element (i.e. text or image), you can also make
your own hit-test function.

cheers,
Paul Groot

2011/12/19 Richard Carvey <supe...@googlemail.com>:

> --
> You received this message because you are subscribed to the Google Groups "E-Prime" group.
> To post to this group, send email to e-p...@googlegroups.com.
> To unsubscribe from this group, send email to e-prime+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/e-prime?hl=en.
>

Richard Carvey

unread,
Dec 20, 2011, 6:57:13 AM12/20/11
to E-Prime
Hi Paul,

Thanks for that. It looks like it makes sense to me, and should be
quite helpful. I'll have a crack at making it work after Christmas. I
appreciate the speedy reply though.

Thanks again,

Richard

On Dec 19, 10:44 pm, Paul Groot <pfc.gr...@gmail.com> wrote:
> Hi Richard,
>
> You might have a look at the VAS example script I posted a while ago

> onhttp://pfcgroot.nl/e-prime/83-example-scripts/80-visual-analogue-scal....


> This example contains a bit more script then you need, but the
> ACK_HandleResponse function (in the user script tab) demonstrates how
> you can use boundaries of (text-)objects as hit area for mouse clicks.
> The core of this piece of script uses the Mouse.GetCursorPos and
> Object.HitTest functions to implement two user confirmation buttons.
> It can be easily adapted for more buttons. Also, instead of using the
> boundaries of a slide element (i.e. text or image), you can also make
> your own hit-test function.
>
> cheers,
> Paul Groot
>

> 2011/12/19 Richard Carvey <superc...@googlemail.com>:


>
>
>
> > Hi,
>
> > I'm trying to build an experiment in which nine items are displayed on
> > screen, and participants need to select one fo them using the mouse. I
> > have seen a couple of people mention issues with clicks anywhere on
> > screen being registered as responses, but I would like to make sure
> > that only clicks within the bounds of the nine items are accepted, and
> > that the specific item clicked is logged. Clicking any of the nine
> > items should advanc the program, no one answer is correct or
> > incorrect.
>
> > If anybody could offer me some advice on how to achieve this, it would
> > be greatly appreciated. Annoyingly, whoever installed E-Prime (1.2,
> > btw) on this computer saw fit not install the help functions correctly/
> > at all.
>
> > Thanks,
>
> > Richard
>
> > --
> > You received this message because you are subscribed to the Google Groups "E-Prime" group.
> > To post to this group, send email to e-p...@googlegroups.com.
> > To unsubscribe from this group, send email to e-prime+u...@googlegroups.com.

> > For more options, visit this group athttp://groups.google.com/group/e-prime?hl=en.- Hide quoted text -
>
> - Show quoted text -

Richard Carvey

unread,
Jan 10, 2012, 6:59:29 AM1/10/12
to E-Prime
Hi Paul,

I've made use of that code, thanks. The only problem I'm having is
that a click outside of a target button still advances the program,
logging the response, but moving on to the next trial. Is there any
way you know of that I can set it so that a click outside of specified
areas (so an iACC = -1) doesn't do anything? Or perhaps so that it re-
loads the response screen for them to try again?

Thanks,

Richard

On Dec 19 2011, 10:44 pm, Paul Groot <pfc.gr...@gmail.com> wrote:
> Hi Richard,
>
> You might have a look at the VAS example script I posted a while ago
> onhttp://pfcgroot.nl/e-prime/83-example-scripts/80-visual-analogue-scal....
> This example contains a bit more script then you need, but the
> ACK_HandleResponse function (in the user script tab) demonstrates how
> you can use boundaries of (text-)objects as hit area for mouse clicks.
> The core of this piece of script uses the Mouse.GetCursorPos and
> Object.HitTest functions to implement two user confirmation buttons.
> It can be easily adapted for more buttons. Also, instead of using the
> boundaries of a slide element (i.e. text or image), you can also make
> your own hit-test function.
>
> cheers,
> Paul Groot
>
> 2011/12/19 Richard Carvey <superc...@googlemail.com>:
>
>
>
> > Hi,
>
> > I'm trying to build an experiment in which nine items are displayed on
> > screen, and participants need to select one fo them using the mouse. I
> > have seen a couple of people mention issues with clicks anywhere on
> > screen being registered as responses, but I would like to make sure
> > that only clicks within the bounds of the nine items are accepted, and
> > that the specific item clicked is logged. Clicking any of the nine
> > items should advanc the program, no one answer is correct or
> > incorrect.
>
> > If anybody could offer me some advice on how to achieve this, it would
> > be greatly appreciated. Annoyingly, whoever installed E-Prime (1.2,
> > btw) on this computer saw fit not install the help functions correctly/
> > at all.
>
> > Thanks,
>
> > Richard
>
> > --
> > You received this message because you are subscribed to the Google Groups "E-Prime" group.
> > To post to this group, send email to e-p...@googlegroups.com.
> > To unsubscribe from this group, send email to e-prime+u...@googlegroups.com.

Paul Groot

unread,
Jan 10, 2012, 1:51:40 PM1/10/12
to e-p...@googlegroups.com
Hi Richard,

I currently don't have an eprime license to check my own example, but
in general there are two way's of dealing with wrong-clicks:

1) put the relevant slide and script in separate list that loops
'forever' (i.e. putting a high number for the 'exit list after'
value). Then use the List.Terminate function to accept, stop the
sublist and continue.

2) Put a label before the relevant slide and use a goto-statement to
jump back to the label if IACC=-1. (i.e. if iACC=-1 then goto MyLabel)

I personaly don't like the goto-construct because one of the drawbacks
is that wrong selections are not logged automatically. However, the
use of an additional list takes a bit more effort to implement. I
think my example script is already using the repeating sublist because
the VasList is passed as third argument:

choice = ACK_HandleResponse(c, "VasAck", VasList)

But remember to set terminate condition of the sublist to a large
value in that case.

best,
paul

2012/1/10 Richard Carvey <supe...@googlemail.com>:

Al

unread,
May 8, 2017, 5:41:08 AM5/8/17
to E-Prime
Hi, 

I have the same issue as Richard. I am trying to get participants to click on one of the 8 possible options (text) in one slide. Unfortunately, the link provided by Paul does not seem to be available anymore (I knw, it was a few years ago..). Any chance someone could help? 

Thanks in advance. 

Alice
Reply all
Reply to author
Forward
0 new messages