dragdrop expt


Author
Message
scollin
scollin
Partner Member (883 reputation)Partner Member (883 reputation)Partner Member (883 reputation)Partner Member (883 reputation)Partner Member (883 reputation)Partner Member (883 reputation)Partner Member (883 reputation)Partner Member (883 reputation)Partner Member (883 reputation)
Group: Forum Members
Posts: 9, Visits: 35
Hello,

I am trying to create on experiment during which participants will sort images. I want them to do this by dragging and dropping them into either the red or the blue rectangle. See code below. Even though I'm using dragdrop and dropsource and droptarget, it does not seem to work. Any advice on what is wrong?

Once this works I also want to save in which rectangle a participant has placed each image, I guess I should save this by saving the position on the screen?



<shape bluecircle>
/ shape = rectangle
/ color = (0, 0, 200)
/ position = (80%, 50%)
/ droptarget = true
/ size = (20%, 20%)
</shape>

<shape redcircle>
/ shape = rectangle
/ color = (200, 0, 0)
/ position = (20%, 50%)
/ droptarget = true
/ size = (20%, 20%)
</shape>

<picture egg1>
/ items = ("egg1.png")
/ position = (10%, 10%)
/ dropsource = true
/ size = (5%, 5%)
</picture>

<picture egg6>
/ items = ("egg6.png")
/ position = (20%, 10%)
/ dropsource = true
/ size = (5%, 5%)
</picture>

<picture egg9>
/ items = ("egg9.png")
/ position = (30%, 10%)
/ dropsource = true
/ size = (5%, 5%)
</picture>

<picture egg10>
/ items = ("egg10.png")
/ position = (40%, 10%)
/ dropsource = true
/ size = (5%, 5%)
</picture>

<picture egg18>
/ items = ("egg18.png")
/ position = (50%, 10%)
/ dropsource = true
/ size = (5%, 5%)
</picture>

<picture egg19>
/ items = ("egg19.png")
/ position = (60%, 10%)
/ dropsource = true
/ size = (5%, 5%)
</picture>

<picture egg21>
/ items = ("egg21.png")
/ position = (70%, 10%)
/ dropsource = true
/ size = (5%, 5%)
</picture>

<picture egg41>
/ items = ("egg41.png")
/ position = (80%, 10%)
/ dropsource = true
/ size = (5%, 5%)
</picture>



<text finishtext>
/ items = ("time almost up!")
/ txcolor = (0, 0, 255)
/ txbgcolor = (255, 255, 255)
/ size = (5%, 5%)
/ position = (0%, 0%)
</text>


<trial mytrial>
/ stimulustimes = [0=bluecircle; 0=redcircle; 0=egg1; 0=egg6; 0=egg9; 0=egg10; 0=egg18; 0=egg19; 0=egg21; 0=egg41; 10000 = finishtext]
/ showmousecursor = true
/ inputdevice = dragdrop
/ recorddata = true
/ response = anyresponse
/ responseinterrupt = trial
/ beginresponseframe = 0
</trial>

<block myblock>
/ trials=[1=mytrial]
</block>

<expt>
/ blocks=[1=myblock]
</expt>



Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 12K, Visits: 98K
scollin - Friday, August 24, 2018
Hello,

I am trying to create on experiment during which participants will sort images. I want them to do this by dragging and dropping them into either the red or the blue rectangle. See code below. Even though I'm using dragdrop and dropsource and droptarget, it does not seem to work. Any advice on what is wrong?

Once this works I also want to save in which rectangle a participant has placed each image, I guess I should save this by saving the position on the screen?



<shape bluecircle>
/ shape = rectangle
/ color = (0, 0, 200)
/ position = (80%, 50%)
/ droptarget = true
/ size = (20%, 20%)
</shape>

<shape redcircle>
/ shape = rectangle
/ color = (200, 0, 0)
/ position = (20%, 50%)
/ droptarget = true
/ size = (20%, 20%)
</shape>

<picture egg1>
/ items = ("egg1.png")
/ position = (10%, 10%)
/ dropsource = true
/ size = (5%, 5%)
</picture>

<picture egg6>
/ items = ("egg6.png")
/ position = (20%, 10%)
/ dropsource = true
/ size = (5%, 5%)
</picture>

<picture egg9>
/ items = ("egg9.png")
/ position = (30%, 10%)
/ dropsource = true
/ size = (5%, 5%)
</picture>

<picture egg10>
/ items = ("egg10.png")
/ position = (40%, 10%)
/ dropsource = true
/ size = (5%, 5%)
</picture>

<picture egg18>
/ items = ("egg18.png")
/ position = (50%, 10%)
/ dropsource = true
/ size = (5%, 5%)
</picture>

<picture egg19>
/ items = ("egg19.png")
/ position = (60%, 10%)
/ dropsource = true
/ size = (5%, 5%)
</picture>

<picture egg21>
/ items = ("egg21.png")
/ position = (70%, 10%)
/ dropsource = true
/ size = (5%, 5%)
</picture>

<picture egg41>
/ items = ("egg41.png")
/ position = (80%, 10%)
/ dropsource = true
/ size = (5%, 5%)
</picture>



<text finishtext>
/ items = ("time almost up!")
/ txcolor = (0, 0, 255)
/ txbgcolor = (255, 255, 255)
/ size = (5%, 5%)
/ position = (0%, 0%)
</text>


<trial mytrial>
/ stimulustimes = [0=bluecircle; 0=redcircle; 0=egg1; 0=egg6; 0=egg9; 0=egg10; 0=egg18; 0=egg19; 0=egg21; 0=egg41; 10000 = finishtext]
/ showmousecursor = true
/ inputdevice = dragdrop
/ recorddata = true
/ response = anyresponse
/ responseinterrupt = trial
/ beginresponseframe = 0
</trial>

<block myblock>
/ trials=[1=mytrial]
</block>

<expt>
/ blocks=[1=myblock]
</expt>



This example

<instruct>
/ fontstyle = ("Arial", 2.8%, false, false, false, false, 5, 1) / txcolor = (white) / screencolor = black / wait = 1000 </instruct>

<page intro>
In the following task, you will be presented with negative words related to outcomes of smoking or with positive words you may experience if you quit smoking. You will also see an image of a cigarette, and the word 'me' on the page.
~n~nYour task is to:
~n* Drag the negative words away from you and towards the cigarette.
Drag the positive words towards the word 'me'.
~n~nPress the spacebar to begin.
</page>

<expt>
/ preinstructions = (intro)
/ blocks = [1=intervention]
/ postinstructions = (end)
</expt>

<item negative>
/1 = "lung cancer"
/2 = "addiction"
/3 = "heart disease"
/4 = "clogged arteries"
/5 = "blindness"
/6 = "amputation"
/7 = "death"
/8 = "tongue cancer"
/9 = "throat cancer"
/10 = "gangrene"
/11 = "stroke"
/12 = "asthma"
/13 = "feel unwell"
/14 = "out of breath"
/15 = "trapped"
/16 = "premature death"
/17 = "pollution"
/18 = "illness"
</item>

