Skip to content

Show previous trials and right answers throughout the whole experiment #3200

Answered by Shaobin-Jiang
lpavan98 asked this question in Q&A
Discussion options

You must be logged in to vote

Here is a really simplified version:

const jspsych = initJsPsych();

// Define all stimulus and correct responses
let stimulus = [
    { stim: ['a', 'b', 'c'], correct: 0 },
    { stim: ['d', 'e', 'f'], correct: 1 },
    { stim: ['g', 'h', 'i'], correct: 2 },
    { stim: ['j', 'k', 'l'], correct: 0 },
    { stim: ['m', 'n', 'o'], correct: 1 },
    { stim: ['p', 'q', 'r'], correct: 2 },
];

// Mark the progress of the experiment
let trial_id = 0;

let trial = {
    type: jsPsychHtmlKeyboardResponse,
    stimulus: () => {
        // Left part of the main content
        let html_left = `<p style="width: 40vw;">${stimulus[trial_id].stim.join('-')}</p>`;
        
        // Right part of the …

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by lpavan98
Comment options

You must be logged in to vote
0 replies
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