Description of the problem:
In this experiment, I put a code component in the begining of experiment. The purpose is that when the participant reach the practice correct rate than go on with followed session, otherwise go back to the begining to try again the practice session.
But the setting of code component doesn’t working when I sync to online, while it work well in PC psychopy. Is the programming language conversion problem?
I’m guessing it would have generated an error message - you should always provide that detail.
I’m not a Javascript person, but in this case, it looks like the JS in code_2 is missing an opening curly bracket.
Also note that code should really be in the “end routine” tab. If you set the loop to be finished, that will only take effect after all routines have ben completed, so at this point, you are probably getting one more trial than you want, as the current trial will still run even if the criterion is met.
There are no errors when I run the program. It just cannot jump out of the loop at the position of the code_2 component. Because I need to accord the correct rate to decide whether starting another practice for participants, thus I put the code in the begin routine tab.
I think the problem is very likely that you said “missing an opening curly bracket”. But I don’t konw Javascript neither . I will try debug by google. Thanks.