<item positive>
/1 = "healthy"
/2 = "vibrant"
/3 = "free"
/4 = "happy"
/5 = "in control"
/6 = "long life"
/7 = "energetic"
/8 = "refreshed"
/9 = "good"
/10 = "rewarding"
/11 = "breathe easily"
/12 = "independent"
/13 = "clean"
/14 = "energetic"
/15 = "feel good"
/16 = "wellbeing"
</item>

<item smoking>
/1 = "smoking1.jpg"
</item>

<item me>
/1 = "me"
</item>

<text positive>
/ items = positive
/ valign = center
/ halign = center
/ position = (50%, 50%)
/ txcolor = green
/ fontstyle = ("Arial", 15%)
/ dropsource = true
</text>

<text negative>
/ items = negative
/ valign = center
/ halign = center
/ position = (50%, 50%)
/ txcolor = green
/ fontstyle = ("Arial", 15%)
/ dropsource = true
</text>

<text me>
/ items = me
/ valign = bottom
/ halign = center
/ position = (50%, 95%)
/ txcolor = black
/ fontstyle = ("Arial", 15%)
/ droptarget = true
</text>

<picture smoking>
/ items = smoking
/ position = (50%, 10%)
/ size = (15%, 15%)
/ erase = false
/ droptarget = true
</picture>

<trial positive>
/ ontrialbegin = [
    text.positive.hposition = 50%;
    text.positive.vposition = 50%;
]
/ stimulusframes = [1 = positive, me, smoking] / inputdevice = dragdrop / showmousecursor = true / validresponse = (me, smoking) / correctresponse = (me) </trial>

<trial negative>
/ ontrialbegin = [
    text.negative.hposition = 50%;
    text.negative.vposition = 50%;
]
/ stimulusframes = [1 = negative, me, smoking] / inputdevice = dragdrop / showmousecursor = true / validresponse = (me, smoking) / correctresponse = (smoking) </trial>

<block intervention>
/trials = [1-68 = replacenorepeat(positive,negative)]
</block>

<page end>
You have reached the end of the task.
^^Thank you! Continue to enjoy being a non-smoking (or smoking less)!
</page>

as well as this thread here https://www.millisecond.com/forums/Topic24644.aspx should be useful with respect to setting up drag & drop mechanics properly.

scollin
scollin
Partner Member (883 reputation)Partner Member (883 reputation)Partner Member (883 reputation)Partner Member (883 reputation)Partner Member (883 reputation)Partner Member (883 reputation)Partner Member (883 reputation)Partner Member (883 reputation)Partner Member (883 reputation)
Group: Forum Members
Posts: 9, Visits: 35
Dave - Friday, August 24, 2018
scollin - Friday, August 24, 2018
Hello,

I am trying to create on experiment during which participants will sort images. I want them to do this by dragging and dropping them into either the red or the blue rectangle. See code below. Even though I'm using dragdrop and dropsource and droptarget, it does not seem to work. Any advice on what is wrong?

Once this works I also want to save in which rectangle a participant has placed each image, I guess I should save this by saving the position on the screen?



<shape bluecircle>
/ shape = rectangle
/ color = (0, 0, 200)
/ position = (80%, 50%)
/ droptarget = true
/ size = (20%, 20%)
</shape>

<shape redcircle>
/ shape = rectangle
/ color = (200, 0, 0)
/ position = (20%, 50%)
/ droptarget = true
/ size = (20%, 20%)
</shape>

<picture egg1>
/ items = ("egg1.png")
/ position = (10%, 10%)
/ dropsource = true
/ size = (5%, 5%)
</picture>

<picture egg6>
/ items = ("egg6.png")
/ position = (20%, 10%)
/ dropsource = true
/ size = (5%, 5%)
</picture>

<picture egg9>
/ items = ("egg9.png")
/ position = (30%, 10%)
/ dropsource = true
/ size = (5%, 5%)
</picture>

<picture egg10>
/ items = ("egg10.png")
/ position = (40%, 10%)
/ dropsource = true
/ size = (5%, 5%)
</picture>

<picture egg18>
/ items = ("egg18.png")
/ position = (50%, 10%)
/ dropsource = true
/ size = (5%, 5%)
</picture>

<picture egg19>
/ items = ("egg19.png")
/ position = (60%, 10%)
/ dropsource = true
/ size = (5%, 5%)
</picture>

<picture egg21>
/ items = ("egg21.png")
/ position = (70%, 10%)
/ dropsource = true
/ size = (5%, 5%)
</picture>

<picture egg41>
/ items = ("egg41.png")
/ position = (80%, 10%)
/ dropsource = true
/ size = (5%, 5%)
</picture>



<text finishtext>
/ items = ("time almost up!")
/ txcolor = (0, 0, 255)
/ txbgcolor = (255, 255, 255)
/ size = (5%, 5%)
/ position = (0%, 0%)
</text>


<trial mytrial>
/ stimulustimes = [0=bluecircle; 0=redcircle; 0=egg1; 0=egg6; 0=egg9; 0=egg10; 0=egg18; 0=egg19; 0=egg21; 0=egg41; 10000 = finishtext]
/ showmousecursor = true
/ inputdevice = dragdrop
/ recorddata = true
/ response = anyresponse
/ responseinterrupt = trial
/ beginresponseframe = 0
</trial>

<block myblock>
/ trials=[1=mytrial]
</block>

<expt>
/ blocks=[1=myblock]
</expt>



This example

<instruct>
/ fontstyle = ("Arial", 2.8%, false, false, false, false, 5, 1) / txcolor = (white) / screencolor = black / wait = 1000 </instruct>

<page intro>
In the following task, you will be presented with negative words related to outcomes of smoking or with positive words you may experience if you quit smoking. You will also see an image of a cigarette, and the word 'me' on the page.
~n~nYour task is to:
~n* Drag the negative words away from you and towards the cigarette.
Drag the positive words towards the word 'me'.
~n~nPress the spacebar to begin.
</page>

<expt>
/ preinstructions = (intro)
/ blocks = [1=intervention]
/ postinstructions = (end)
</expt>

<item negative>
/1 = "lung cancer"
/2 = "addiction"
/3 = "heart disease"
/4 = "clogged arteries"
/5 = "blindness"
/6 = "amputation"
/7 = "death"
/8 = "tongue cancer"
/9 = "throat cancer"
/10 = "gangrene"
/11 = "stroke"
/12 = "asthma"
/13 = "feel unwell"
/14 = "out of breath"
/15 = "trapped"
/16 = "premature death"
/17 = "pollution"
/18 = "illness"
</item>

<item positive>
/1 = "healthy"
/2 = "vibrant"
/3 = "free"
/4 = "happy"
/5 = "in control"
/6 = "long life"
/7 = "energetic"
/8 = "refreshed"
/9 = "good"
/10 = "rewarding"
/11 = "breathe easily"
/12 = "independent"
/13 = "clean"
/14 = "energetic"
/15 = "feel good"
/16 = "wellbeing"
</item>

<item smoking>
/1 = "smoking1.jpg"
</item>

<item me>
/1 = "me"
</item>

<text positive>
/ items = positive
/ valign = center
/ halign = center
/ position = (50%, 50%)
/ txcolor = green
/ fontstyle = ("Arial", 15%)
/ dropsource = true
</text>

