By Wenkuo - 2/19/2015
Hi,
I've been trying to finish my experiment for Inquisit, as I don't have that much experience with programming however, I've been stuch at a task of which I am unsure on how to program it.
The idea is that participants are presented with a single stimulus at a time, consisting of a word describing an emotion. These emotions are shown for a certain amount of time. Once all emotions have been shown, participants will then be asked to arrange the emotions in order of time shown. So if they think that 'nervous' has been shown the longest, then they rank that first followe by the second longest emotion shown etc. What I currently have is this:
<item words> / 1 = "Nervous" / 2 = "Distressed" / 3 = "Worried" / 4 = "Scared" / 5 = "Upset" / 6 = "Inspired" / 7 = "Active" / 8 = "Strong" / 8 = "Determined" / 10 = "Resolved" </item>
<text words> / items = words / select = noreplace / position = (50%, 50%) / txcolor = (0, 0, 0) </text>
Is there any way to add in a duration for the items shown? For example, if I want all items to be shown for 3 seconds. And how would I go about turning this fully into an ordering task? For example, if I want to show all emotions at the same time on the left side of the screen (after showing them one by one) and then have the participants order the emotions by clicking on them, with the new order appearing on the right side of the screen.
Hopefully the questions are clear.
Many thanks in advance,
Wenkuo
|
By Dave - 2/19/2015
> Is there any way to add in a duration for the items shown? For example, if I want all items to be shown for 3 seconds.
Set up a <trial> element that displays the <text> stimulus for 3 seconds (3000 ms). Run that trial 10 times via a <block>.
<trial mytrial> / stimulustimes = [0=words] / validresponse = (0) / trialduration = 3000 </trial>
<block myblock> / trials = [1-10 = mytrial] ... </block>
> And how would I go about turning this fully into an ordering task? For example, if I want to show all emotions at the same time > on the left side of the screen (after showing them one by one) and then have the participants order the emotions by clicking on > them, with the new order appearing on the right side of the screen.
In a nutshell, you do it like this:
<values> / respstring = "" / ncorrect = 0 </values>
<block myblock> / trials = [1-4=showword; 5-8=sortword; 9=end] </block>
<trial showword> / ontrialend = [item.wordsshowninorder.appenditem(text.word.currentitem)] / stimulustimes = [0=word] / validresponse = (0) / trialduration = 3000 </trial>
<item worditems> / 1 = "Nervous" / 2 = "Distressed" / 3 = "Worried" / 4 = "Scared" </item>
*** Used to store word items in the order shown at runtime *** <item wordsshowninorder> </item>
<text word> / items = worditems / select = noreplace / position = (50%, 50%) / txcolor = (0, 0, 0) </text>
<trial sortword> / ontrialend = [values.respstring=concat(values.respstring, trial.sortword.response); item.recallitems.appenditem(trial.sortword.response)] / stimulusframes = [1=Nervous, Distressed, Worried, Scared, p1, p2, p3, p4] / inputdevice = mouse / validresponse = (Nervous, Distressed, Worried, Scared) / isvalidresponse = [contains(values.respstring, trial.sortword.response) == false] </trial>
<text Nervous> / items = worditems / select = 1 / erase = false / position = (25%, 10%) </text>
<text Distressed> / items = worditems / select = 2 / erase = false / position = (25%, 20%) </text>
<text Worried> / items = worditems / select = 3 / erase = false / position = (25%, 30%) </text>
<text Scared> / items = worditems / select = 4 / erase = false / position = (25%, 40%) </text>
<text p1> / items = recallitems / select = 1 / erase = false / position = (75%, 10%) </text>
<text p2> / items = recallitems / select = 2 / erase = false / position = (75%, 20%) </text>
<text p3> / items = recallitems / select = 3 / erase = false / position = (75%, 30%) </text>
<text p4> / items = recallitems / select = 4 / erase = false / position = (75%, 40%) </text>
*** Used to store word items in the order recalled at runtime *** <item recallitems> </item>
<trial end> / ontrialbegin = [if (item.recallitems.item(1)==item.wordsshowninorder.item(1)) values.ncorrect+=1; if (item.recallitems.item(2)==item.wordsshowninorder.item(2)) values.ncorrect+=1; if (item.recallitems.item(3)==item.wordsshowninorder.item(3)) values.ncorrect+=1; if (item.recallitems.item(4)==item.wordsshowninorder.item(4)) values.ncorrect+=1; ] / stimulusframes = [1=Nervous, Distressed, Worried, Scared, p1, p2, p3, p4, ncorrect] / validresponse = (0) / trialduration = 5000 </trial>
<text ncorrect> / items = ("You recalled <%values.ncorrect%> words in the correct position.") / position = (50%, 50%) </text>
|
By Wenkuo - 2/23/2015
Hi Dave,
Thank you for the reply! It has helped a lot. However, there is one small thing that I'm wondering about. Is it possible to include a continue button in the task? I've tried making a custom continue button by adding a branch function, like this:
<text continue> / items = ("Continue") / position = (50%,75%) </text>
<trial end> ... / branch = [if (trial.end.response == text.continue) survey.emtiquestionnaire] </trial>
But so far, I haven't gotten it to work yet. I would really like to add one for consistency. Is there any way to do this? And would it also be possible to make it look similar to the buttons that appear in openended/survey?
|
By Dave - 2/23/2015
Yes. Display the "continue" <text> element via <trial> end's /stimulustimes or -frames.
Then set
/ validresponse = (continue)
and
/ branch = [if (trial.end.response=="continue")...]
Note that you cannot /branch from a <trial> to a <survey>. A <survey> is a kind of <block>. You may only /branch at the same level, i.e., a <trial> may branch to another <trial> (but not a <block>), a <block> may branch to another <block> (but not a <trial>). Your branch must thus reside at the <block>-level.
Furthermore, I don't see why you would need a /branch at all here. Simply run the survey after the learning / recall block via your <expt>'s /blocks attribute.
|
By Wenkuo - 2/26/2015
Hi Dave,
Thank you for the quick reply. The reason why I want a branch, or at least a working continue button there is for consistency. The rest of the experiment uses various open ended questions that also make use of it. The other reason is that, by having a continue button, participants can choose when to continue rather than being reliant on waiting for the trial to finish itself.
This actually leads to my next question: is there any way to change the timeout option so that it relies on the continue button rather than a duration?
|
By Dave - 2/26/2015
> The reason why I want a branch, or at least a working continue button there is for consistency.
My point is that you don't need a /branch to have a working continue button.
> is there any way to change the timeout option so that it relies on the continue button rather than a duration?
Remove the /timeout attribute. Define the continue <text> element as /validresponse in the <trial>. The trial will terminate when a valid response is given.
|
By Wenkuo - 3/5/2015
Hi Dave,
Thank you for the help! It has helped me a lot with my script. However, there is still something that I'm unsure on how to get it to work. As it is, I've changed it up a bit with the help of someone else. This is what I currently have:
<trial showword> / ontrialend = [item.wordsshowninorder.appenditem(text.word.currentitem)] / stimulustimes = [0 = word] / validresponse = (0) / trialduration = 3000 </trial>
<trial sortword> /ontrialbegin = [if (values.choices == 12) values.klaar = 2 else values.klaar = 1] / stimulusframes = [1 = myorder, wordsseen, Nervous, Distressed, Worried, Scared, Upset, Inspired, Active, Strong, Determined, Resolved, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, Continue] / inputdevice = mouse / validresponse = (Nervous, Distressed, Worried, Scared, Upset, Inspired, Active, Strong, Determined, Resolved, Continue) / ontrialend = [if (trial.sortword.response == "Nervous") text.nervous.textcolor = blue] / ontrialend = [if (trial.sortword.response == "Distressed") text.distressed.textcolor = blue] / ontrialend = [if (trial.sortword.response == "Worried") text.worried.textcolor = blue] / ontrialend = [if (trial.sortword.response == "Scared") text.scared.textcolor = blue] / ontrialend = [if (trial.sortword.response == "Upset") text.upset.textcolor = blue] / ontrialend = [if (trial.sortword.response == "Inspired") text.inspired.textcolor = blue] / ontrialend = [if (trial.sortword.response == "Active") text.active.textcolor = blue] / ontrialend = [if (trial.sortword.response == "Strong") text.strong.textcolor = blue] / ontrialend = [if (trial.sortword.response == "Determined") text.determined.textcolor = blue] / ontrialend = [if (trial.sortword.response == "Resolved") text.resolved.textcolor = blue] / branch = [if (trial.sortword.response != "klaar") trial.sortword_confirm] </trial>
<trial sortword_confirm> / ontrialend = [if (trial.sortword_confirm.response == "undo" && trial.sortword.response == "Nervous") text.nervous.textcolor = black] / ontrialend = [if (trial.sortword_confirm.response == "undo" && trial.sortword.response == "Distressed") text.distressed.textcolor = black] / ontrialend = [if (trial.sortword_confirm.response == "undo" && trial.sortword.response == "Worried") text.worried.textcolor = black] / ontrialend = [if (trial.sortword_confirm.response == "undo" && trial.sortword.response == "Scared") text.scared.textcolor = black] / ontrialend = [if (trial.sortword_confirm.response == "undo" && trial.sortword.response == "Upset") text.upset.textcolor = black] / ontrialend = [if (trial.sortword_confirm.response == "undo" && trial.sortword.response == "Inspired") text.inspired.textcolor = black] / ontrialend = [if (trial.sortword_confirm.response == "undo" && trial.sortword.response == "Active") text.active.textcolor = black] / ontrialend = [if (trial.sortword_confirm.response == "undo" && trial.sortword.response == "Strong") text.strong.textcolor = black] / ontrialend = [if (trial.sortword_confirm.response == "undo" && trial.sortword.response == "Determined") text.determined.textcolor = black] / ontrialend = [if (trial.sortword_confirm.response == "undo" && trial.sortword.response == "Resolved") text.resolved.textcolor = black] / ontrialend = [if (trial.sortword_confirm.response == "Confirm") item.recallitems.appenditem(trial.sortword.response)] / stimulusframes = [1 = myorder, wordsseen, Nervous, Distressed, Worried, Scared, Upset, Inspired, Active, Strong, Determined, Resolved, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, Confirm, Undo, Continue] / inputdevice = mouse / validresponse = (Confirm, Undo) / ontrialend = [if (trial.sortword_confirm.response != "undo") values.choices = values.choices+1] / branch = [if (values.choices < 12) trial.sortword] </trial>
<values> / klaar = 1 / choices = 1 </values>
<item worditems> / 1 = "Nervous" / 2 = "Distressed" / 3 = "Worried" / 4 = "Scared" / 5 = "Upset" / 6 = "Inspired" / 7 = "Active" / 8 = "Strong" / 9 = "Determined" / 10 = "Resolved" </item>
<text wordsseen> / items = ("List of words shown (in order of appearance)") / position = (5%, 25%) / erase = false / halign = left / fontstyle = ("Arial", 18, false, false, true, false, 5, 1) </text>
<text myorder> / items = ("Re-arranged word order (based on duration of the word shown") / position = (51%, 25%) / erase = false / halign = left / fontstyle = ("Arial", 18, false, false, true, false, 5, 1) </text>
*** Used to store word items in the order shown at runtime ***
<item wordsshowninorder> </item>
*** Used to store word items in the order recalled at runtime ***
<item recallitems> </item>
<text word> / items = worditems / select = noreplacenorepeat / position = (50%, 50%) / txcolor = (0, 0, 0) / fontstyle = ("Times New Roman", 25pt, false, false, false, false, 5) </text>
<text confirm> / items = ("Confirm") / position = (30%, 90%) / halign = left / fontstyle = ("Arial", 2%, false, false, false, false, 5, 1) </text>
<text undo> / items = ("Undo") / position = (5%, 90%) / halign = left / fontstyle = ("Arial", 2%, false, false, false, false, 5, 1) </text>
<text Continue> / items = ("Continue","") / position = (75%, 90%) / erase = false / halign = left / fontstyle = ("Arial", 2%, false, false, false, false, 5, 1) / select = values.klaar </text>
<text Nervous> / items = worditems / select = 1 / position = (5%, 30%) / erase = false / halign = left / fontstyle = ("Arial", 14 false, false, false, false, 5, 1) </text>
<text Distressed> / items = worditems / select = 2 / erase = false / position = (5%, 35%) / halign = left / fontstyle = ("Arial", 14 false, false, false, false, 5, 1) </text>
<text Worried> / items = worditems / select = 3 / erase = false / position = (5%, 40%) / halign = left / fontstyle = ("Arial", 14 false, false, false, false, 5, 1) </text>
<text Scared> / items = worditems / select = 4 / erase = false / position = (5%, 45%) / halign = left / fontstyle = ("Arial", 14 false, false, false, false, 5, 1) </text>
<text Upset> / items = worditems / select = 5 / erase = false / position = (5%, 50%) / halign = left / fontstyle = ("Arial", 14 false, false, false, false, 5, 1) </text>
<text Inspired> / items = worditems / select = 6 / erase = false / position = (5%, 55%) / halign = left / fontstyle = ("Arial", 14 false, false, false, false, 5, 1) </text>
<text Active> / items = worditems / select = 7 / erase = false / position = (5%, 60%) / halign = left / fontstyle = ("Arial", 14 false, false, false, false, 5, 1) </text>
<text Strong> / items = worditems / select = 8 / erase = false / position = (5%, 65%) / halign = left / fontstyle = ("Arial", 14 false, false, false, false, 5, 1) </text>
<text Determined> / items = worditems / select = 9 / erase = false / position = (5%, 70%) / halign = left / fontstyle = ("Arial", 14 false, false, false, false, 5, 1) </text>
<text Resolved> / items = worditems / select = 10 / erase = false / position = (5%, 75%) / halign = left / fontstyle = ("Arial", 14 false, false, false, false, 5, 1) </text>
<text p1> / items = recallitems / select = 1 / erase = false / position = (51%, 30%) / halign = left / fontstyle = ("Arial", 14 false, false, false, false, 5, 1) </text>
<text p2> / items = recallitems / select = 2 / erase = false / position = (51%, 35%) / halign = left / fontstyle = ("Arial", 14 false, false, false, false, 5, 1) </text>
<text p3> / items = recallitems / select = 3 / erase = false / position = (51%, 40%) / halign = left / fontstyle = ("Arial", 14 false, false, false, false, 5, 1) </text>
<text p4> / items = recallitems / select = 4 / erase = false / position = (51%, 45%) / halign = left / fontstyle = ("Arial", 14 false, false, false, false, 5, 1) </text>
<text p5> / items = recallitems / select = 5 / erase = false / position = (51%, 50%) / halign = left / fontstyle = ("Arial", 14 false, false, false, false, 5, 1) </text>
<text p6> / items = recallitems / select = 6 / erase = false / position = (51%, 55%) / halign = left / fontstyle = ("Arial", 14 false, false, false, false, 5, 1) </text>
<text p7> / items = recallitems / select = 7 / erase = false / position = (51%, 60%) / halign = left / fontstyle = ("Arial", 14 false, false, false, false, 5, 1) </text>
<text p8> / items = recallitems / select = 8 / erase = false / position = (51%, 65%) / halign = left / fontstyle = ("Arial", 14 false, false, false, false, 5, 1) </text>
<text p9> / items = recallitems / select = 9 / erase = false / position = (51%, 70%) / halign = left / fontstyle = ("Arial", 14 false, false, false, false, 5, 1) </text>
<text p10> / items = recallitems / select = 10 / erase = false / position = (51%, 75%) / halign = left / fontstyle = ("Arial", 14 false, false, false, false, 5, 1) </text>
What I'm wondering about is whether there is any way to adapt this script so that the words that appear in the left list will disappear from that list and re-appear on the right list, once someone selects the word and confirms the selection. I want to do this so that the participants can see that something is happening. This is currently done by making a word permanently blue, but by making it disappear, it will be clearer for them to see which words are left over.
|
By Dave - 3/5/2015
Set the respective <text> item's textcolor to whatever the screencolor is (instead of blue)?
|
|