mirror of
https://github.com/jspsych/jsPsych.git
synced 2025-05-10 11:10:54 +00:00
update grid-scene docs and demo
This commit is contained in:
parent
3c6f9a445a
commit
09ad9296c4
@ -33,14 +33,14 @@ var pattern = [
|
||||
["img/1.gif", "img/2.gif", 0],
|
||||
[ 0, "img/3.gif", 0],
|
||||
["img/5.gif", "img/4.gif", 0]
|
||||
];
|
||||
];
|
||||
|
||||
var image_size = 100; // pixels
|
||||
|
||||
var grid_stimulus = jsPsych['vsl-grid-scene'].generate_stimulus(pattern, image_size);
|
||||
var grid_stimulus = jsPsych.plugins['vsl-grid-scene'].generate_stimulus(pattern, image_size);
|
||||
|
||||
// grid_stimulus will now contain a string (NOT an HTML DOM object) that you can
|
||||
// pass into other plugins that accept HTML stimuli as input, such as jspsych-categorize.
|
||||
// pass into other plugins that accept HTML stimuli as input, such as jspsych-html-keyboard-response.
|
||||
|
||||
```
|
||||
|
||||
|
@ -1,10 +1,9 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
|
||||
<script src="js/snap.svg-min.js"></script>
|
||||
<script src="../jspsych.js"></script>
|
||||
<script src="../plugins/jspsych-vsl-grid-scene.js"></script>
|
||||
<script src="../plugins/jspsych-html-keyboard-response.js"></script>
|
||||
<link rel="stylesheet" href="../css/jspsych.css"></link>
|
||||
</head>
|
||||
|
||||
@ -22,14 +21,19 @@
|
||||
]
|
||||
;
|
||||
|
||||
var block = {
|
||||
var trial = {
|
||||
type: 'vsl-grid-scene',
|
||||
stimuli: scene,
|
||||
image_size: [50,50]
|
||||
};
|
||||
|
||||
var trial_2 = {
|
||||
type: 'html-keyboard-response',
|
||||
stimulus: jsPsych.plugins['vsl-grid-scene'].generate_stimulus(scene, [100,100])
|
||||
}
|
||||
|
||||
jsPsych.init({
|
||||
timeline: [block],
|
||||
timeline: [trial, trial_2],
|
||||
on_finish: function() { jsPsych.data.displayData(); }
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user