<text negative>
/ items = negative
/ valign = center
/ halign = center
/ position = (50%, 50%)
/ txcolor = green
/ fontstyle = ("Arial", 15%)
/ dropsource = true
</text>

<text me>
/ items = me
/ valign = bottom
/ halign = center
/ position = (50%, 95%)
/ txcolor = black
/ fontstyle = ("Arial", 15%)
/ droptarget = true
</text>

<picture smoking>
/ items = smoking
/ position = (50%, 10%)
/ size = (15%, 15%)
/ erase = false
/ droptarget = true
</picture>

<trial positive>
/ ontrialbegin = [
    text.positive.hposition = 50%;
    text.positive.vposition = 50%;
]
/ stimulusframes = [1 = positive, me, smoking] / inputdevice = dragdrop / showmousecursor = true / validresponse = (me, smoking) / correctresponse = (me) </trial>

<trial negative>
/ ontrialbegin = [
    text.negative.hposition = 50%;
    text.negative.vposition = 50%;
]
/ stimulusframes = [1 = negative, me, smoking] / inputdevice = dragdrop / showmousecursor = true / validresponse = (me, smoking) / correctresponse = (smoking) </trial>

<block intervention>
/trials = [1-68 = replacenorepeat(positive,negative)]
</block>

<page end>
You have reached the end of the task.
^^Thank you! Continue to enjoy being a non-smoking (or smoking less)!
</page>

as well as this thread here https://www.millisecond.com/forums/Topic24644.aspx should be useful with respect to setting up drag & drop mechanics properly.

Thanks a lot!

scollin
scollin
Partner Member (883 reputation)Partner Member (883 reputation)Partner Member (883 reputation)Partner Member (883 reputation)Partner Member (883 reputation)Partner Member (883 reputation)Partner Member (883 reputation)Partner Member (883 reputation)Partner Member (883 reputation)
Group: Forum Members
Posts: 9, Visits: 35
Dave - Friday, August 24, 2018
scollin - Friday, August 24, 2018
Hello,

I am trying to create on experiment during which participants will sort images. I want them to do this by dragging and dropping them into either the red or the blue rectangle. See code below. Even though I'm using dragdrop and dropsource and droptarget, it does not seem to work. Any advice on what is wrong?

Once this works I also want to save in which rectangle a participant has placed each image, I guess I should save this by saving the position on the screen?



<shape bluecircle>
/ shape = rectangle
/ color = (0, 0, 200)
/ position = (80%, 50%)
/ droptarget = true
/ size = (20%, 20%)
</shape>

<shape redcircle>
/ shape = rectangle
/ color = (200, 0, 0)
/ position = (20%, 50%)
/ droptarget = true
/ size = (20%, 20%)
</shape>

<picture egg1>
/ items = ("egg1.png")
/ position = (10%, 10%)
/ dropsource = true
/ size = (5%, 5%)
</picture>

<picture egg6>
/ items = ("egg6.png")
/ position = (20%, 10%)
/ dropsource = true
/ size = (5%, 5%)
</picture>

<picture egg9>
/ items = ("egg9.png")
/ position = (30%, 10%)
/ dropsource = true
/ size = (5%, 5%)
</picture>

<picture egg10>
/ items = ("egg10.png")
/ position = (40%, 10%)
/ dropsource = true
/ size = (5%, 5%)
</picture>

<picture egg18>
/ items = ("egg18.png")
/ position = (50%, 10%)
/ dropsource = true
/ size = (5%, 5%)
</picture>

<picture egg19>
/ items = ("egg19.png")
/ position = (60%, 10%)
/ dropsource = true
/ size = (5%, 5%)
</picture>

<picture egg21>
/ items = ("egg21.png")
/ position = (70%, 10%)
/ dropsource = true
/ size = (5%, 5%)
</picture>

<picture egg41>
/ items = ("egg41.png")
/ position = (80%, 10%)
/ dropsource = true
/ size = (5%, 5%)
</picture>



<text finishtext>
/ items = ("time almost up!")
/ txcolor = (0, 0, 255)
/ txbgcolor = (255, 255, 255)
/ size = (5%, 5%)
/ position = (0%, 0%)
</text>


<trial mytrial>
/ stimulustimes = [0=bluecircle; 0=redcircle; 0=egg1; 0=egg6; 0=egg9; 0=egg10; 0=egg18; 0=egg19; 0=egg21; 0=egg41; 10000 = finishtext]
/ showmousecursor = true
/ inputdevice = dragdrop
/ recorddata = true
/ response = anyresponse
/ responseinterrupt = trial
/ beginresponseframe = 0
</trial>

<block myblock>
/ trials=[1=mytrial]
</block>

<expt>
/ blocks=[1=myblock]
</expt>



This example

<instruct>
/ fontstyle = ("Arial", 2.8%, false, false, false, false, 5, 1) / txcolor = (white) / screencolor = black / wait = 1000 </instruct>

<page intro>
In the following task, you will be presented with negative words related to outcomes of smoking or with positive words you may experience if you quit smoking. You will also see an image of a cigarette, and the word 'me' on the page.
~n~nYour task is to:
~n* Drag the negative words away from you and towards the cigarette.
Drag the positive words towards the word 'me'.
~n~nPress the spacebar to begin.
</page>

<expt>
/ preinstructions = (intro)
/ blocks = [1=intervention]
/ postinstructions = (end)
</expt>

<item negative>
/1 = "lung cancer"
/2 = "addiction"
/3 = "heart disease"
/4 = "clogged arteries"
/5 = "blindness"
/6 = "amputation"
/7 = "death"
/8 = "tongue cancer"
/9 = "throat cancer"
/10 = "gangrene"
/11 = "stroke"
/12 = "asthma"
/13 = "feel unwell"
/14 = "out of breath"
/15 = "trapped"
/16 = "premature death"
/17 = "pollution"
/18 = "illness"
</item>

<item positive>
/1 = "healthy"
/2 = "vibrant"
/3 = "free"
/4 = "happy"
/5 = "in control"
/6 = "long life"
/7 = "energetic"
/8 = "refreshed"
/9 = "good"
/10 = "rewarding"
/11 = "breathe easily"
/12 = "independent"
/13 = "clean"
/14 = "energetic"
/15 = "feel good"
/16 = "wellbeing"
</item>

<item smoking>
/1 = "smoking1.jpg"
</item>

<item me>
/1 = "me"
</item>

<text positive>
/ items = positive
/ valign = center
/ halign = center
/ position = (50%, 50%)
/ txcolor = green
/ fontstyle = ("Arial", 15%)
/ dropsource = true
</text>

<text negative>
/ items = negative
/ valign = center
/ halign = center
/ position = (50%, 50%)
/ txcolor = green
/ fontstyle = ("Arial", 15%)
/ dropsource = true
</text>

<text me>
/ items = me
/ valign = bottom
/ halign = center
/ position = (50%, 95%)
/ txcolor = black
/ fontstyle = ("Arial", 15%)
/ droptarget = true
</text>

<picture smoking>
/ items = smoking
/ position = (50%, 10%)
/ size = (15%, 15%)
/ erase = false
/ droptarget = true
</picture>

<trial positive>
/ ontrialbegin = [
    text.positive.hposition = 50%;
    text.positive.vposition = 50%;
]
/ stimulusframes = [1 = positive, me, smoking] / inputdevice = dragdrop / showmousecursor = true / validresponse = (me, smoking) / correctresponse = (me) </trial>

