Reset Slide on Correct Type Number Answer

117 views
Skip to first unread message

SombreNote

unread,
Mar 23, 2012, 11:22:41 AM3/23/12
to E-Prime
Hi everyone,

I am having quite frustrating time doing something that on all
accounts is very easy. I have a procedure called:

ArithTe
+ Inline1 (Inline Code)
+ ArthProb (Slide set up with prompt text)
+ PendingReponses (more inline code)

What it is supposed to do is test to see if a number (which changes
every rerun), is correctly entered in a ECHO typed space on the slide.
If correct it should recycle the slide and change the number. This is
basically just a MIST task in which a person subtracts 7 from a number
as fast as possible. Right now it is simple and I have no added all
the bells and whistles. I am in contact with PST, but things are going
very slowly. Does anyone think they could point me in the right
direction?

This is a link to the 54kb file if you want it. http://depositfiles.com/files/b3pib3et5
I will make it available when it is completed, because this is a
pretty common procedure.

#### Inline1 ######
'New code
lnStartTime = 0
lnEndTime = 0
lnBlockDuration = 0
boolBlockEnd = False
FirstRun = True
'lnStartTime = Clock.Read
lnEndTime = Clock.Read + 50000 '100000 '240000

Dim SlideOnsetTime As Long
Dim SlideStopTime As Long

'Declare a variable that can be assigned to the Stimulus object.
Dim theSlideC As Slide
Set theSlideC = CSlide(Rte.GetObject("ArthProb"))

'Declare a variable that can be assigned to the default SlideState.
Dim theStateC As SlideState
Set theStateC = theSlideC.States.Item("Default")

'Declare a variable that can be assigned to the SlideText sub-object
'that will be altered based on subject responses.

'Declare a variable that can be assigned to the ArthProb object.
Dim theSlide As Slide
Set theSlide = CSlide(Rte.GetObject("ArthProb"))
Dim theState As SlideState
Set theState = theSlide.States.Item("Default")
Dim theSlideText As SlideText
Set theSlideText = CSlideText(theState.Objects("StimulusText"))
Dim theSlideTextFROM As SlideText
Set theSlideTextFROM = CSlideText(theState.Objects("subfrom"))
Dim theSlideTextP As SlideText
Set theSlideTextP = CSlideText(theState.Objects("prompt"))

Dim Answer As Long
Answer = 2381
Set ArthProb.CRESP = Answer

Do 'STARTS THE DO LOOP to repeat ArthProd for as long as the clock
lasts.
SlideOnsetTime = Clock.Read
Set ArthProb.CRESP = Answer - 7
c.SetAttrib "CorrectAnswer" , ArthProb.CRESP

theSlideTextFROM.Text = c.GetAttrib("CorrectAnswer")
theSlideTextFROM.Draw

##### Stimlus Slide ######

##### PendingResponses ######
Dim theResponseObject As RteRunnableInputObject
Set theResponseObject =
CRteRunnableInputObject(Rte.GetObject("ArthProb"))

Dim nResponseCount As Long
Dim theResponseData As ResponseData

Do While theResponseObject.InputMasks.IsPending()
If nResponseCount <> theResponseObject.InputMasks.Responses.Count
Then
nResponseCount = nResponseCount + 1
Set theResponseData =
theResponseObject.InputMasks.Responses(nResponseCount)
If Not theResponseData Is Nothing Then
If Clock.Read >= lnEndTime Then
boolBlockEnd = True
Exit Do
End If

'If theResponseData.RESP = ArthProb.CRESP Then 'I have tried both
If ArthProb.RESP = ArthProb.CRESP Then
ArthProb.ACC = 1
boolBlockEnd = False
Exit Do
Else
ArthProb.ACC = 0
End If
End If
End If

'Give some time back (required)
Sleep 10
DoEvents

Loop
Loop Until boolBlockEnd = True


Candy Patterson

unread,
Apr 13, 2012, 8:48:11 AM4/13/12
to e-p...@googlegroups.com
Hi,

Have you managed to solve this problem yet? I might of misunderstood but I got that the problem lies in the below code:


                'If  theResponseData.RESP = ArthProb.CRESP Then   'I have tried both
                If  ArthProb.RESP = ArthProb.CRESP Then
                        ArthProb.ACC = 1
                        boolBlockEnd = False
                        Exit Do
                Else
                        ArthProb.ACC = 0
                End If
        End If
    End If

In the If statement, the .RESP and .CRESP need to be associated to the slide that a response is made, i.e. if the response is made on a slide titled 'PendingResponse' then the formula would be the following:

If  PendingResponse.RESP = PendingResponse.CRESP Then
                        PendingResponse.ACC = 1

                        boolBlockEnd = False
                        Exit Do
                Else
                        PendingResponse.ACC = 0
                End If
        End If

Hope that helps.

Candy

SombreNote

unread,
May 18, 2012, 11:06:42 AM5/18/12
to E-Prime
Yes. Thank you. Where is a completed copy if anyone is interested.

http://depositfiles.com/files/bxl8zhl1g

On Apr 13, 8:48 am, Candy Patterson <candy.patter...@hotmail.co.uk>
wrote:
Reply all
Reply to author
Forward
0 new messages