changing border color of a slide image after clicking on it
haslinger.hans11 at gmail.com
haslinger.hans11 at gmail.com
Wed Oct 9 14:23:03 UTC 2013
Hallo everybody
At the moment I am programming a multiple choice test.
In this test, there is a Stimulus (a slide image) and 4 possible answers
(slide images) given.
The subjects have to choose one of the 4 answers by clicking on it.
At the same time there is a sound-file presented, which is a little story
describing the stimulus-image.
The subjects can answer until the complete story is presented.
So far it was no huge problem for me.
But now i want to highlight the given answer by changing the border color
of the slide image that has been clicked.
By now I could only accomplish, that the border color changes in the
following slide state but not in the current one.
I also didn't accomplish, that the border color changes back to the
original color in the next slide states.
I hope you understand what my Problem is and could give me a hand.
Best regards
Hans
Here is the inline code I produced so far (the green part is what i've
tried by myself to solve my problem. The rest of the code works fine so
far):
Dim theState as SlideState
Set theState = ExternalCausesSlide.States("Default")
Dim next_mX as Long, next_mY as Long
Dim strHit As String
Dim theMouseResponseData As MouseResponseData
'Was there a response?
If ExternalCausesSlide.InputMasks.Responses.Count > 0 Then
'Get the mouse response
Set theMouseResponseData =
CMouseResponseData(ExternalCausesSlide.InputMasks.Responses(1))
'Determine string name of SlideImage or SlideText object at
'mouse click coordinates. Assign that value to strHit
strHit = theState.HitTest(theMouseResponseData.CursorX,
theMouseResponseData.CursorY)
'if strHit equals the two buttons, then strHit will be
logged, game will move onto next trial.
If strHit = ("Image1") or strHit = ("Image2") or
strHit = ("Image3")or strHit = ("Image4") Then
c.SetAttrib "response", strHit
'if click is off, then restart slide 2 so nothing changes
on the screen. no data will be logged in this case.
Else
Goto restart2
End If
'Compare string name where mouse click occurred to CorrectAnswer
'attribute on each trial, and score response
'NOTE: This comparison is case sensitive
If strHit = c.GetAttrib("CorrectEmotion") Then
ExternalCausesSlide.ACC = 1
Else
ExternalCausesSlide.ACC = 0
End If
If strHit = ("Image1") Then
Dim Image1 As SlideImage
Set Image1 =
CSlideImage(ExternalCausesSlide.States("Default").Objects("Image1"))
Image1.BorderColor = CColor("cyan")
End If
End if
--
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/11000327-bee5-4ad7-a9d8-156efbb73846%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.linguistlist.org/pipermail/eprime/attachments/20131009/0aa876f4/attachment.htm>
More information about the Eprime
mailing list