<trial negative>
/ ontrialbegin = [
    text.negative.hposition = 50%;
    text.negative.vposition = 50%;
]
/ stimulusframes = [1 = negative, me, smoking] / inputdevice = dragdrop / showmousecursor = true / validresponse = (me, smoking) / correctresponse = (smoking) </trial>

<block intervention>
/trials = [1-68 = replacenorepeat(positive,negative)]
</block>

<page end>
You have reached the end of the task.
^^Thank you! Continue to enjoy being a non-smoking (or smoking less)!
</page>

as well as this thread here https://www.millisecond.com/forums/Topic24644.aspx should be useful with respect to setting up drag & drop mechanics properly.


I managed to get it to work, thanks! One more question about this. Is it also possible to keep looping the trials until the participant presses a certain button? (i.e. that the participant can determine when the stop the task)

Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 12K, Visits: 98K
scollin - Monday, August 27, 2018


I managed to get it to work, thanks! One more question about this. Is it also possible to keep looping the trials until the participant presses a certain button? (i.e. that the participant can determine when the stop the task)

Yes, that's possible. Taking the 1st example I posted here, you would do it like this:

<instruct>
/ fontstyle = ("Arial", 2.8%, false, false, false, false, 5, 1)
/ txcolor = (white)
/ screencolor = black
</instruct>

<page intro>
^In the following task, you will be presented with negative words related to outcomes of smoking or with positive words you may experience if you quit smoking. You will also see an image of a cigarette, and the word 'me' on the page.
~n~nYour task is to:
~n* Drag the negative words away from you and towards the cigarette.
Drag the positive words towards the word 'me'.
~n~nPress the spacebar to begin.
</page>

<page end>
^This is the end.
</page>


<expt>
/ preinstructions = (intro)
/ blocks = [1=intervention]
/ postinstructions = (end)
</expt>

<item negative>
/1 = "lung cancer"
/2 = "addiction"
/3 = "heart disease"
/4 = "clogged arteries"
/5 = "blindness"
/6 = "amputation"
/7 = "death"
/8 = "tongue cancer"
/9 = "throat cancer"
/10 = "gangrene"
/11 = "stroke"
/12 = "asthma"
/13 = "feel unwell"
/14 = "out of breath"
/15 = "trapped"
/16 = "premature death"
/17 = "pollution"
/18 = "illness"
</item>

<item positive>
/1 = "healthy"
/2 = "vibrant"
/3 = "free"
/4 = "happy"
/5 = "in control"
/6 = "long life"
/7 = "energetic"
/8 = "refreshed"
/9 = "good"
/10 = "rewarding"
/11 = "breathe easily"
/12 = "independent"
/13 = "clean"
/14 = "energetic"
/15 = "feel good"
/16 = "wellbeing"
</item>

<item smoking>
/1 = "smoking"
</item>

<item me>
/1 = "me"
</item>

<text positive>
/ items = positive
/ valign = center
/ halign = center
/ position = (50%, 50%)
/ txcolor = green
/ fontstyle = ("Arial", 10%)
/ dropsource = true
</text>

<text negative>
/ items = negative
/ valign = center
/ halign = center
/ position = (50%, 50%)
/ txcolor = green
/ fontstyle = ("Arial", 10%)
/ dropsource = true
</text>

<text me>
/ items = me
/ valign = bottom
/ halign = center
/ position = (50%, 95%)
/ txcolor = black
/ fontstyle = ("Arial", 10%)
/ erase = false
/ droptarget = true
</text>

<text smoking>
/ items = smoking
/ valign = bottom
/ halign = center
/ position = (50%, 10%)
/ txcolor = black
/ fontstyle = ("Arial", 10%)
/ erase = false
/ droptarget = true
</text>

<trial positive>
/ ontrialbegin = [
    text.positive.hposition = 50%;
    text.positive.vposition = 50%;
]
/ stimulusframes = [1 = positive, me, smoking, end]
/ inputdevice = dragdrop
/ showmousecursor = true
/ validresponse = (me, smoking, end)
/ correctresponse = (me)
/ branch = [
    if(trial.positive.response != "end") list.triallist.nextvalue;
]
</trial>

<trial negative>
/ ontrialbegin = [
    text.negative.hposition = 50%;
    text.negative.vposition = 50%;
]
/ stimulusframes = [1 = negative, me, smoking, end]
/ inputdevice = dragdrop
/ showmousecursor = true
/ validresponse = (me, smoking, end)
/ correctresponse = (smoking)
/ branch = [
    if(trial.negative.response != "end") list.triallist.nextvalue;
]
</trial>

<block intervention>
/trials = [1 = list.triallist]
</block>

<list triallist>
/ items = (trial.positive, trial.negative)
/ poolsize = 10
</list>

<text end>
/ items = ("Click here to end the task.")
/ txbgcolor = black
/ txcolor = white
/ erase = false
/ vjustify = center
/ size = (24%, 6%)
/ position = (85%, 90%)
</text>


abhi
abhi
Guru (7.3K reputation)Guru (7.3K reputation)Guru (7.3K reputation)Guru (7.3K reputation)Guru (7.3K reputation)Guru (7.3K reputation)Guru (7.3K reputation)Guru (7.3K reputation)Guru (7.3K reputation)
Group: Forum Members
Posts: 114, Visits: 558
Dave - Monday, August 27, 2018
scollin - Monday, August 27, 2018


I managed to get it to work, thanks! One more question about this. Is it also possible to keep looping the trials until the participant presses a certain button? (i.e. that the participant can determine when the stop the task)

Yes, that's possible. Taking the 1st example I posted here, you would do it like this:

<instruct>
/ fontstyle = ("Arial", 2.8%, false, false, false, false, 5, 1)
/ txcolor = (white)
/ screencolor = black
</instruct>

<page intro>
^In the following task, you will be presented with negative words related to outcomes of smoking or with positive words you may experience if you quit smoking. You will also see an image of a cigarette, and the word 'me' on the page.
~n~nYour task is to:
~n* Drag the negative words away from you and towards the cigarette.
Drag the positive words towards the word 'me'.
~n~nPress the spacebar to begin.
</page>

<page end>
^This is the end.
</page>


<expt>
/ preinstructions = (intro)
/ blocks = [1=intervention]
/ postinstructions = (end)
</expt>

<item negative>
/1 = "lung cancer"
/2 = "addiction"
/3 = "heart disease"
/4 = "clogged arteries"
/5 = "blindness"
/6 = "amputation"
/7 = "death"
/8 = "tongue cancer"
/9 = "throat cancer"
/10 = "gangrene"
/11 = "stroke"
/12 = "asthma"
/13 = "feel unwell"
/14 = "out of breath"
/15 = "trapped"
/16 = "premature death"
/17 = "pollution"
/18 = "illness"
</item>

<item positive>
/1 = "healthy"
/2 = "vibrant"
/3 = "free"
/4 = "happy"
/5 = "in control"
/6 = "long life"
/7 = "energetic"
/8 = "refreshed"
/9 = "good"
/10 = "rewarding"
/11 = "breathe easily"
/12 = "independent"
/13 = "clean"
/14 = "energetic"
/15 = "feel good"
/16 = "wellbeing"
</item>

