Millisecond Forums

language selection before pre-instructions

https://forums.millisecond.com/Topic21201.aspx

By JuliaNo - 3/27/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!
By Dave - 3/28/2017

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>
By JuliaNo - 3/28/2017

I didn't realize I can use the page elements in a block, this is very helpful. Thank you.
By JuliaNo - 3/28/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>




By Dave - 3/28/2017

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>.