Display correctmessage condicionally


Author
Message
anabela_c
anabela_c
Respected Member (364 reputation)Respected Member (364 reputation)Respected Member (364 reputation)Respected Member (364 reputation)Respected Member (364 reputation)Respected Member (364 reputation)Respected Member (364 reputation)Respected Member (364 reputation)Respected Member (364 reputation)
Group: Forum Members
Posts: 23, Visits: 75
Hi Dave,

I have two types of trials (prompts) that branch to a common trial (exptrial), I would like to display the errormessage for both but the correctmessage only for the trials that were presented with the practice prompt.

The code is the following:

<trial prompt>
/ stimulustimes = [0=text.Prompt]
/ validresponse = (30,38)
/ branch = [trial.exptrial]
</trial>

<trial prompt_practice>
/ stimulustimes = [0=text.Prompt_practice]
/ validresponse = (30,38)
/ ontrialend = [
    values.practice = 1
]
/ branch = [trial.exptrial]
</trial>

<trial exptrial>
/ stimulustimes = [0=texttrial]
/ validresponse = (30,38)
/ correctresponse = (38)
/ errormessage = true(error, 2000)
</trial>

<text Prompt>
/ items = ("actual prompt")
/ position = (50%,50%)
/ fontstyle = ("Arial", 3%, true)
/ size = (80%,40%)
/ vjustify = center
</text>

<text Prompt_practice>
/ items = ("practice prompt")
/ position = (50%,50%)
/ fontstyle = ("Arial", 3%, true)
/ size = (80%,40%)
/ vjustify = center
</text>

<text texttrial>
/ items = ("trial")
/ position = (50%,50%)
/ fontstyle = ("Arial", 3%, true)
/ size = (80%,40%)
/ vjustify = center
</text>

<text correctm>
/ items = ("Correct response!")
/ color = (0, 220, 0)
/ fontstyle = ("Arial", 5%, true)
/ position = (50%,50%)
/ vjustify = center
</text>

<text error>
/ items = ("Wrong response key!")
/ color = (255, 0, 0)
/ fontstyle = ("Arial", 5%, true)
/ position = (50%,50%)
/ txbgcolor = transparent
/ vjustify = center
</text>

<block exa>
/ trials = [1 = prompt_practice; 2= prompt]
</block>


<expt 1>
/ blocks = [1=exa]
</expt>

<values>
/ practice = 0
</values>

---------------------------------

I was trying to add the conditional statement in the <trial exptrial> as follows (but it does not work):

<trial exptrial>
/ stimulustimes = [0=texttrial]
/ validresponse = (30,38)
/ correctresponse = (38)
/ errormessage = true(error, 2000)
/ correctmessage= [if (values.practice == 1) {
  true(correctm, 2000)}]
</trial>


Thanks in advance for your help!!!

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View

Reading This Topic

Explore
Messages
Mentions
Search