<item smoking>
/1 = "smoking"
</item>

<item me>
/1 = "me"
</item>

<text positive>
/ items = positive
/ valign = center
/ halign = center
/ position = (50%, 50%)
/ txcolor = green
/ fontstyle = ("Arial", 10%)
/ dropsource = true
</text>

<text negative>
/ items = negative
/ valign = center
/ halign = center
/ position = (50%, 50%)
/ txcolor = green
/ fontstyle = ("Arial", 10%)
/ dropsource = true
</text>

<text me>
/ items = me
/ valign = bottom
/ halign = center
/ position = (50%, 95%)
/ txcolor = black
/ fontstyle = ("Arial", 10%)
/ erase = false
/ droptarget = true
</text>

<text smoking>
/ items = smoking
/ valign = bottom
/ halign = center
/ position = (50%, 10%)
/ txcolor = black
/ fontstyle = ("Arial", 10%)
/ erase = false
/ droptarget = true
</text>

<trial positive>
/ ontrialbegin = [
    text.positive.hposition = 50%;
    text.positive.vposition = 50%;
]
/ stimulusframes = [1 = positive, me, smoking, end]
/ inputdevice = dragdrop
/ showmousecursor = true
/ validresponse = (me, smoking, end)
/ correctresponse = (me)
/ branch = [
    if(trial.positive.response != "end") list.triallist.nextvalue;
]
</trial>

<trial negative>
/ ontrialbegin = [
    text.negative.hposition = 50%;
    text.negative.vposition = 50%;
]
/ stimulusframes = [1 = negative, me, smoking, end]
/ inputdevice = dragdrop
/ showmousecursor = true
/ validresponse = (me, smoking, end)
/ correctresponse = (smoking)
/ branch = [
    if(trial.negative.response != "end") list.triallist.nextvalue;
]
</trial>

<block intervention>
/trials = [1 = list.triallist]
</block>

<list triallist>
/ items = (trial.positive, trial.negative)
/ poolsize = 10
</list>

<text end>
/ items = ("Click here to end the task.")
/ txbgcolor = black
/ txcolor = white
/ erase = false
/ vjustify = center
/ size = (24%, 6%)
/ position = (85%, 90%)
</text>


Sorry for butting in here.
But this script will help me a lot in my new experiment. My query is that - at present in this script, participant has to drag only one of the positive / negative words. How to do it in a way that participant has to drag both positive and negative words on to targets before he/she is taken to next set of words.
Thanks
 Abhi

Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 12K, Visits: 98K
abhi - Thursday, October 11, 2018
Dave - Monday, August 27, 2018
scollin - Monday, August 27, 2018


I managed to get it to work, thanks! One more question about this. Is it also possible to keep looping the trials until the participant presses a certain button? (i.e. that the participant can determine when the stop the task)

Yes, that's possible. Taking the 1st example I posted here, you would do it like this:

<instruct>
/ fontstyle = ("Arial", 2.8%, false, false, false, false, 5, 1)
/ txcolor = (white)
/ screencolor = black
</instruct>

<page intro>
^In the following task, you will be presented with negative words related to outcomes of smoking or with positive words you may experience if you quit smoking. You will also see an image of a cigarette, and the word 'me' on the page.
~n~nYour task is to:
~n* Drag the negative words away from you and towards the cigarette.
Drag the positive words towards the word 'me'.
~n~nPress the spacebar to begin.
</page>

<page end>
^This is the end.
</page>


<expt>
/ preinstructions = (intro)
/ blocks = [1=intervention]
/ postinstructions = (end)
</expt>

<item negative>
/1 = "lung cancer"
/2 = "addiction"
/3 = "heart disease"
/4 = "clogged arteries"
/5 = "blindness"
/6 = "amputation"
/7 = "death"
/8 = "tongue cancer"
/9 = "throat cancer"
/10 = "gangrene"
/11 = "stroke"
/12 = "asthma"
/13 = "feel unwell"
/14 = "out of breath"
/15 = "trapped"
/16 = "premature death"
/17 = "pollution"
/18 = "illness"
</item>

<item positive>
/1 = "healthy"
/2 = "vibrant"
/3 = "free"
/4 = "happy"
/5 = "in control"
/6 = "long life"
/7 = "energetic"
/8 = "refreshed"
/9 = "good"
/10 = "rewarding"
/11 = "breathe easily"
/12 = "independent"
/13 = "clean"
/14 = "energetic"
/15 = "feel good"
/16 = "wellbeing"
</item>

<item smoking>
/1 = "smoking"
</item>

<item me>
/1 = "me"
</item>

<text positive>
/ items = positive
/ valign = center
/ halign = center
/ position = (50%, 50%)
/ txcolor = green
/ fontstyle = ("Arial", 10%)
/ dropsource = true
</text>

<text negative>
/ items = negative
/ valign = center
/ halign = center
/ position = (50%, 50%)
/ txcolor = green
/ fontstyle = ("Arial", 10%)
/ dropsource = true
</text>

<text me>
/ items = me
/ valign = bottom
/ halign = center
/ position = (50%, 95%)
/ txcolor = black
/ fontstyle = ("Arial", 10%)
/ erase = false
/ droptarget = true
</text>

<text smoking>
/ items = smoking
/ valign = bottom
/ halign = center
/ position = (50%, 10%)
/ txcolor = black
/ fontstyle = ("Arial", 10%)
/ erase = false
/ droptarget = true
</text>

<trial positive>
/ ontrialbegin = [
    text.positive.hposition = 50%;
    text.positive.vposition = 50%;
]
/ stimulusframes = [1 = positive, me, smoking, end]
/ inputdevice = dragdrop
/ showmousecursor = true
/ validresponse = (me, smoking, end)
/ correctresponse = (me)
/ branch = [
    if(trial.positive.response != "end") list.triallist.nextvalue;
]
</trial>

<trial negative>
/ ontrialbegin = [
    text.negative.hposition = 50%;
    text.negative.vposition = 50%;
]
/ stimulusframes = [1 = negative, me, smoking, end]
/ inputdevice = dragdrop
/ showmousecursor = true
/ validresponse = (me, smoking, end)
/ correctresponse = (smoking)
/ branch = [
    if(trial.negative.response != "end") list.triallist.nextvalue;
]
</trial>

<block intervention>
/trials = [1 = list.triallist]
</block>

<list triallist>
/ items = (trial.positive, trial.negative)
/ poolsize = 10
</list>

<text end>
/ items = ("Click here to end the task.")
/ txbgcolor = black
/ txcolor = white
/ erase = false
/ vjustify = center
/ size = (24%, 6%)
/ position = (85%, 90%)
</text>


Sorry for butting in here.
But this script will help me a lot in my new experiment. My query is that - at present in this script, participant has to drag only one of the positive / negative words. How to do it in a way that participant has to drag both positive and negative words on to targets before he/she is taken to next set of words.
Thanks
 Abhi

You need to run two trials in sequence -- one for the 1st word the participant decides to drag to its position, followed by a second one for the 2nd word. Then start the next two-trial sequence for the next set of two words.

