forcing to choose only two object by click
David McFarlane
mcfarla9 at msu.edu
Thu Mar 1 17:35:41 UTC 2012
Güzin,
I think the reason you do not get a response to
this question is because it is just too complex
for this type of forum. The short answer is, to
do what you want will take some careful, complex,
and intricate coding, which you will need to
figure out for yourself based on all the working
elements that you already have on hand (or hire
someone else to do it, if you could find such a
person). To take an analogy, if this were a
music writing forum, you might reasonably ask how
to transpose "Mary Had a Little Lamb" from
C-major to G-major. But aking how to rewrite
Beethoven's "Moonlight Sonata" in the style of
Rachmaninoff might not get a response.
But PST Web Support sometimes helps out with
complex projects like this, so you might try
contacting them at http://support.pstnet.com/e%2Dprime/support/login.asp .
---
David McFarlane
E-Prime training
online: http://psychology.msu.edu/Workshops_Courses/eprime.aspx
Twitter: @EPrimeMaster (twitter.com/EPrimeMaster)
At 3/1/2012 07:09 AM Thursday, you wrote:
>Hi, I have written before the same problem but I could not get any
>reply neither in pst forum (http://support.pstnet.com/forum/
>Topic5781-23-1.aspx) nor in googlegroups. I think I wrote a bit
>complicated with my limited English. I am writing again i a simple
>way.
>
>I have 8 checkboxes on a slide (checkboxes are an empty square image
>on the slide and named, Check1, Check2….. Check8).
>Participants must choose two of them for each trial by clicking on the
>checkboxes. When they click on a checkbox, it fill with black to show
>as it is checked. There are two correct checkboxes out of eight for
>each trial. But I want that participant must choose only two of the
>checkboxes and not being allowed to choose a third one. If they click
>on a third one their last selection will be disappear and replace with
>third click.
>How can I limit checking checkboxes to two while they could change
>their selections without exceeding two limit? My code is below;
>
>'Designate "theState" as the Default Slide State, which is the
>current, ActiveState
>'on the Slide object "Stimulus"
>Dim theState as SlideState
>Set theState = Stimulus.States("Default")
>
>'Variable for holding the name of the sub-object clicked by the
>subject.
>Dim strHit As String
>
>'Variable for holding the subject's response information.
>Dim theMouseResponseData As MouseResponseData
>
>'Was a response made?
>If Stimulus.InputMasks.Responses.Count > 0 Then
>
> Set theMouseResponseData =
>CMouseResponseData(Stimulus.InputMasks.Responses(1))
>
> strHit = theState.HitTest(theMouseResponseData.CursorX,
>theMouseResponseData.CursorY)
>
> 'If a check box was clicked, check or uncheck it based on its current
>state.
> If Mid(strHit, 1, 5) = "Check" Then
>
> 'Store the number of the checkbox clicked.
> Dim nCheck As Integer
> nCheck = CInt(Mid(strHit, 6, 1))
> Debug.Print nCheck
>
> If c.GetAttrib("Check" & nCheck
> & "Image") = "checkempty.bmp" Then
>
> c.SetAttrib "Check" &
> nCheck & "Image", "checkfull.bmp"
>
> 'If a box has
> been checked, log the RT and RESP.
>
> Else
>
> c.SetAttrib "Check" &
> nCheck & "Image", "checkempty.bmp"
> c.Setattrib "Check" & nCheck & "RESP", ""
>
>
> End If
> End If
>
> if c.GetAttrib("Check4Image")="checkfull.bmp" and
>c.GetAttrib("Check5Image")="checkfull.bmp" and
>c.GetAttrib("Check1Image")="checkempty.bmp" and
>c.GetAttrib("Check2Image")="checkempty.bmp" and
>c.GetAttrib("Check3Image")="checkempty.bmp" and
>c.GetAttrib("Check6Image")="checkempty.bmp" and
>c.GetAttrib("Check7Image")="checkempty.bmp" and
>c.GetAttrib("Check8Image")="checkempty.bmp" Then
> 'if strHit = "Check5" and strHit = "Check4" Then
> Stimulus.ACC = 1
>
> else Stimulus.ACC = 0
> End if
> If strHit <> "Next" Then
> Goto ChooseAgain
>
> End If
>
>End If
>
>Thank you
>Güzin
--
You received this message because you are subscribed to the Google Groups "E-Prime" group.
To post to this group, send email to e-prime at googlegroups.com.
To unsubscribe from this group, send email to e-prime+unsubscribe at googlegroups.com.
For more options, visit this group at http://groups.google.com/group/e-prime?hl=en.
More information about the Eprime
mailing list