ontrialend not reading response correctly?


Author
Message
mzhang13
mzhang13
Associate Member (239 reputation)Associate Member (239 reputation)Associate Member (239 reputation)Associate Member (239 reputation)Associate Member (239 reputation)Associate Member (239 reputation)Associate Member (239 reputation)Associate Member (239 reputation)Associate Member (239 reputation)
Group: Forum Members
Posts: 3, Visits: 34
Currently, I'm running a task where the participant makes a choice, and a master budget updates by subtracting the price of the selection. However, I noticed that even when pressing "z" only to move on, the conditional in the ontrailend part always goes to the "else" (and updates accordingly). Am I missing something here?

<trial recipe_trial>
/ validresponse = ("z", "m")
/ stimulusframes = [1 = recipe1, recipe2, recipe1_price, recipe2_price, progress]
/ ontrialend = [
if (trial.recipe_trial.response == "z") {
values.current_budget = values.current_budget - list.recipe1_prices.item(picture.recipe1.currentindex)
}
else {
values.current_budget = values.current_budget - list.recipe2_prices.item(picture.recipe1.currentindex)
}
]
/ posttrialpause = 250
</trial>
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Reading This Topic

Explore
Messages
Mentions
Search