abhi
abhi
Guru (7.3K reputation)Guru (7.3K reputation)Guru (7.3K reputation)Guru (7.3K reputation)Guru (7.3K reputation)Guru (7.3K reputation)Guru (7.3K reputation)Guru (7.3K reputation)Guru (7.3K reputation)
Group: Forum Members
Posts: 114, Visits: 558
Dave - Thursday, October 11, 2018
abhi - Thursday, October 11, 2018
Dave - Monday, August 27, 2018
scollin - Monday, August 27, 2018


I managed to get it to work, thanks! One more question about this. Is it also possible to keep looping the trials until the participant presses a certain button? (i.e. that the participant can determine when the stop the task)

Yes, that's possible. Taking the 1st example I posted here, you would do it like this:

<instruct>
/ fontstyle = ("Arial", 2.8%, false, false, false, false, 5, 1)
/ txcolor = (white)
/ screencolor = black
</instruct>

<page intro>
^In the following task, you will be presented with negative words related to outcomes of smoking or with positive words you may experience if you quit smoking. You will also see an image of a cigarette, and the word 'me' on the page.
~n~nYour task is to:
~n* Drag the negative words away from you and towards the cigarette.
Drag the positive words towards the word 'me'.
~n~nPress the spacebar to begin.
</page>

<page end>
^This is the end.
</page>


<expt>
/ preinstructions = (intro)
/ blocks = [1=intervention]
/ postinstructions = (end)
</expt>

<item negative>
/1 = "lung cancer"
/2 = "addiction"
/3 = "heart disease"
/4 = "clogged arteries"
/5 = "blindness"
/6 = "amputation"
/7 = "death"
/8 = "tongue cancer"
/9 = "throat cancer"
/10 = "gangrene"
/11 = "stroke"
/12 = "asthma"
/13 = "feel unwell"
/14 = "out of breath"
/15 = "trapped"
/16 = "premature death"
/17 = "pollution"
/18 = "illness"
</item>

<item positive>
/1 = "healthy"
/2 = "vibrant"
/3 = "free"
/4 = "happy"
/5 = "in control"
/6 = "long life"
/7 = "energetic"
/8 = "refreshed"
/9 = "good"
/10 = "rewarding"
/11 = "breathe easily"
/12 = "independent"
/13 = "clean"
/14 = "energetic"
/15 = "feel good"
/16 = "wellbeing"
</item>

<item smoking>
/1 = "smoking"
</item>

<item me>
/1 = "me"
</item>

<text positive>
/ items = positive
/ valign = center
/ halign = center
/ position = (50%, 50%)
/ txcolor = green
/ fontstyle = ("Arial", 10%)
/ dropsource = true
</text>

<text negative>
/ items = negative
/ valign = center
/ halign = center
/ position = (50%, 50%)
/ txcolor = green
/ fontstyle = ("Arial", 10%)
/ dropsource = true
</text>

<text me>
/ items = me
/ valign = bottom
/ halign = center
/ position = (50%, 95%)
/ txcolor = black
/ fontstyle = ("Arial", 10%)
/ erase = false
/ droptarget = true
</text>

<text smoking>
/ items = smoking
/ valign = bottom
/ halign = center
/ position = (50%, 10%)
/ txcolor = black
/ fontstyle = ("Arial", 10%)
/ erase = false
/ droptarget = true
</text>

<trial positive>
/ ontrialbegin = [
    text.positive.hposition = 50%;
    text.positive.vposition = 50%;
]
/ stimulusframes = [1 = positive, me, smoking, end]
/ inputdevice = dragdrop
/ showmousecursor = true
/ validresponse = (me, smoking, end)
/ correctresponse = (me)
/ branch = [
    if(trial.positive.response != "end") list.triallist.nextvalue;
]
</trial>

<trial negative>
/ ontrialbegin = [
    text.negative.hposition = 50%;
    text.negative.vposition = 50%;
]
/ stimulusframes = [1 = negative, me, smoking, end]
/ inputdevice = dragdrop
/ showmousecursor = true
/ validresponse = (me, smoking, end)
/ correctresponse = (smoking)
/ branch = [
    if(trial.negative.response != "end") list.triallist.nextvalue;
]
</trial>

<block intervention>
/trials = [1 = list.triallist]
</block>

<list triallist>
/ items = (trial.positive, trial.negative)
/ poolsize = 10
</list>

<text end>
/ items = ("Click here to end the task.")
/ txbgcolor = black
/ txcolor = white
/ erase = false
/ vjustify = center
/ size = (24%, 6%)
/ position = (85%, 90%)
</text>


Sorry for butting in here.
But this script will help me a lot in my new experiment. My query is that - at present in this script, participant has to drag only one of the positive / negative words. How to do it in a way that participant has to drag both positive and negative words on to targets before he/she is taken to next set of words.
Thanks
 Abhi

You need to run two trials in sequence -- one for the 1st word the participant decides to drag to its position, followed by a second one for the 2nd word. Then start the next two-trial sequence for the next set of two words.

Thanks Dave. Sorry not clear. How to ensure that the next trial is the same set of the words as the previous one ?

Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 12K, Visits: 98K
abhi - Thursday, October 11, 2018
Dave - Thursday, October 11, 2018
abhi - Thursday, October 11, 2018
Dave - Monday, August 27, 2018
scollin - Monday, August 27, 2018


I managed to get it to work, thanks! One more question about this. Is it also possible to keep looping the trials until the participant presses a certain button? (i.e. that the participant can determine when the stop the task)

Yes, that's possible. Taking the 1st example I posted here, you would do it like this:

<instruct>
/ fontstyle = ("Arial", 2.8%, false, false, false, false, 5, 1)
/ txcolor = (white)
/ screencolor = black
</instruct>

<page intro>
^In the following task, you will be presented with negative words related to outcomes of smoking or with positive words you may experience if you quit smoking. You will also see an image of a cigarette, and the word 'me' on the page.
~n~nYour task is to:
~n* Drag the negative words away from you and towards the cigarette.
Drag the positive words towards the word 'me'.
~n~nPress the spacebar to begin.
</page>

<page end>
^This is the end.
</page>


<expt>
/ preinstructions = (intro)
/ blocks = [1=intervention]
/ postinstructions = (end)
</expt>

<item negative>
/1 = "lung cancer"
/2 = "addiction"
/3 = "heart disease"
/4 = "clogged arteries"
/5 = "blindness"
/6 = "amputation"
/7 = "death"
/8 = "tongue cancer"
/9 = "throat cancer"
/10 = "gangrene"
/11 = "stroke"
/12 = "asthma"
/13 = "feel unwell"
/14 = "out of breath"
/15 = "trapped"
/16 = "premature death"
/17 = "pollution"
/18 = "illness"
</item>

<item positive>
/1 = "healthy"
/2 = "vibrant"
/3 = "free"
/4 = "happy"
/5 = "in control"
/6 = "long life"
/7 = "energetic"
/8 = "refreshed"
/9 = "good"
/10 = "rewarding"
/11 = "breathe easily"
/12 = "independent"
/13 = "clean"
/14 = "energetic"
/15 = "feel good"
/16 = "wellbeing"
</item>

<item smoking>
/1 = "smoking"
</item>

<item me>
/1 = "me"
</item>

