mirror of
https://github.com/jspsych/jsPsych.git
synced 2025-05-10 11:10:54 +00:00
52 lines
1.1 KiB
HTML
52 lines
1.1 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<script src="../jspsych.js"></script>
|
|
<script src="../plugins/jspsych-single-stim.js"></script>
|
|
<link rel="stylesheet" href="../css/jspsych.css"></link>
|
|
<style>
|
|
img {
|
|
width: 300px;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body></body>
|
|
<script>
|
|
var trial_1 = {
|
|
type: 'single-stim',
|
|
stimulus: 'img/happy_face_1.jpg',
|
|
choices: [89, 78], // Y or N
|
|
prompt: '<p class="center-content">Have you seen this face before? Y or N.</p>'
|
|
}
|
|
|
|
var trial_2 = {
|
|
type: 'single-stim',
|
|
stimulus: 'img/happy_face_2.jpg',
|
|
choices: [89, 78], // Y or N
|
|
timing_response: 5000,
|
|
prompt: '<p class="center-content">Have you seen this face before? Y or N. (5s time limit).</p>'
|
|
}
|
|
|
|
var trial_3 = {
|
|
type: 'single-stim',
|
|
choices: jsPsych.NO_KEYS, // Y or N
|
|
timing_response: 2000,
|
|
prompt: '<p class="center-content">No response allowed. 2s wait.</p>',
|
|
stimulus: '<p>:)</p>',
|
|
is_html: true
|
|
}
|
|
|
|
|
|
jsPsych.init({
|
|
timeline: [trial_1, trial_2, trial_3],
|
|
on_finish: function() {
|
|
jsPsych.data.displayData();
|
|
},
|
|
default_iti: 250
|
|
});
|
|
</script>
|
|
|
|
</html>
|