Skip to content
Discussion options

You must be logged in to vote

Hi @kittymimo ,

Thank you for using my plugin!

I’m not sure if I understood your question correctly, but you should probably define the stimuli as a function instead of using on_start.

I haven't tested this code yet, but please try the following and see if it works.
Please remove the on_start section.

stimuli: function() {
    let img_file_name, audio_file_name;
    
    const last_trial_correct = jsPsych.data.get().last(1).values()[0].correct;
    if(last_trial_correct) {
        img_file_name = "images/crochet.png";
        audio_file_name = "audio/correct.wav";
    } else {
        img_file_name = "images/x.png";
        audio_file_name = "audio/incorrect.wav";
    }

    const stimuli = 

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@kittymimo
Comment options

Answer selected by kittymimo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants