mirror of
https://github.com/jspsych/jsPsych.git
synced 2025-05-12 16:48:12 +00:00
more testing for version 5.0
This commit is contained in:
parent
5c831f18db
commit
a5f260ddd6
@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
var block_1 = {
|
var block_1 = {
|
||||||
type: 'single-stim',
|
type: 'single-stim',
|
||||||
stimuli: ['img/happy_face_1.jpg', 'img/sad_face_1.jpg'],
|
stimulus: 'img/happy_face_1.jpg',
|
||||||
choices: [89,78], // Y or N
|
choices: [89,78], // Y or N
|
||||||
prompt: '<p class="center-content">Have you seen this face before? Y or N.</p>'
|
prompt: '<p class="center-content">Have you seen this face before? Y or N.</p>'
|
||||||
}
|
}
|
||||||
@ -26,7 +26,7 @@
|
|||||||
function start(){
|
function start(){
|
||||||
jsPsych.init({
|
jsPsych.init({
|
||||||
display_element: $('#jspsych-target'),
|
display_element: $('#jspsych-target'),
|
||||||
experiment_structure: [block_1],
|
timeline: [block_1],
|
||||||
on_finish: function(){
|
on_finish: function(){
|
||||||
jsPsych.data.addProperties({completed: true});
|
jsPsych.data.addProperties({completed: true});
|
||||||
// data should have a subject and completed field for each trial.
|
// data should have a subject and completed field for each trial.
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
var block_1 = {
|
var block_1 = {
|
||||||
type: 'single-stim',
|
type: 'single-stim',
|
||||||
stimuli: ['img/happy_face_1.jpg', 'img/sad_face_1.jpg'],
|
stimulus: 'img/happy_face_1.jpg',
|
||||||
choices: [89,78], // Y or N
|
choices: [89,78], // Y or N
|
||||||
prompt: '<p class="center-content">Have you seen this face before? Y or N.</p>',
|
prompt: '<p class="center-content">Have you seen this face before? Y or N.</p>',
|
||||||
on_finish: function(){
|
on_finish: function(){
|
||||||
@ -27,7 +27,7 @@
|
|||||||
function start(){
|
function start(){
|
||||||
jsPsych.init({
|
jsPsych.init({
|
||||||
display_element: $('#jspsych-target'),
|
display_element: $('#jspsych-target'),
|
||||||
experiment_structure: [block_1],
|
timeline: [block_1],
|
||||||
on_finish: function(){
|
on_finish: function(){
|
||||||
jsPsych.data.displayData();
|
jsPsych.data.displayData();
|
||||||
}
|
}
|
||||||
|
@ -1,36 +1,45 @@
|
|||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html>
|
<html>
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<script src="js/jquery.min.js"></script>
|
<script src="js/jquery.min.js"></script>
|
||||||
<script src="../jspsych.js"></script>
|
<script src="../jspsych.js"></script>
|
||||||
<script src="../plugins/jspsych-single-stim.js"></script>
|
<script src="../plugins/jspsych-single-stim.js"></script>
|
||||||
<link rel="stylesheet" href="../css/jspsych.css"></link>
|
<link rel="stylesheet" href="../css/jspsych.css"></link>
|
||||||
<style>
|
<style>
|
||||||
img { width: 300px; }
|
img {
|
||||||
|
width: 300px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div id="jspsych-target"></div>
|
<div id="jspsych-target"></div>
|
||||||
</body>
|
</body>
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
var block_1 = {
|
var block_1 = {
|
||||||
type: 'single-stim',
|
type: 'single-stim',
|
||||||
stimuli: ['img/happy_face_1.jpg', 'img/sad_face_1.jpg'],
|
stimulus: 'img/happy_face_1.jpg',
|
||||||
choices: [89, 78], // Y or N
|
choices: [89, 78], // Y or N
|
||||||
prompt: '<p class="center-content">Have you seen this face before? Y or N.</p>',
|
prompt: '<p class="center-content">Have you seen this face before? Y or N.</p>',
|
||||||
data: function(){ return {random_number: Math.floor(Math.random()*20)}}
|
data: function() {
|
||||||
|
return {
|
||||||
|
random_number: Math.floor(Math.random() * 20)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function start() {
|
function start() {
|
||||||
jsPsych.init({
|
jsPsych.init({
|
||||||
display_element: $('#jspsych-target'),
|
display_element: $('#jspsych-target'),
|
||||||
experiment_structure: [block_1],
|
timeline: [block_1],
|
||||||
on_finish: function(){ jsPsych.data.displayData(); }
|
on_finish: function() {
|
||||||
|
jsPsych.data.displayData();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
jsPsych.preloadImages(['img/happy_face_1.jpg', 'img/sad_face_1.jpg'], start);
|
jsPsych.preloadImages(['img/happy_face_1.jpg', 'img/sad_face_1.jpg'], start);
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
Loading…
Reference in New Issue
Block a user