<text positive>
/ items = positive
/ valign = center
/ halign = center
/ position = (50%, 50%)
/ txcolor = green
/ fontstyle = ("Arial", 10%)
/ dropsource = true
</text>

<text negative>
/ items = negative
/ valign = center
/ halign = center
/ position = (50%, 50%)
/ txcolor = green
/ fontstyle = ("Arial", 10%)
/ dropsource = true
</text>

<text me>
/ items = me
/ valign = bottom
/ halign = center
/ position = (50%, 95%)
/ txcolor = black
/ fontstyle = ("Arial", 10%)
/ erase = false
/ droptarget = true
</text>

<text smoking>
/ items = smoking
/ valign = bottom
/ halign = center
/ position = (50%, 10%)
/ txcolor = black
/ fontstyle = ("Arial", 10%)
/ erase = false
/ droptarget = true
</text>

<trial positive>
/ ontrialbegin = [
    text.positive.hposition = 50%;
    text.positive.vposition = 50%;
]
/ stimulusframes = [1 = positive, me, smoking, end]
/ inputdevice = dragdrop
/ showmousecursor = true
/ validresponse = (me, smoking, end)
/ correctresponse = (me)
/ branch = [
    if(trial.positive.response != "end") list.triallist.nextvalue;
]
</trial>

<trial negative>
/ ontrialbegin = [
    text.negative.hposition = 50%;
    text.negative.vposition = 50%;
]
/ stimulusframes = [1 = negative, me, smoking, end]
/ inputdevice = dragdrop
/ showmousecursor = true
/ validresponse = (me, smoking, end)
/ correctresponse = (smoking)
/ branch = [
    if(trial.negative.response != "end") list.triallist.nextvalue;
]
</trial>

<block intervention>
/trials = [1 = list.triallist]
</block>

<list triallist>
/ items = (trial.positive, trial.negative)
/ poolsize = 10
</list>

<text end>
/ items = ("Click here to end the task.")
/ txbgcolor = black
/ txcolor = white
/ erase = false
/ vjustify = center
/ size = (24%, 6%)
/ position = (85%, 90%)
</text>


Sorry for butting in here.
But this script will help me a lot in my new experiment. My query is that - at present in this script, participant has to drag only one of the positive / negative words. How to do it in a way that participant has to drag both positive and negative words on to targets before he/she is taken to next set of words.
Thanks
 Abhi

You need to run two trials in sequence -- one for the 1st word the participant decides to drag to its position, followed by a second one for the 2nd word. Then start the next two-trial sequence for the next set of two words.

Thanks Dave. Sorry not clear. How to ensure that the next trial is the same set of the words as the previous one ?

Something along the following lines:

<item negative>
/1 = "lung cancer"
/2 = "addiction"
/3 = "heart disease"
/4 = "clogged arteries"
/5 = "blindness"
/6 = "amputation"
/7 = "death"
/8 = "tongue cancer"
/9 = "throat cancer"
/10 = "gangrene"
</item>

<item positive>
/1 = "healthy"
/2 = "vibrant"
/3 = "free"
/4 = "happy"
/5 = "in control"
/6 = "long life"
/7 = "energetic"
/8 = "refreshed"
/9 = "good"
/10 = "rewarding"
</item>

<item smoking>
/1 = "smoking"
</item>

<item me>
/1 = "me"
</item>

<text positive>
/ items = positive
/ valign = center
/ halign = center
/ position = (50%, 50%)
/ txcolor = green
/ fontstyle = ("Arial", 15%)
/ dropsource = true
/ select = values.positem
</text>

<text negative>
/ items = negative
/ valign = center
/ halign = center
/ position = (50%, 50%)
/ txcolor = green
/ fontstyle = ("Arial", 15%)
/ dropsource = true
/ select = values.negitem
</text>

<list negitemnumbers>
/ poolsize = 10
</list>

<list positemnumbers>
/ poolsize = 10
</list>

<values>
/ negitem = 1
/ positem = 1
</values>


<text me>
/ items = me
/ valign = bottom
/ halign = center
/ position = (50%, 95%)
/ txcolor = black
/ fontstyle = ("Arial", 15%)
/ erase = false
/ droptarget = true
/ dropposition = (50%, 95%)
</text>

<text smoking>
/ items = smoking
/ valign = top
/ halign = center
/ position = (50%, 5%)
/ txcolor = black
/ fontstyle = ("Arial", 15%)
/ erase = false
/ droptarget = true
/ dropposition = (50%, 5%)
</text>

<trial first>
/ ontrialbegin = [
values.positem = list.positemnumbers.nextindex;
values.negitem = list.negitemnumbers.nextindex;
  text.positive.hposition = 30%;
  text.positive.vposition = 50%;
text.negative.hposition = 70%;
  text.negative.vposition = 50%;
text.positive.dropsource = true;
text.negative.dropsource = true;
text.me.droptarget = true;
text.smoking.droptarget = true;
]
/ ontrialend = [
if (trial.first.response == "me")
text.me.droptarget = false;
]
/ ontrialend = [
if (trial.first.response == "smoking")
text.smoking.droptarget = false;
]
/ stimulusframes = [1 = positive, negative, me, smoking]
/ inputdevice = dragdrop
/ showmousecursor = true
/ validresponse = (me, smoking)
/ branch = [
trial.second
]
</trial>

<trial second>
/ ontrialbegin = [
if (text.positive.vposition != 50%)
text.positive.dropsource = false;
]
/ ontrialbegin = [
if (text.negative.vposition != 50%)
text.negative.dropsource = false;
]
/ stimulusframes = [1 = positive, negative, me, smoking]
/ inputdevice = dragdrop
/ showmousecursor = true
/ validresponse = (me, smoking)
</trial>

<block myblock>
/trials = [1-10 = first]
</block>

<expt>
/ blocks = [1=myblock]
</expt>

abhi
abhi
Guru (7.3K reputation)Guru (7.3K reputation)Guru (7.3K reputation)Guru (7.3K reputation)Guru (7.3K reputation)Guru (7.3K reputation)Guru (7.3K reputation)Guru (7.3K reputation)Guru (7.3K reputation)
Group: Forum Members
Posts: 114, Visits: 558
Dave - Thursday, October 11, 2018
abhi - Thursday, October 11, 2018
Dave - Thursday, October 11, 2018
abhi - Thursday, October 11, 2018
Dave - Monday, August 27, 2018
scollin - Monday, August 27, 2018


I managed to get it to work, thanks! One more question about this. Is it also possible to keep looping the trials until the participant presses a certain button? (i.e. that the participant can determine when the stop the task)

Yes, that's possible. Taking the 1st example I posted here, you would do it like this:

<instruct>
/ fontstyle = ("Arial", 2.8%, false, false, false, false, 5, 1)
/ txcolor = (white)
/ screencolor = black
</instruct>

<page intro>
^In the following task, you will be presented with negative words related to outcomes of smoking or with positive words you may experience if you quit smoking. You will also see an image of a cigarette, and the word 'me' on the page.
~n~nYour task is to:
~n* Drag the negative words away from you and towards the cigarette.
Drag the positive words towards the word 'me'.
~n~nPress the spacebar to begin.
</page>

<page end>
^This is the end.
</page>


