URL of experiment: https://gitlab.pavlovia.org/DASLab/social_5800
Description of the problem:
I am trying to upload my experiment to Pavlovia and am getting an unexpected token error for this piece of code:
util.shuffle(imgList);
if (m_v.corr == 1) {
Reward = 1;
rewardCounter += 1;
psychoJS.experiment.addData("RewardCounter", rewardCounter);
}
else {
Reward = 0;
}
if (m_v.keys == null || rewardCounter > 40 || Reward == 0) {
social_reward.opacity = 0.0;
psychoJS.experiment.addData("Did_Reward", 0);
psychoJS.experiment.addData("Big_Reward", 0);
psychoJS.experiment.addData("Lil_Reward", 0);
}
else if (Reward == 1 && m_v.keys == "m" && MV == "m" && Math.random() > 0.25) {
social_reward.opacity = 1.0;
psychoJS.experiment.addData("Did_Reward", 1);
psychoJS.experiment.addData("Big_Reward", 0);
psychoJS.experiment.addData("Lil_Reward", 1);
}
else if (Reward == 1 && m_v.keys == "v" && MV == "v" && Math.random() > 0.75) {
social_reward.opacity = 1.0;
psychoJS.experiment.addData("Did_Reward", 1);
psychoJS.experiment.addData("Big_Reward", 1);
psychoJS.experiment.addData("Lil_Reward", 0);
}
else {
social_reward.opacity = 0.0;
psychoJS.experiment.addData("Did_Reward", 0);
psychoJS.experiment.addData("Big_Reward", 0);
psychoJS.experiment.addData("Lil_Reward", 0);
}
However, I can’t see where the error is. When I view the js script in Visual Studio, it highlights the curly bracket in this line
if (m_v.keys == null || rewardCounter > 40 || Reward == 0) {
and says that ‘)’ is expected. I have almost an identical statement in another PsychoPy file (but with a feedback message rather than an image) and it runs perfectly. Any idea what the problem could be here?
Thanks!