Group: Forum Members
Posts: 21,
Visits: 57
|
Dear Community,
I am struggling with an implementation, and I am yet to find a solution by myself or in this forum. I want to assign different items to a stimulus element (sound and picture) depending on earlier selections (the participants have to enter their language and gender by dropdown). I would love to do this via an expression, but have not yet found a satisfying solution. Creating an empty <item> and filling it with .appenditem is not an option since this would be to much code. I created a mock experiment to visualize, what I want to do. Maybe someone has a clean solution. The crucial part is the / ontrialend expression in the select-<trial>
<defaults> / inputdevice = keyboard </defaults>
<item a> / 1 = "first" / 2 = "choice" </item>
<item b> / 1 = "second" / 2 = "select" </item>
<text instruction> / items = ("Press 'a' for the first items, press 'b' for the second items") </text>
<trial select> / stimulusframes = [1 = instruction] / correctresponse = (30, 48) / ontrialend = [ if (trial.select.response == 30) { text.continue.items = item.a; } else if (trial.select.response == 48) { text.continue.items = item.b; } else { text.continue.items = "ERROR"; } ] </trial>
<text dynamical> / select = sequence </text>
<text continue> / items = ("Press SPACE to continue") / vposition = 80% </text>
<trial showtext> / stimulusframes = [1 = dynamical; 2 = continue] / validresponse = (57) </trial>
<block showblock> / trials = [1 = select; 2-3 = showtext] </block>
Thank you in advance. Best, Daniel
|