Description of the problem: I have two blocks, i.e., normal and whisper. The way I have set up is that the normal block will always be the first block and followed by the whispered block. However, is it possible to directly change this in the JS code where the whispered block comes first? The order of block is controlled by the most outer loop, called block_order. And the csv file is called order.csv in the resource folder. Here is what is looks like:
n_voiced, n_whisper
1, 0
0, 1
I just need to switch to
n_voiced, n_whisper
0, 1
1, 0
I know that I could totally change this locally and then re-sync with the project. However, I have had many troubles doing this since the Slider style is changed drastically in this newest PsychoPy version and the experiment was built under a previous version.
Yes I do actually :). I think changing orders in this part might achieve what you want.
// Schedule all the trials in the trialList:
for (const thisOrder_select of order_select) {
const snapshot = order_select.getSnapshot();
thisScheduler.add(importConditions(snapshot));
const vd_blockLoopScheduler = new Scheduler(psychoJS);
thisScheduler.add(vd_blockLoopBegin, vd_blockLoopScheduler);
thisScheduler.add(vd_blockLoopScheduler);
thisScheduler.add(vd_blockLoopEnd);
const whisper_blockLoopScheduler = new Scheduler(psychoJS);
thisScheduler.add(whisper_blockLoopBegin, whisper_blockLoopScheduler);
thisScheduler.add(whisper_blockLoopScheduler);
thisScheduler.add(whisper_blockLoopEnd);
thisScheduler.add(endLoopIteration(thisScheduler, snapshot));
}
@thomas_pronk i might have misunderstood your suggestion. I copied and pasted in the wrong section in the above screenshot. I reverted the change and change the order in the correct code section. However, when I ran the experiment, it is still running the normal block first.
The code I quoted in my earlier posts was copy-pasted from the JS I found in your experiment. Note though that I’m not diving in the details of your experiment, but I’ll make a suggestion below. Whatever you do, be sure to test it carefully.
You could try replacing the code I quoted by the code below:
// Schedule all the trials in the trialList:
for (const thisOrder_select of order_select) {
const snapshot = order_select.getSnapshot();
thisScheduler.add(importConditions(snapshot));
const whisper_blockLoopScheduler = new Scheduler(psychoJS);
thisScheduler.add(whisper_blockLoopBegin, whisper_blockLoopScheduler);
thisScheduler.add(whisper_blockLoopScheduler);
thisScheduler.add(whisper_blockLoopEnd);
const vd_blockLoopScheduler = new Scheduler(psychoJS);
thisScheduler.add(vd_blockLoopBegin, vd_blockLoopScheduler);
thisScheduler.add(vd_blockLoopScheduler);
thisScheduler.add(vd_blockLoopEnd);
thisScheduler.add(endLoopIteration(thisScheduler, snapshot));
}
Yea i have made this change in both the Js file (one is legacy-broswer.js). It is still running the normal block first unfortunately Are changes made in the JS code directly synced to the experiment on Pavlovia?
tried both and did not work One thing that I noticed is that on the experiment page, the update date is not reflected correctly and i think this may be the problem.
Actually, this has been a huge problem for me when syncing experiments. Oftentimes, the changes really are not updated and I had to deleted the entire experiment and reupload
definitely! I really appreciate your help here. I have added you to the project. Please let me know if it does not work. I am really new to this Git world.
YAY!! thanks so much. now the experiment works to the way I wanted. If you don’t mind me asking one more clarification, when you said, view source, you meant View Page Source in the experiment page right?
The direct link to the source you have does not work for me.