mirror of
https://github.com/jspsych/jsPsych.git
synced 2025-05-10 11:10:54 +00:00
update examples for v6.0
This commit is contained in:
parent
7f36522dee
commit
0e6311d9a9
@ -1,12 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
|
||||
<script src="../jspsych.js"></script>
|
||||
<script src="../plugins/jspsych-instructions.js"></script>
|
||||
<link rel="stylesheet" href="../css/jspsych.css"></link>
|
||||
</head>
|
||||
|
||||
<body></body>
|
||||
<script>
|
||||
|
||||
var trial = {
|
||||
|
@ -2,7 +2,7 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
|
||||
|
||||
<script src="../jspsych.js"></script>
|
||||
<script src="../plugins/jspsych-multi-stim-multi-response.js"></script>
|
||||
<link rel="stylesheet" href="../css/jspsych.css"></link>
|
||||
@ -12,7 +12,7 @@
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body></body>
|
||||
<script>
|
||||
var trial_1 = {
|
||||
type: 'multi-stim-multi-response',
|
||||
|
@ -1,14 +1,13 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
|
||||
<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></body>
|
||||
<script>
|
||||
|
||||
// create a stimulus using the generate_stimulus method
|
||||
|
@ -1,29 +1,42 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
|
||||
<script src="../jspsych.js"></script>
|
||||
<script src="../plugins/jspsych-single-stim.js"></script>
|
||||
<script src="../plugins/jspsych-reconstruction.js"></script>
|
||||
<link rel="stylesheet" href="../css/jspsych.css"></link>
|
||||
</head>
|
||||
<body></body>
|
||||
<script>
|
||||
|
||||
var sample_function = function(param){
|
||||
var size = 50 + Math.floor(param*250);
|
||||
var html = '<div style="display: block; margin: auto; height: 300px;">'+
|
||||
'<div style="display: block; margin: auto; background-color: #000000; '+
|
||||
'width: '+size+'px; height: '+size+'px;"></div></div><p>Press H or G.</p>';
|
||||
var html = '<div style="display: block; margin: auto; height: 300px; width: 300px; position: relative;">'+
|
||||
'<div style="display: block; position: absolute; top: '+(150 - size/2)+'px; left:'+(150 - size/2)+'px; background-color: #000000; '+
|
||||
'width: '+size+'px; height: '+size+'px;"></div></div><p>Press H to make the square larger. Press G to make the square smaller.</p>'+
|
||||
'<p>When the square is the same size as the previous one, click Submit.</p>';
|
||||
return html;
|
||||
}
|
||||
|
||||
var block_1 = {
|
||||
var pre_test = {
|
||||
type: 'single-stim',
|
||||
stimulus: '<div style="display: block; margin: auto; height: 300px; width: 300px; position: relative;">'+
|
||||
'<div style="display: block; position: absolute; top: '+(150 - 210/2)+'px; left:'+(150 - 210/2)+'px; background-color: #000000; '+
|
||||
'width: 210px; height: 210px;"></div></div>',
|
||||
is_html: true,
|
||||
choices: ['c'],
|
||||
timing_post_trial: 1250,
|
||||
prompt: '<p>Study the size of this square carefully. On the next screen you will have to recreate it. When you are ready, press C.</p>'
|
||||
}
|
||||
|
||||
var test = {
|
||||
type: 'reconstruction',
|
||||
stim_function: sample_function,
|
||||
starting_value: 0.25
|
||||
starting_value: 0.5,
|
||||
}
|
||||
|
||||
jsPsych.init({
|
||||
timeline: [block_1],
|
||||
timeline: [pre_test, test],
|
||||
on_finish: function() { jsPsych.data.displayData(); }
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user