+xIn a nutshell, I would do something like this:
<values>
/ lastx = -1
/ lasty = -1
</values>
<block example>
/ trials = [1-4 = start]
</block>
<trial start>
/ pretrialpause = 100
/ stimulusframes = [1=move]
/ inputdevice = mouse
/ validresponse = (mousemove)
/ branch = [
trial.move_or_rest;
]
/ recorddata = false
</trial>
<trial move_or_rest>
/ stimulusframes = [1=move_or_rest]
/ inputdevice = mouse
/ validresponse = (mousemove, noresponse)
/ timeout = 2000
/ branch = [
if (trial.move_or_rest.response !=0) {
trial.move_or_rest;
} else {
values.lastx = mouse.x;
values.lasty = mouse.y;
trial.end
}
]</trial>
<trial end>
/ stimulusframes = [1=end]
/ inputdevice = mouse
/ validresponse = (lbuttondown)
</trial>
<text move>
/ items = ("Move the mouse.")
/ erase = false
/ size = (20%, 20%)
</text>
<text move_or_rest>
/ items = ("Move the mouse. If you stop at any point for 2 seconds, the trial sequence ends.")
/ erase = false
/ size = (20%, 20%)
</text>
<text end>
/ items = ("Mouse was rested for two seconds. The resting coordinates were <%values.lastx%>, <%values.lasty%>.")
/ erase = false
/ size = (20%, 20%)
</text>
Thanks i will try that.
Here is my code in case you still want a look. The audio files would not upload so there will be no sound feedback. Not really important as that comes in next block.
many thanks.
<defaults>
/ minimumversion = "4.0.0.0"
/ inputdevice = mouseover
/ fontstyle = ("Arial", 3%, false, false, false, false, 5, 0)
/ canvasaspectratio = (4,3)
</defaults>
<values>
/ completed = 0
/ groupnumber = 0
/ response = 0
/ latencyC = 0
/ agency = 0
/ showcardinfo = true
/ age = 0
/ gender = 0
/ Qresponse = 0
/ x = -1
/ y = -1
/ trialcounter = 0
</values>
<data>
/file = "Idiomotor_Data.iqdat"
/ columns = [mouse.x mouse.y]
/separatefiles = true
</data>,
<expt main>
/ blocks = [1= instructions; 2=Move; 3=select; 3=Move; 4=select; 5=Move; 6=select; 7=Move; 8=select; 9=debrief]
/onexptend = [values.completed = 1]
</expt>
<block instructions>
/ trials = [1=instructions; 2=instructions2]
</block>
<trial instructions>
/ stimulusframes = [1=IMT1; 100=continue]
/ validresponse = (continue)
/ recorddata = false
</trial>
<text continue>
/ items = ("Next")
/ position = (50%, 90%)
/ fontstyle = ("Arial", 3%, false, false, true, false, 5, 0)
/ txcolor = blue
</text>
<trial instructions2>
/ stimulusframes = [1=IMT2; 100=start]
/ validresponse = (start)
/ recorddata = false
</trial>
<picture start>
/ items = ("start_button.jpg")
/ erase = false
/ size=(200, 200)
</picture>
<text IMT1>
/ items = ("please place both hands on the planchette. Move the planchette around and observe the movment of the board through the viewing window ")
/ position = (50%, 20%)
/ fontstyle = ("Arial", 2%)
/ size = (95%, 30%)
/ hjustify = center
/ valign = top
/ erase = false
</text>
<text IMT2>
/ items = ("during the experiment pleas alowe your hand to move freely but dont deliberatly control its direction.
once youare ready to statrt the experiment move the planchette over the start button and the experiment will commence")
/ position = (50%, 60%)
/ fontstyle = ("Arial", 2%)
/ size = (95%, 30%)
/ hjustify = center
/ valign = top
/ erase = false
</text>
;
<block Move>
/ trials = [1 = search]
/ timeout= (8000)
</block>
<block select>
/ trials = [1 = select]
</block>
<trial search>
/ stimulusframes = [1=clearscreen, bord, viewhole]
/ ontrialbegin=[values.trialcounter = values.trialcounter + 1]
/ ontrialbegin = [picture.bord.hposition = 1px * mouse.x;picture.bord.vposition = 1px * mouse.y;]
/ inputdevice = mouse
/ validresponse = (mousemove)
/ branch = [trial.search]
/ recorddata = false
</trial>
<trial select>
/ stimulusframes = [1= Gray_Background, Black1, Black2, Black3, Black4, bord, viewhole]
/ validresponse = ( Black1, Black2, Black3, Black4)
/ recorddata = false
/ timeout= (700)
/ recorddata = true
/ ontrialend = [values.x = mouse.x; values.y = mouse.y;]
/ branch = [if (trial.select.response == "black1")trial. win]
/ branch = [if (trial.select.response == "black2")trial. lose]
/ branch = [if (trial.select.response == "black3")trial. lose]
/ branch = [if (trial.select.response == "black4")trial. win]
</trial>
<trial win>
/ ontrialbegin = [trial.win.insertstimulustime(sound.Win, 100)]
/ recorddata = false
/ timeout= (1000)
</trial>
<trial lose>
/ ontrialbegin = [trial.lose.insertstimulustime(sound.lose, 100)]
/ recorddata = false
/ timeout= (1000)
</trial>
<sound Win>
/items = win
/playthrough = false
/select = noreplace
/resetinterval = 0
</sound>
<item win>
/1 = "win.wav"
</item>
<sound lose>
/items = Incorrect
/playthrough = false
/select = noreplace
/volume = -999
/resetinterval = 0
</sound>
<item Incorrect>
/1 = "lose.wav"
</item>
<picture Black1>
/ items = ("Black1.png")
/ erase = false
/ position = (10%, 10%)
/ size = (70%, 70%)
</picture>
<picture Black2>
/ items = ("Black1.png")
/ erase = false
/ position = (90%, 10%)
/ size = (70%, 70%)
</picture>
<picture Black3>
/ items = ("Black1.png")
/ erase = false
/ position = (10%, 90%)
/ size=(70%, 70%)
</picture>
<picture Black4>
/ items = ("Black1.png")
/ erase = false
/ position = (90%, 90%)
/ size=(70%, 70%)
</picture>
<picture Gray_Background>
/ items = ("Grey Background.jpg")
/ erase = false
/ position = (50%, 50%)
/ size=(200%, 200%)
</picture>
<picture viewhole>
/ items = ("Hole.png")
/ erase = false
/ size=(3000, 3000)
</picture>
<picture bord>
/ items = ("Board.jpg")
/ erase = false
/ size=(1000, 1000)
</picture>
<block debrief>
/ trials = [1=debrief]
</block>
<trial debrief>
/ stimulustimes = [1=debrief, finnish]
/ validresponse = (finnish)
/ recorddata = false
</trial>
<text debrief>
/items = ("All done thanks!!
We were looking into peoples’ ability to automatically move therir limbe as a part of somthing called the idiomoteor efffect,
how this this process informs our sense of having causal responsibility for our actions outcomes at a nerological level.
Thanks again for participating.")
/fontstyle = ("Arial", 3.00%)
/txcolor = (blue)
/position = (50%, 50%)
/size = (50%, 50%)
</text>
<text finnish>
/ items = ("Finish")
/ position = (50%, 90%)
/ fontstyle = ("Arial", 3%, false, false, true, false, 5, 0)
/ txcolor = blue
</text>