我正试着在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();
}我现在想要的是在每次测试之前添加一个固定十字。在当前形式中,它在所有刺激之后只显示一次。任何帮助都是非常感谢的。
发布于 2019-05-22 13:55:54
下面是一个使用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
}; 此固定块可通过push功能包含在您的时间线中:
experiment.push(fixation);https://stackoverflow.com/questions/35826810
复制相似问题