1

I'm trying to add a fixation cross to an experiment with jsPsych. I'm pretty new to js.

Here is what I have:

var test_stimuli = [
      {
        image: "img/blau_links.png",
        data: { correct_response: 37 }
      },
      {
        image: "img/blau_rechts.png",
        data: { correct_response: 37 }
      },
      {
        image: "img/gruen_links.png",
        data: { correct_response: 39 }
      },
      {
        image: "img/gruen_rechts.png",
        data: { correct_response: 39 }
      }
];



var all_tests = jsPsych.randomization.repeat(test_stimuli, 50, true);

var post_test_gap = function() {
    return Math.floor( Math.random() * 1500 ) + 750;
}

var test_block = {
    type: "single-stim",
    stimuli: all_tests.image,
    choices: [37, 39],
    data: all_tests.data,
    timing_response: 1500,
    timing_post_test: post_test_gap
};

var fixation_trial = {
    type: 'single-stim',
    stimuli: ['<p style='text-align:center'>+</p>'],
    is_html: true,
    timing_response: 500,
    timing_post_trial: 0,
    choices: 'none'
}

var experiment = [];
    experiment.push(instructions_block);
    experiment.push(trial_block);
    experiment.push(posttrial_block);
    experiment.push(fixation_trial);
    experiment.push(test_block);
    experiment.push(debrief_block);

    /* start the experiment */
    jsPsych.init({experiment_structure: experiment,
      on_finish: function() {
        jsPsych.data.displayData();
      }

What I want now is to add a fixation cross before every trial of the testblock. In the current form it is only displayed once after all stimuli. Any help is appreciated.

Kris
  • 4,595
  • 7
  • 32
  • 50
mathi164
  • 11
  • 1
  • Welcome to Stack Overflow. You should [edit] your question and add some more detail. We're not going to know what you're talking about here, it seems to require some domain knowledge. Your code is also incomplete and will not compile. There are some parenthesis missing in the end. Please fix that. If you are trouble using the site, please take the [tour] and look at [ask].:) – simbabque Mar 06 '16 at 13:02

0 Answers0