mirror of
https://github.com/jspsych/jsPsych.git
synced 2025-05-12 16:48:12 +00:00
add palmer test
This commit is contained in:
parent
6a46d65df0
commit
4e2fb7c8e5
49
tests&examples/jspsych-palmer.html
Normal file
49
tests&examples/jspsych-palmer.html
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<script src="js/jquery.min.js"></script>
|
||||||
|
<script src="js/snap.svg-min.js"></script>
|
||||||
|
<script src="../jspsych.js"></script>
|
||||||
|
<script src="../plugins/jspsych-palmer.js"></script>
|
||||||
|
<script src="../plugins/jspsych-single-stim.js"></script>
|
||||||
|
<link rel="stylesheet" href="../css/jspsych.css"></link>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="jspsych-target"></div>
|
||||||
|
</body>
|
||||||
|
<script>
|
||||||
|
|
||||||
|
// create a stimulus using the generate_stimulus method
|
||||||
|
var square_size = 3; // number of rows and columns
|
||||||
|
var grid_spacing = 75; // pixels
|
||||||
|
var circle_size = 20; // radius in pixels
|
||||||
|
var configuration = [0,1,0,0,1,1,0,0,1,1,0,0,1,0,0,0,1,0,0,1]; // see definition above
|
||||||
|
|
||||||
|
var stimulus = jsPsych.palmer.generate_stimulus(square_size, grid_spacing, circle_size, configuration);
|
||||||
|
|
||||||
|
// show stimulus using single-stim plugin
|
||||||
|
var stim_block = {
|
||||||
|
type: 'single-stim',
|
||||||
|
stimuli: [stimulus],
|
||||||
|
is_html: true,
|
||||||
|
timing_response: 2000,
|
||||||
|
continue_after_response: false
|
||||||
|
};
|
||||||
|
|
||||||
|
var test_block = {
|
||||||
|
type: 'palmer',
|
||||||
|
configurations: [[0,1,0,0,1,1,0,0,1,1,0,0,1,0,0,0,1,0,0,1]],
|
||||||
|
editable: true,
|
||||||
|
show_feedback: true,
|
||||||
|
timing_feedback: 2000,
|
||||||
|
prompt: '<p>Create the image you just saw. Click two circles to add or remove a line between them. Click submit when you are done.</p>'
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
jsPsych.init({
|
||||||
|
display_element: $('#jspsych-target'),
|
||||||
|
experiment_structure: [stim_block, test_block]
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
||||||
|
</html>
|
Loading…
Reference in New Issue
Block a user