L&S
|
|
Group: Forum Members
Posts: 4,
Visits: 19
|
Hi, we have encountered a problem in our script that we cannot solve at this moment and would be very grateful for help. We googled extensively and tried to use the search in this forum, but we couldn't find anything that fit the bill. In a first step we present geometrical shapes and emotional pictures to our participants so an association is learned and then, in a second step, we test for this association in a decision task. Both steps repeat three times for three different shapes and types of emotional picture. All in all there are twelve conditions to account for different combinations of shape and picture type. Also, after each decision task participants have to fill out a questionaire (also implemented in inquisit) to create a break. We use the branch command to jump from the learning blocks to the decision blocks to the questionaire and back to the next learning block. Everything goes fine till after the first questionaire where the experiment suddenly closes. This happens every time we use the test monkey even though there is no faulty code pointed out when we simply validate the sript syntax. However, the test monkey gives out this error message: The element 'Lernen1b' in branch expression 'Lernen1b' is the wrong element type. Below are some excerpts of our code that should contain the error. The first one is the last page of a questionaire that should branch back to the second learning block. The noreplace is part of an additional randomization that's part of our design; we tried taking it out but this didn't solve the problem, the exact same error occurred. <surveypage DAS8> / subcaption = "Ihre Antworten auf folgende Meinungen sollen ausdrücken, was sie meistens denken." / questions = [1=DAS36; 2=DAS37; 3=DAS38; 4=DAS39; 5=DAS40] / branch = [if (values.bedingungsvariable == 1) noreplace (block.lernen1b, block.lernen2b)] / branch = [if (values.bedingungsvariable == 2) noreplace (block.lernen1b, block.lernen2b)] / branch = [if (values.bedingungsvariable == 3) noreplace (block.lernen3b, block.lernen4b)] / branch = [if (values.bedingungsvariable == 4) noreplace (block.lernen3b, block.lernen4b)] / branch = [if (values.bedingungsvariable == 5) noreplace (block.lernen5b, block.lernen6b)] / branch = [if (values.bedingungsvariable == 6) noreplace (block.lernen5b, block.lernen6b)] / branch = [if (values.bedingungsvariable == 7) noreplace (block.lernen7b, block.lernen8b)] / branch = [if (values.bedingungsvariable == 8) noreplace (block.lernen7b, block.lernen8b)] / branch = [if (values.bedingungsvariable == 9) noreplace (block.lernen9b, block.lernen10b)] / branch = [if (values.bedingungsvariable == 10) noreplace (block.lernen9b, block.lernen10b)] / branch = [if (values.bedingungsvariable == 11) noreplace (block.lernen11b, block.lernen12b)] / branch = [if (values.bedingungsvariable == 12) noreplace (block.lernen11b, block.lernen12b)] </surveypage> The next excerpt is the second learning block that according to the error message is the " wrong element type": <block Lernen1b> / trials = [1 = instruction1; 2-6, 9-14, 17-22 = noreplace (Quadrat1positiv, Quadrat9neutral); 7, 15, 23 = Zwischenabfrage_Quadrat1pos; 8, 16, 24 = Zwischenabfrage_Quadrat9pos] / branch = [block.abfrage1und2b] </block>
We already tried several (sometimes pretty stupid) things to get rid of this problem but without avail. Any suggestions are highly appreciated!
Best, Lukas & Sven
|
|
|
Dave
|
|
Group: Administrators
Posts: 13K,
Visits: 104K
|
A <surveypage> is a special type of <trial>. A <survey> is a special type of <block>.
/branch attributes *must* branch to an element of the same type as the element containing the /branch. I.e.,
- A <trial> can /branch to another <trial> (<openended>, <likert> and <surveypage> are types of <trial> elements). A <trial> *cannot* /branch to a <block>. - A <block> can /branch to another <block>. It *cannot* /branch to a <trial>.
<expt> / blocks = [1=myblock] </expt>
<block myblock> / trials = [1=mytrial] / branch = [if (values.myvalue) noreplace(block.a, block.b)] </block>
<block a> / trials = [1=mytrial] </block>
<block b> / trials = [1=mytrial] </block>
<trial mytrial> / stimulusframes = [1=mytext] / validresponse = (57) </trial>
<text mytext> / items = ("<%script.currentblock%>") </text>
<values> / myvalue = true </values>
|
|
|
L&S
|
|
Group: Forum Members
Posts: 4,
Visits: 19
|
Dave (4/10/2015)
/branch attributes *must* branch to an element of the same type as the element containing the /branch.I feel like an idiot but I actually didn't know that. Thanks so much for clarifying! Now we should be able to get this right...
|
|
|
Dave
|
|
Group: Administrators
Posts: 13K,
Visits: 104K
|
It's not necessarily obvious, there really isn't any reason to feel bad. Let me know if can't get it to work (note: you can attach files to a thread via the +Insert menu).
|
|
|
L&S
|
|
Group: Forum Members
Posts: 4,
Visits: 19
|
Thank you. Indeed another problem has come up, unfortunately: The branch command now works after we placed it in the survey elements, but the branch doesn't lead where we need it to lead. Specifically: We have three shapes (circle, square, triangle) and three different picture stimuli (positive, negative and fear specific). Every participant is assigned to one specific condition where, say, circle is associated with positive stimuli, a square is associated with negative stimuli and a triangle is associated with fear specific stimuli. These associations are randomized, hence 6 different conditions + another 6 to vary the sizes of the shapes. This is made complicated by the questionaires that are presented to the participants after each shape/stimulus association has been tested through our decision task. Every participant sees the same questionaire, but afterwards they have to return to their respective condition. I.e. if they learned an association between circle and positive stimuli, they mustn't see an association between square and positive stimuli afterwards; for every participant all shapes need to have different stimuli attached to them so all stimuli occur once. We had hoped to achieve this by assigning one of 12 numbers to each participant according to the condition they had been placed in. We used this values command: <values> / Bedingungsvariable = true </values>
<trial Zähler_1> /timeout = 1 / ontrialend= [values.bedingungsvariable = 1] </trial>
<trial Zähler_2> /timeout = 1 / ontrialend= [values.bedingungsvariable = 2] </trial>
<trial Zähler_3> /timeout = 1 / ontrialend= [values.bedingungsvariable = 3] </trial>
<trial Zähler_4> /timeout = 1 / ontrialend= [values.bedingungsvariable = 4] </trial>
<trial Zähler_5> /timeout = 1 / ontrialend= [values.bedingungsvariable = 5] </trial>
<trial Zähler_6> /timeout = 1 / ontrialend= [values.bedingungsvariable = 6] </trial>
<trial Zähler_7> /timeout = 1 / ontrialend= [values.bedingungsvariable = 7] </trial>
<trial Zähler_8> /timeout = 1 / ontrialend= [values.bedingungsvariable = 8] </trial>
<trial Zähler_9> /timeout = 1 / ontrialend= [values.bedingungsvariable = 9] </trial>
<trial Zähler_10> /timeout = 1 / ontrialend= [values.bedingungsvariable = 10] </trial>
<trial Zähler_11> /timeout = 1 / ontrialend= [values.bedingungsvariable = 11] </trial>
<trial Zähler_12> /timeout = 1 / ontrialend= [values.bedingungsvariable = 12] </trial> The respective trial was then included into the first learning block of each condition. When branching from the questionaire two the second learning block, we used the code that I already quoted to assign them to the right block according to this value: <survey DAS> / pages = [1=DAS1; 2=DAS2; 3=DAS3; 4=DAS4; 5=DAS5; 6=DAS6; 7=DAS7; 8=DAS8] / subcaptionfontstyle = ("Arial", 13pt, true, false, false, false, 5, 0)
/ fontstyle = ("Arial", 13pt, true, false, false, false, 5, 0) / responsefontstyle = ("Arial", 11pt, false, false, false, false, 5, 0) / itemspacing = 2% / showpagenumbers = false / showquestionnumbers = false / showbackbutton = false / nextlabel = "Weiter" / finishlabel = "Weiter" / branch = [if (values.bedingungsvariable == 1) noreplace (block.lernen1b, block.lernen2b)] / branch = [if (values.bedingungsvariable == 2) noreplace (block.lernen1b, block.lernen2b)] / branch = [if (values.bedingungsvariable == 3) noreplace (block.lernen3b, block.lernen4b)] / branch = [if (values.bedingungsvariable == 4) noreplace (block.lernen3b, block.lernen4b)] / branch = [if (values.bedingungsvariable == 5) noreplace (block.lernen5b, block.lernen6b)] / branch = [if (values.bedingungsvariable == 6) noreplace (block.lernen5b, block.lernen6b)] / branch = [if (values.bedingungsvariable == 7) noreplace (block.lernen7b, block.lernen8b)] / branch = [if (values.bedingungsvariable == 8) noreplace (block.lernen7b, block.lernen8b)] / branch = [if (values.bedingungsvariable == 9) noreplace (block.lernen9b, block.lernen10b)] / branch = [if (values.bedingungsvariable == 10) noreplace (block.lernen9b, block.lernen10b)] / branch = [if (values.bedingungsvariable == 11) noreplace (block.lernen11b, block.lernen12b)] / branch = [if (values.bedingungsvariable == 12) noreplace (block.lernen11b, block.lernen12b)] </survey> The problem is simply that it doesn't seem to work. The experiment runs through, but the test monkey sees conditions that shouldn't be seen in combination, i.e. circle/positive and then triangle/positive (when it should be triangle/negative or triangle/specific). I will attach our whole file this time; unfortunately the code is quite convoluted since we didn't have much time to build this experiment. Also, a lot of the names and comments are in German :/
|
|
|
Dave
|
|
Group: Administrators
Posts: 13K,
Visits: 104K
|
In one of your <survey>s, the /branch attributes are simply wrong.
<survey STAIT> / pages = [1=STAIT1; 2=STAIT2] / subcaptionfontstyle = ("Arial", 13pt, true, false, false, false, 5, 0) / fontstyle = ("Arial", 13pt, true, false, false, false, 5, 0) / responsefontstyle = ("Arial", 11pt, false, false, false, false, 5, 0) / itemspacing = 2% / showpagenumbers = false / showquestionnumbers = false / nextlabel = "Weiter" / showbackbutton = false / finishlabel = "Weiter" / branch = [if (values.bedingungsvariable = 1) noreplace (block.lernen1c, block.lernen2c)] / branch = [if (values.bedingungsvariable = 2) noreplace (block.lernen1c, block.lernen2c)] / branch = [if (values.bedingungsvariable = 3) noreplace (block.lernen3c, block.lernen4c)] / branch = [if (values.bedingungsvariable = 4) noreplace (block.lernen3c, block.lernen4c)] / branch = [if (values.bedingungsvariable = 5) noreplace (block.lernen5c, block.lernen6c)] / branch = [if (values.bedingungsvariable = 6) noreplace (block.lernen5c, block.lernen6c)] / branch = [if (values.bedingungsvariable = 7) noreplace (block.lernen7c, block.lernen8c)] / branch = [if (values.bedingungsvariable = 8) noreplace (block.lernen7c, block.lernen8c)] / branch = [if (values.bedingungsvariable = 9) noreplace (block.lernen9c, block.lernen10c)] / branch = [if (values.bedingungsvariable = 10) noreplace (block.lernen9c, block.lernen10c)] / branch = [if (values.bedingungsvariable = 11) noreplace (block.lernen11c, block.lernen12c)] / branch = [if (values.bedingungsvariable = 12) noreplace (block.lernen11c, block.lernen12c)] </survey>
You need to use == (a comparison operator) in the condition check, not = (the assignment operator).
|
|
|
L&S
|
|
Group: Forum Members
Posts: 4,
Visits: 19
|
Thanks again, that did the trick. There actually were some other minor mistakes in the code that kept us from finding the right solution when we played around with the =-operators prior to coming here. Good to know what = and == actually mean, we couldn't find that in the help file or the inquisit language reference.
Thanks a lot for your help, this whole day would have been a huge waste without you!
|
|
|
Dave
|
|
Group: Administrators
Posts: 13K,
Visits: 104K
|
No problem! FYI: You'll find the meaning of =, == and other operators covered in the "Operators" topic in the Inquisit documentation.
|
|
|