| Reference | Downloads | Github

How can I modify condition file directly?

URL of experiment:

Description of the problem:

Hi everyone.
I’m trying to make a simple stop-signal task.
Ok, here’s the problem. Participant respond with left or right button.
If the signal sign comes up, I want participant to stop immediately.

This is a part of my code snippet which works pretty nice.
The problem is that I want to replace $corrAns variable only when the signal is true.
I’ve tried null, None, undefiend but nothing works.

The code structure works fine in local environment,
so I think it is a web-specific problem.
It’s gonna be a lot of help if anyone can make a comment about this.

P.S. Why not simply add another column in my condition file?
That’s because I need to use code to pseudo-randomize my trials.
(no consecutive signal trials)
If someone can solve this problem more easily, that’s welcoming!

I would set the value for the correct answer in the keyboard component as a different variable. In a code component that variable can either be set from the Excel or set to something else.

Thanks for the suggestion. But I’m not sure if that’s going to solve my problem. I have to record the rt and response key of non-signal trials too. In that way, I’d have to record the rt and accuracy of signal and non-signal trials seperately. I would leave that as my last option…