language selection before pre-instructions


Author
Message
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: 13K, Visits: 104K
JuliaNo - Wednesday, March 29, 2017
Okay, I can't quite figure out the language division yet... 

For the instructions, I have decided to make one block for the language decision and a block for each language, which will be skipped depending on the answer. This is a bit inconvenient to do for all blocks, because I already have several and I think it would be nicer to do it within the block. So I tried the /branch attribute. However, the way I tried it, I get the error message "The element 'IMCquestion' in branch expression 'IMCquestion' is the wrong element type." I used the information from the Inquisit Language Reference about branch attribute, but that doesn't really help right now. it's about this block:

<block IMC>
/ branch = [if (trial.languagepick.response == "OptionPortuguese" || trial.languagepick.response == "OptionPortugueseFlag") trial.IMCquestion]
</block>

whole code:

<defaults>
/ screencolor = (255, 255, 255)
/ fontstyle = ("Calibri", 2.8%, true, false, false, false, 5, 1)
/ txbgcolor = (255,255,255)
/ txcolor = (0,0,0)
/ inputdevice = keyboard
</defaults>

<instruct>
/ fontstyle = ("Calibri", 2.8%, true, false, false, false, 5, 1)
/ windowsize = (75%, 75%)
/ screencolor = (255, 255, 255)
/ nextkey = (" ")
/ nextlabel = " Press (Space) for next page"
/ prevlabel = "Press (Back) previous page"
</instruct>

<trial LanguagePick>
/ stimulusframes = [1=languageQuestion, OptionGerman, OptionPortuguese, Optionother, OptionGermanFlag, OptionPortugueseFlag]
/ inputdevice = mouse
/ validresponse = ("OptionGerman", "OptionPortuguese", "Optionother", "OptionGermanFlag", "OptionPortugueseFlag")
</trial>

