mirror of
https://github.com/jspsych/jsPsych.git
synced 2025-05-10 11:10:54 +00:00
55 lines
983 B
HTML
55 lines
983 B
HTML
<!DOCTYPE html>
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<script src="../jspsych.js"></script>
|
|
<script src="../plugins/jspsych-single-stim.js"></script>
|
|
<link rel="stylesheet" href="../css/jspsych.css"></link>
|
|
<style>
|
|
</style>
|
|
</head>
|
|
|
|
<body>
|
|
<div id="jspsych-target"></div>
|
|
</body>
|
|
<script>
|
|
|
|
var timeline_variables = [
|
|
{ v1: "<p>1</p>" },
|
|
{ v1: "<p>2</p>" },
|
|
{ v1: "<p>3</p>" },
|
|
{ v1: "<p>4</p>" },
|
|
{ v1: "<p>5</p>" },
|
|
{ v1: "<p>6</p>" }
|
|
];
|
|
|
|
var node = {
|
|
timeline_variables: timeline_variables,
|
|
timeline: [
|
|
{
|
|
type: 'single-stim',
|
|
choices: jsPsych.ALL_KEYS,
|
|
stimulus: function(){ return jsPsych.timelineVariable('v1'); },
|
|
is_html: true
|
|
}
|
|
],
|
|
sample: {
|
|
type: 'custom',
|
|
fn: function(x){ return x.reverse(); }
|
|
},
|
|
repetitions: 2
|
|
}
|
|
|
|
jsPsych.init({
|
|
timeline: [node],
|
|
on_finish: function() {
|
|
jsPsych.data.displayData();
|
|
},
|
|
default_iti: 250
|
|
});
|
|
|
|
</script>
|
|
|
|
</html>
|