/branch = [if (texbox.mybox1.response == text.mytext1.currentitem) trial.3 else trial.4] is not...


Author
Message
july1810
july1810
Distinguished Member (3K reputation)Distinguished Member (3K reputation)Distinguished Member (3K reputation)Distinguished Member (3K reputation)Distinguished Member (3K reputation)Distinguished Member (3K reputation)Distinguished Member (3K reputation)Distinguished Member (3K reputation)Distinguished Member (3K reputation)
Group: Forum Members
Posts: 28, Visits: 213
Hello,
I have a surveypage with one textbox. Depending on whether or not the string entered here matches an Item from an item list contained in a text, I like to present different consecutive trials. However, although textbook.mybox1.response and text.mytext1.currentitem contain the same word/string this command does not work =( Can you tell me what I've done wrong?
Thank U 
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
Since you did not provide your actual code, it is not possible to tell what you did wrong. What I can tell you is that it works perfectly fine if done correctly:

<block myblock>
/ trials = [1-3=mypage]
</block>

<surveypage mypage>
/ stimulusframes = [1=mytext]
/ questions = [1=mytextbox]
/ branch = [if (textbox.mytextbox.response == text.mytext.currentitem) trial.match else trial.nomatch]
</surveypage>

<textbox mytextbox>
</textbox>

<text mytext>
/ items = ("A", "B", "C")
</text>

<trial match>
/ stimulusframes = [1=matchtext]
/ validresponse = (57)
</trial>

<trial nomatch>
/ stimulusframes = [1=nomatchtext]
/ validresponse = (57)
</trial>

<text matchtext>
/ items = ("Your response matched the displayed text.")
</text>

<text nomatchtext>
/ items = ("Your response did *not* match the displayed text.")
</text>


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search