Group: Forum Members
Posts: 27,
Visits: 47
|
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.
|
Group: Administrators
Posts: 13K,
Visits: 104K
|
> 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>
|