gpt4 book ai didi

javascript - jsPsych中的固定交叉

转载 作者:行者123 更新时间:2023-11-28 06:17:32 25 4
gpt4 key购买 nike

我正在尝试为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();
}


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

最佳答案

这是一个使用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);

关于javascript - jsPsych中的固定交叉,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35826810/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com