added demos

This commit is contained in:
KristinDiep 2017-07-12 14:29:04 -04:00
parent f21ad81d1e
commit c3d616283f
5 changed files with 45 additions and 11 deletions

View File

@ -0,0 +1,43 @@
<!DOCTYPE html>
<html>
<head>
<script src="../jspsych.js"></script>
<script src="../plugins/jspsych-image-keyboard-response.js"></script>
<link rel="stylesheet" href="../css/jspsych.css"></link>
<style>
img {
width: 300px;
}
</style>
</head>
<body>
</body>
<script>
var trial_1 = {
type: "image-keyboard-response",
stimulus: 'img/happy_face_1.jpg',
choices: [89, 78],
prompt: '<p class="center-content">Is this face happy? Y or N.</p>'
}
var trial_2 = {
type: 'image-keyboard-response',
stimulus: 'img/sad_face_2.jpg',
choices: [89, 78], // Y or N
prompt: '<p class="center-content">Is this face happy? Y or N.</p>'
}
var trial_3 = {
type: 'image-keyboard-response',
stimulus: 'img/happy_face_2.jpg',
choices: [89, 78], // Y or N
prompt: '<p class="center-content">Is this face happy? Y or N.</p>',
}
jsPsych.init({
timeline: [trial_1, trial_2, trial_3],
default_iti: 250
});
</script>
</html>

View File

@ -21,20 +21,11 @@ jsPsych.plugins['call-function'] = (function() {
no_function: false, no_function: false,
description: '' description: ''
}, },
// a rare case where we override the default experiment level
// value of this parameter, since this plugin should be invisible
// to the subject of the experiment
post_trial_gap: {
type: jsPsych.plugins.parameterType.INT,
default: 0,
no_function: false,
description: ''
}
} }
} }
plugin.trial = function(display_element, trial) { plugin.trial = function(display_element, trial) {
trial.post_trial_gap = 0;
var return_val = trial.func(); var return_val = trial.func();
var trial_data = { var trial_data = {

View File

@ -34,7 +34,7 @@ jsPsych.plugins['external-html'] = (function() {
}, },
check_fn: { check_fn: {
type: jsPsych.plugins.parameterType.FUNCTION, type: jsPsych.plugins.parameterType.FUNCTION,
default: 'function() { return true; }', default: function() { return true; },
no_function: false, no_function: false,
description: '' description: ''
}, },