【问题标题】:fixation cross in jsPsychjsPsych 中的固定交叉
【发布时间】:2016-03-06 12:27:09
【问题描述】:

我正在尝试在 jsPsych 的实验中添加一个固定交叉。我对js很陌生。

这是我所拥有的:

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();
      }

我现在想要的是在每次测试测试块之前添加一个固定十字。在当前形式中,它在所有刺激之后仅显示一次。任何帮助表示赞赏。

【问题讨论】:

  • 欢迎来到 Stack Overflow。您应该edit您的问题并添加更多细节。我们不会知道你在说什么,这似乎需要一些领域知识。您的代码也不完整,无法编译。最后少了一些括号。请解决这个问题。如果您在使用网站时遇到问题,请拨打tour 并查看How to Ask。:)

标签: javascript jspsych


【解决方案1】:

这是一个使用 jsPsych-6.0.5 和“html-keyboard-response”插件(而不是“single-stim”)编码的工作固定块:

var fixation = {
  type: 'html-keyboard-response',
  stimulus: '<div style="font-size:60px">+</div>',
  choices: jsPsych.NO_KEYS,
  trial_duration: 800 // in ms
}; 

这个注视块可以通过推送功能包含在您的时间线中:

experiment.push(fixation);

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-10-30
    • 2012-09-11
    • 2010-10-30
    • 1970-01-01
    • 1970-01-01
    • 2017-04-23
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多