mirror of
https://github.com/jspsych/jsPsych.git
synced 2025-05-12 16:48:12 +00:00
updating examples
This commit is contained in:
parent
a2e9f8674c
commit
5ec3d6a95d
@ -6,16 +6,13 @@
|
||||
<script src="../plugins/jspsych-reconstruction.js"></script>
|
||||
<link rel="stylesheet" href="../css/jspsych.css"></link>
|
||||
</head>
|
||||
<body>
|
||||
<div id="jspsych-target"></div>
|
||||
</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>';
|
||||
'width: '+size+'px; height: '+size+'px;"></div></div><p>Press H or G.</p>';
|
||||
return html;
|
||||
}
|
||||
|
||||
@ -26,7 +23,6 @@
|
||||
}
|
||||
|
||||
jsPsych.init({
|
||||
display_element: $('#jspsych-target'),
|
||||
timeline: [block_1],
|
||||
on_finish: function() { jsPsych.data.displayData(); }
|
||||
});
|
||||
|
@ -13,9 +13,6 @@
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="jspsych-target"></div>
|
||||
</body>
|
||||
<script>
|
||||
var block = {
|
||||
type: 'same-different',
|
||||
@ -27,7 +24,6 @@
|
||||
}
|
||||
|
||||
jsPsych.init({
|
||||
display_element: $('#jspsych-target'),
|
||||
timeline: [block],
|
||||
on_finish: function() {
|
||||
jsPsych.data.displayData();
|
||||
|
@ -15,9 +15,6 @@
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="jspsych-target"></div>
|
||||
</body>
|
||||
<script>
|
||||
var block_1 = {
|
||||
type: 'similarity',
|
||||
@ -26,7 +23,6 @@
|
||||
}
|
||||
|
||||
jsPsych.init({
|
||||
display_element: $('#jspsych-target'),
|
||||
timeline: [block_1],
|
||||
on_finish: function() {
|
||||
jsPsych.data.displayData();
|
||||
|
@ -6,9 +6,7 @@
|
||||
<script src="../plugins/jspsych-single-audio.js"></script>
|
||||
<link rel="stylesheet" href="../css/jspsych.css"></link>
|
||||
</head>
|
||||
<body>
|
||||
<div id="jspsych-target"></div>
|
||||
</body>
|
||||
|
||||
<script>
|
||||
|
||||
/*
|
||||
@ -27,7 +25,6 @@
|
||||
}
|
||||
|
||||
jsPsych.init({
|
||||
display_element: $('#jspsych-target'),
|
||||
timeline: [block_1],
|
||||
on_finish: function() {jsPsych.data.displayData();}
|
||||
});
|
||||
|
@ -13,8 +13,6 @@
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
</body>
|
||||
<script>
|
||||
var trial_1 = {
|
||||
type: 'single-stim',
|
||||
@ -43,9 +41,6 @@
|
||||
var node = {
|
||||
type: 'single-stim',
|
||||
timeline: [trial_1, trial_2, trial_3],
|
||||
data: {
|
||||
node_data: true
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -6,9 +6,7 @@
|
||||
<script src="../plugins/jspsych-survey-likert.js"></script>
|
||||
<link rel="stylesheet" href="../css/jspsych.css"></link>
|
||||
</head>
|
||||
<body>
|
||||
<div id="jspsych-target" class="jspsych-top"></div>
|
||||
</body>
|
||||
|
||||
<script>
|
||||
|
||||
// defining groups of questions that will go together.
|
||||
@ -24,7 +22,6 @@
|
||||
};
|
||||
|
||||
jsPsych.init({
|
||||
display_element: $('#jspsych-target'),
|
||||
timeline: [likert_block],
|
||||
on_finish: function() { jsPsych.data.displayData(); }
|
||||
});
|
||||
|
@ -6,13 +6,11 @@
|
||||
<script src="../plugins/jspsych-survey-multi-choice.js"></script>
|
||||
<link rel="stylesheet" href="../css/jspsych.css"></link>
|
||||
</head>
|
||||
<body>
|
||||
<div id="jspsych-target"></div>
|
||||
</body>
|
||||
|
||||
<script>
|
||||
|
||||
// defining groups of questions that will go together.
|
||||
var page_1_questions = ["I like vegetables.", "I like fruit."]
|
||||
var page_1_questions = ["I like vegetables.", "I like fruit."];
|
||||
|
||||
// definiting two different response scales that can be used.
|
||||
var page_1_options = ["Strongly Disagree", "Disagree", "Neutral", "Agree", "Strongly Agree"];
|
||||
@ -26,9 +24,16 @@
|
||||
// horizontal: true // centres questions and makes options display horizontally
|
||||
};
|
||||
|
||||
var multi_choice_block_horizontal = {
|
||||
type: 'survey-multi-choice',
|
||||
questions: page_1_questions,
|
||||
options: [page_1_options, page_2_options], // need one scale for every question on a page
|
||||
required: [true, false], // set whether questions are required
|
||||
horizontal: true // centres questions and makes options display horizontally
|
||||
};
|
||||
|
||||
jsPsych.init({
|
||||
display_element: $('#jspsych-target'),
|
||||
timeline: [multi_choice_block],
|
||||
timeline: [multi_choice_block, multi_choice_block_horizontal],
|
||||
on_finish: function() {
|
||||
jsPsych.data.displayData();
|
||||
}
|
||||
|
@ -6,9 +6,7 @@
|
||||
<script src="../plugins/jspsych-survey-text.js"></script>
|
||||
<link rel="stylesheet" href="../css/jspsych.css"></link>
|
||||
</head>
|
||||
<body>
|
||||
<div id="jspsych-target"></div>
|
||||
</body>
|
||||
|
||||
<script>
|
||||
|
||||
// defining groups of questions that will go together.
|
||||
@ -19,9 +17,7 @@
|
||||
questions: page_1_questions
|
||||
};
|
||||
|
||||
|
||||
jsPsych.init({
|
||||
display_element: $('#jspsych-target'),
|
||||
timeline: [survey_block],
|
||||
on_finish: function() { jsPsych.data.displayData(); }
|
||||
});
|
||||
|
@ -6,9 +6,6 @@
|
||||
<script src="../plugins/jspsych-text.js"></script>
|
||||
<link rel="stylesheet" href="../css/jspsych.css"></link>
|
||||
</head>
|
||||
<body>
|
||||
<div id="jspsych-target"></div>
|
||||
</body>
|
||||
<script>
|
||||
|
||||
var block = {
|
||||
@ -16,9 +13,14 @@
|
||||
text: 'Welcome to the experiment. Press any key to begin.'
|
||||
}
|
||||
|
||||
var mouse = {
|
||||
type: 'text',
|
||||
choices: 'mouse',
|
||||
text: 'Click the mouse to continue.'
|
||||
}
|
||||
|
||||
jsPsych.init({
|
||||
display_element: $('#jspsych-target'),
|
||||
timeline: [block],
|
||||
timeline: [block, mouse],
|
||||
on_finish: function() { jsPsych.data.displayData(); }
|
||||
});
|
||||
|
||||
|
@ -6,9 +6,7 @@
|
||||
<script src="../plugins/jspsych-video.js"></script>
|
||||
<link rel="stylesheet" href="../css/jspsych.css"></link>
|
||||
</head>
|
||||
<body>
|
||||
<div id="jspsych-target"></div>
|
||||
</body>
|
||||
|
||||
<script>
|
||||
|
||||
var trial = {
|
||||
@ -17,7 +15,6 @@
|
||||
}
|
||||
|
||||
jsPsych.init({
|
||||
display_element: $('#jspsych-target'),
|
||||
timeline: [trial],
|
||||
on_finish: function() { jsPsych.data.displayData(); }
|
||||
});
|
||||
|
@ -5,15 +5,18 @@
|
||||
<script src="js/jquery.min.js"></script>
|
||||
<script src="js/snap.svg-min.js"></script>
|
||||
<script src="../jspsych.js"></script>
|
||||
<script src="../plugins/jspsych-text.js"></script>
|
||||
<script src="../plugins/jspsych-visual-search-circle.js"></script>
|
||||
<link rel="stylesheet" href="../css/jspsych.css"></link>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="jspsych-target"></div>
|
||||
</body>
|
||||
<script>
|
||||
|
||||
var intro = {
|
||||
type: 'text',
|
||||
text: 'Press J if there is a backwards N. If there is no backwards N press F.'
|
||||
}
|
||||
|
||||
var trial_1 = {
|
||||
target_present: true,
|
||||
set_size: 4
|
||||
@ -32,15 +35,14 @@
|
||||
|
||||
var trials = {
|
||||
type: 'visual-search-circle',
|
||||
target: 'img/normalN.gif',
|
||||
foil: 'img/backwardN.gif',
|
||||
target: 'img/backwardN.gif',
|
||||
foil: 'img/normalN.gif',
|
||||
fixation_image: 'img/fixation.gif',
|
||||
timeline: [trial_1, trial_2, trial_3]
|
||||
};
|
||||
|
||||
jsPsych.init({
|
||||
display_element: $('#jspsych-target'),
|
||||
timeline: [trials],
|
||||
timeline: [intro, trials],
|
||||
on_finish: function() {
|
||||
jsPsych.data.displayData();
|
||||
}
|
||||
|
@ -9,9 +9,6 @@
|
||||
<link rel="stylesheet" href="../css/jspsych.css"></link>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="jspsych-target"></div>
|
||||
</body>
|
||||
<script>
|
||||
var images = ["img/1.gif", "img/2.gif", "img/3.gif", "img/4.gif", "img/5.gif", "img/6.gif", "img/7.gif", "img/8.gif", "img/9.gif", "img/10.gif"];
|
||||
|
||||
@ -22,7 +19,6 @@
|
||||
};
|
||||
|
||||
jsPsych.init({
|
||||
display_element: $('#jspsych-target'),
|
||||
timeline: [block],
|
||||
on_finish: function() {
|
||||
jsPsych.data.displayData();
|
||||
|
@ -7,9 +7,7 @@
|
||||
<script src="../plugins/jspsych-vsl-grid-scene.js"></script>
|
||||
<link rel="stylesheet" href="../css/jspsych.css"></link>
|
||||
</head>
|
||||
<body>
|
||||
<div id="jspsych-target"></div>
|
||||
</body>
|
||||
|
||||
<script>
|
||||
|
||||
var images = ["img/1.gif","img/2.gif","img/3.gif","img/4.gif","img/5.gif","img/6.gif","img/7.gif","img/8.gif","img/9.gif","img/10.gif"];
|
||||
@ -31,7 +29,6 @@
|
||||
};
|
||||
|
||||
jsPsych.init({
|
||||
display_element: $('#jspsych-target'),
|
||||
timeline: [block],
|
||||
on_finish: function() { jsPsych.data.displayData(); }
|
||||
});
|
||||
|
@ -13,9 +13,6 @@
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="jspsych-target"></div>
|
||||
</body>
|
||||
<script>
|
||||
var block_1 = {
|
||||
type: 'xab',
|
||||
@ -25,7 +22,6 @@
|
||||
}
|
||||
|
||||
jsPsych.init({
|
||||
display_element: $('#jspsych-target'),
|
||||
timeline: [block_1],
|
||||
on_finish: function() {
|
||||
jsPsych.data.displayData();
|
||||
|
@ -6,14 +6,12 @@
|
||||
<script src="../plugins/jspsych-text.js"></script>
|
||||
<link rel="stylesheet" href="../css/jspsych.css"></link>
|
||||
</head>
|
||||
<body>
|
||||
<div id="jspsych-target"></div>
|
||||
</body>
|
||||
|
||||
<script>
|
||||
|
||||
var first = {
|
||||
type: 'text',
|
||||
text: 'first trial!',
|
||||
text: 'first trial! experiment will pause for 4s in between trials. press any key.',
|
||||
timing_post_trial: 0,
|
||||
on_finish: function(){
|
||||
jsPsych.pauseExperiment();
|
||||
@ -27,7 +25,6 @@
|
||||
}
|
||||
|
||||
jsPsych.init({
|
||||
display_element: $('#jspsych-target'),
|
||||
timeline: [first, second],
|
||||
on_finish: function(){jsPsych.data.displayData(); }
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user