Thank you for your reply, it was very helpful! When I run my experiment now, it seems from the Sequence function of the Debugger that the script is successful in choosing the right number of trials for the three different categories in both the training and the testing. It also seems like it chooses the right number of repeat and new items.
However, the training and test trials are not actually showing up on the screen when I run the experiment. My intro, pause and end trials are showing as normal, but for the training and the testing, only the progress bar is showing up on the screen. I can however see the trials in the Sequence of the Debugger and skip to the different trials through “Reach”, but the stimuli are not showing. When I run my trials outside the const format you suggested, they are running as normal, but when I insert them in the code you suggested above, the stimuli are not shown in the trials. Here is an example of my code inside the const format if that helps with identifying the problem:
const alt_training_trial = row => [ Template( defaultTable.filter(r => r.Type=="alt" ), variable => newTrial( "alt", newTimer(500) .start() .wait() , newImage("sg_picture", variable.SgPictureFile) .size(200,200) .print() , newTimer(200) .start() .wait() , newAudio("sg_voicing", variable.SgVoicingFile) .play() , newTimer(1500) .start() .wait() , getImage("sg_picture") .remove() , newTimer(1000) .start() .wait() , newImage("pl_picture", variable.PlPictureFile) .size(300,200) .print() , newTimer(200) .start() .wait() , newAudio("pl_voicing", variable.PlVoicingFile) .play() , newTimer(2000) .start() .wait() , getImage("pl_picture") .remove() , newTimer(200) .start() .wait() , newButton("Neste") .print() .wait() ) ) ]