<expt>
/ preinstructions = (intro)
/ blocks = [1=intervention]
/ postinstructions = (end)
</expt>

<item negative>
/1 = "lung cancer"
/2 = "addiction"
/3 = "heart disease"
/4 = "clogged arteries"
/5 = "blindness"
/6 = "amputation"
/7 = "death"
/8 = "tongue cancer"
/9 = "throat cancer"
/10 = "gangrene"
/11 = "stroke"
/12 = "asthma"
/13 = "feel unwell"
/14 = "out of breath"
/15 = "trapped"
/16 = "premature death"
/17 = "pollution"
/18 = "illness"
</item>

<item positive>
/1 = "healthy"
/2 = "vibrant"
/3 = "free"
/4 = "happy"
/5 = "in control"
/6 = "long life"
/7 = "energetic"
/8 = "refreshed"
/9 = "good"
/10 = "rewarding"
/11 = "breathe easily"
/12 = "independent"
/13 = "clean"
/14 = "energetic"
/15 = "feel good"
/16 = "wellbeing"
</item>

<item smoking>
/1 = "smoking"
</item>

<item me>
/1 = "me"
</item>

<text positive>
/ items = positive
/ valign = center
/ halign = center
/ position = (50%, 50%)
/ txcolor = green
/ fontstyle = ("Arial", 10%)
/ dropsource = true
</text>

<text negative>
/ items = negative
/ valign = center
/ halign = center
/ position = (50%, 50%)
/ txcolor = green
/ fontstyle = ("Arial", 10%)
/ dropsource = true
</text>

<text me>
/ items = me
/ valign = bottom
/ halign = center
/ position = (50%, 95%)
/ txcolor = black
/ fontstyle = ("Arial", 10%)
/ erase = false
/ droptarget = true
</text>

<text smoking>
/ items = smoking
/ valign = bottom
/ halign = center
/ position = (50%, 10%)
/ txcolor = black
/ fontstyle = ("Arial", 10%)
/ erase = false
/ droptarget = true
</text>

<trial positive>
/ ontrialbegin = [
    text.positive.hposition = 50%;
    text.positive.vposition = 50%;
]
/ stimulusframes = [1 = positive, me, smoking, end]
/ inputdevice = dragdrop
/ showmousecursor = true
/ validresponse = (me, smoking, end)
/ correctresponse = (me)
/ branch = [
    if(trial.positive.response != "end") list.triallist.nextvalue;
]
</trial>

<trial negative>
/ ontrialbegin = [
    text.negative.hposition = 50%;
    text.negative.vposition = 50%;
]
/ stimulusframes = [1 = negative, me, smoking, end]
/ inputdevice = dragdrop
/ showmousecursor = true
/ validresponse = (me, smoking, end)
/ correctresponse = (smoking)
/ branch = [
    if(trial.negative.response != "end") list.triallist.nextvalue;
]
</trial>

<block intervention>
/trials = [1 = list.triallist]
</block>

<list triallist>
/ items = (trial.positive, trial.negative)
/ poolsize = 10
</list>

<text end>
/ items = ("Click here to end the task.")
/ txbgcolor = black
/ txcolor = white
/ erase = false
/ vjustify = center
/ size = (24%, 6%)
/ position = (85%, 90%)
</text>


Sorry for butting in here.
But this script will help me a lot in my new experiment. My query is that - at present in this script, participant has to drag only one of the positive / negative words. How to do it in a way that participant has to drag both positive and negative words on to targets before he/she is taken to next set of words.
Thanks
 Abhi

You need to run two trials in sequence -- one for the 1st word the participant decides to drag to its position, followed by a second one for the 2nd word. Then start the next two-trial sequence for the next set of two words.

Thanks Dave. Sorry not clear. How to ensure that the next trial is the same set of the words as the previous one ?

Something along the following lines:

<item negative>
/1 = "lung cancer"
/2 = "addiction"
/3 = "heart disease"
/4 = "clogged arteries"
/5 = "blindness"
/6 = "amputation"
/7 = "death"
/8 = "tongue cancer"
/9 = "throat cancer"
/10 = "gangrene"
</item>

<item positive>
/1 = "healthy"
/2 = "vibrant"
/3 = "free"
/4 = "happy"
/5 = "in control"
/6 = "long life"
/7 = "energetic"
/8 = "refreshed"
/9 = "good"
/10 = "rewarding"
</item>

<item smoking>
/1 = "smoking"
</item>

<item me>
/1 = "me"
</item>

<text positive>
/ items = positive
/ valign = center
/ halign = center
/ position = (50%, 50%)
/ txcolor = green
/ fontstyle = ("Arial", 15%)
/ dropsource = true
/ select = values.positem
</text>

<text negative>
/ items = negative
/ valign = center
/ halign = center
/ position = (50%, 50%)
/ txcolor = green
/ fontstyle = ("Arial", 15%)
/ dropsource = true
/ select = values.negitem
</text>

<list negitemnumbers>
/ poolsize = 10
</list>

<list positemnumbers>
/ poolsize = 10
</list>

<values>
/ negitem = 1
/ positem = 1
</values>


<text me>
/ items = me
/ valign = bottom
/ halign = center
/ position = (50%, 95%)
/ txcolor = black
/ fontstyle = ("Arial", 15%)
/ erase = false
/ droptarget = true
/ dropposition = (50%, 95%)
</text>

<text smoking>
/ items = smoking
/ valign = top
/ halign = center
/ position = (50%, 5%)
/ txcolor = black
/ fontstyle = ("Arial", 15%)
/ erase = false
/ droptarget = true
/ dropposition = (50%, 5%)
</text>

<trial first>
/ ontrialbegin = [
values.positem = list.positemnumbers.nextindex;
values.negitem = list.negitemnumbers.nextindex;
  text.positive.hposition = 30%;
  text.positive.vposition = 50%;
text.negative.hposition = 70%;
  text.negative.vposition = 50%;
text.positive.dropsource = true;
text.negative.dropsource = true;
text.me.droptarget = true;
text.smoking.droptarget = true;
]
/ ontrialend = [
if (trial.first.response == "me")
text.me.droptarget = false;
]
/ ontrialend = [
if (trial.first.response == "smoking")
text.smoking.droptarget = false;
]
/ stimulusframes = [1 = positive, negative, me, smoking]
/ inputdevice = dragdrop
/ showmousecursor = true
/ validresponse = (me, smoking)
/ branch = [
trial.second
]
</trial>

<trial second>
/ ontrialbegin = [
if (text.positive.vposition != 50%)
text.positive.dropsource = false;
]
/ ontrialbegin = [
if (text.negative.vposition != 50%)
text.negative.dropsource = false;
]
/ stimulusframes = [1 = positive, negative, me, smoking]
/ inputdevice = dragdrop
/ showmousecursor = true
/ validresponse = (me, smoking)
</trial>

<block myblock>
/trials = [1-10 = first]
</block>

<expt>
/ blocks = [1=myblock]
</expt>

Thanks for this Dave. Working perfect.

I still have'nt understood the 'value function' so far. That's the key, I think.

One last thing- In this script participant cannot undo the decision of drag /drop. i.e., if he/she changes his/her mind after dragging, that can't be done. What is the command for that ?  Thanks.




GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search