<text languageQuestion>
/items = ("Before we start, please indicate your nationality.
The experiment will then continue in your native language.")
/position = (50,30)
</text>

<text OptionGerman>
/items = ("German")
/position = (25,45)
</text>

<text OptionPortuguese>
/items = ("Portuguese")
/position = (50,45)
</text>

<text Optionother>
/items = ("Other")
/position = (75,45)
</text>

<picture OptionGermanFlag>
/ items = ("stimulusMaterial/Flag_of_Germany.png")
/ position = (25, 53)
/ size = (9%, 9%)
</picture>

<picture OptionPortugueseFlag>
/ items = ("stimulusMaterial/Flag_of_Portugal.png")
/ position = (50, 53)
/ size = (9%, 9%)
</picture>

<block Languagepick>
/trials = [1=LanguagePick]
</block>

<page intro6D>
German text
</page>

<page intro6P>
Portuguese text
</page>

<block GermanInstructions>
/skip = [trial.languagepick.response != "OptionGerman" && trial.languagepick.response != "OptionGermanFlag"]
/ postinstructions= (intro6D)
</block>

<block PortugueseInstructions>
/skip = [trial.languagepick.response != "OptionPortuguese" && trial.languagepick.response != "OptionPortugueseFlag"]
/ postinstructions= (intro6P)
</block>

<trial IMCquestion>
/ stimulusframes = [1=titleIMC, questionIMC]
/ inputdevice = mouse
/ validresponse = ("titleIMC")
</trial>

<text titleIMC>
/items = ("As tuas últimas férias")
/ position = (50%, 18%)
</text>

<text questionIMC>
/items = ("click the title")
/ position = (50%, 40%)
</text>

<block IMC>
/ branch = [if (trial.languagepick.response == "OptionPortuguese" || trial.languagepick.response == "OptionPortugueseFlag") trial.IMCquestion]
</block>

<expt myexperiment>
/blocks = [1=Languagepick; 2=GermanInstructions; 3=PortugueseInstructions; 4=IMC]
</expt>





A /branch can only happen at the same "level":
A <block> can /branch to another <block> -- it cannot /branch to a <trial>.
A <trial> can /branch to another <trial> -- it cannot /branch to a <block>.

JuliaNo
JuliaNo
Esteemed Member (1.8K reputation)Esteemed Member (1.8K reputation)Esteemed Member (1.8K reputation)Esteemed Member (1.8K reputation)Esteemed Member (1.8K reputation)Esteemed Member (1.8K reputation)Esteemed Member (1.8K reputation)Esteemed Member (1.8K reputation)Esteemed Member (1.8K reputation)
Group: Forum Members
Posts: 19, Visits: 97
Okay, I can't quite figure out the language division yet... 

For the instructions, I have decided to make one block for the language decision and a block for each language, which will be skipped depending on the answer. This is a bit inconvenient to do for all blocks, because I already have several and I think it would be nicer to do it within the block. So I tried the /branch attribute. However, the way I tried it, I get the error message "The element 'IMCquestion' in branch expression 'IMCquestion' is the wrong element type." I used the information from the Inquisit Language Reference about branch attribute, but that doesn't really help right now. it's about this block:

<block IMC>
/ branch = [if (trial.languagepick.response == "OptionPortuguese" || trial.languagepick.response == "OptionPortugueseFlag") trial.IMCquestion]
</block>

whole code:

<defaults>
/ screencolor = (255, 255, 255)
/ fontstyle = ("Calibri", 2.8%, true, false, false, false, 5, 1)
/ txbgcolor = (255,255,255)
/ txcolor = (0,0,0)
/ inputdevice = keyboard
</defaults>

<instruct>
/ fontstyle = ("Calibri", 2.8%, true, false, false, false, 5, 1)
/ windowsize = (75%, 75%)
/ screencolor = (255, 255, 255)
/ nextkey = (" ")
/ nextlabel = " Press (Space) for next page"
/ prevlabel = "Press (Back) previous page"
</instruct>

<trial LanguagePick>
/ stimulusframes = [1=languageQuestion, OptionGerman, OptionPortuguese, Optionother, OptionGermanFlag, OptionPortugueseFlag]
/ inputdevice = mouse
/ validresponse = ("OptionGerman", "OptionPortuguese", "Optionother", "OptionGermanFlag", "OptionPortugueseFlag")
</trial>

<text languageQuestion>
/items = ("Before we start, please indicate your nationality.
The experiment will then continue in your native language.")
/position = (50,30)
</text>

<text OptionGerman>
/items = ("German")
/position = (25,45)
</text>

<text OptionPortuguese>
/items = ("Portuguese")
/position = (50,45)
</text>

<text Optionother>
/items = ("Other")
/position = (75,45)
</text>

<picture OptionGermanFlag>
/ items = ("stimulusMaterial/Flag_of_Germany.png")
/ position = (25, 53)
/ size = (9%, 9%)
</picture>

<picture OptionPortugueseFlag>
/ items = ("stimulusMaterial/Flag_of_Portugal.png")
/ position = (50, 53)
/ size = (9%, 9%)
</picture>

<block Languagepick>
/trials = [1=LanguagePick]
</block>

<page intro6D>
German text
</page>

<page intro6P>
Portuguese text
</page>

<block GermanInstructions>
/skip = [trial.languagepick.response != "OptionGerman" && trial.languagepick.response != "OptionGermanFlag"]
/ postinstructions= (intro6D)
</block>

<block PortugueseInstructions>
/skip = [trial.languagepick.response != "OptionPortuguese" && trial.languagepick.response != "OptionPortugueseFlag"]
/ postinstructions= (intro6P)
</block>

<trial IMCquestion>
/ stimulusframes = [1=titleIMC, questionIMC]
/ inputdevice = mouse
/ validresponse = ("titleIMC")
</trial>

<text titleIMC>
/items = ("As tuas últimas férias")
/ position = (50%, 18%)
</text>

<text questionIMC>
/items = ("click the title")
/ position = (50%, 40%)
</text>

<block IMC>
/ branch = [if (trial.languagepick.response == "OptionPortuguese" || trial.languagepick.response == "OptionPortugueseFlag") trial.IMCquestion]
</block>

<expt myexperiment>
/blocks = [1=Languagepick; 2=GermanInstructions; 3=PortugueseInstructions; 4=IMC]
</expt>





JuliaNo
JuliaNo
Esteemed Member (1.8K reputation)Esteemed Member (1.8K reputation)Esteemed Member (1.8K reputation)Esteemed Member (1.8K reputation)Esteemed Member (1.8K reputation)Esteemed Member (1.8K reputation)Esteemed Member (1.8K reputation)Esteemed Member (1.8K reputation)Esteemed Member (1.8K reputation)
Group: Forum Members
Posts: 19, Visits: 97
I didn't realize I can use the page elements in a block, this is very helpful. Thank you.
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: 13K, Visits: 104K
JuliaNo - Tuesday, March 28, 2017
Hey Dave, 
I translated my script to different languages, but I have to put it all in one script (I can only use one web licence). However, it would be important that the language question is asked before the pre-instructions. Is that even possible? Or does that mean that I cannot use the page elements (and pre-instructions)?
Thanks!

You can put the language selection logic in a separate <block> and then present the "pre-instructions" at the end of that <block> instead of via the <expt>. I.e.

<expt>
/ blocks = [1=languageselectionblock; 2=taskblock1; ...]
</expt>

with

<block languageselectionblock>
/ postinstructions = (intro1, intro2, ...)
....
</block>

Edited 7 Years Ago by Dave
JuliaNo
JuliaNo
Esteemed Member (1.8K reputation)Esteemed Member (1.8K reputation)Esteemed Member (1.8K reputation)Esteemed Member (1.8K reputation)Esteemed Member (1.8K reputation)Esteemed Member (1.8K reputation)Esteemed Member (1.8K reputation)Esteemed Member (1.8K reputation)Esteemed Member (1.8K reputation)
Group: Forum Members
Posts: 19, Visits: 97
Hey Dave, 
I translated my script to different languages, but I have to put it all in one script (I can only use one web licence). However, it would be important that the language question is asked before the pre-instructions. Is that even possible? Or does that mean that I cannot use the page elements (and pre-instructions)?
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