mirror of
https://github.com/jspsych/jsPsych.git
synced 2025-05-10 11:10:54 +00:00
41 lines
852 B
HTML
41 lines
852 B
HTML
<!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">
|
|
<style>
|
|
img {
|
|
width: 300px;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body></body>
|
|
<script>
|
|
var block_1 = {
|
|
type: 'image-keyboard-response',
|
|
stimulus: 'img/happy_face_1.jpg',
|
|
choices: ['y','n'],
|
|
prompt: '<p>The data displayed on the next page should have a subject and completed property. Press Y or N.</p>'
|
|
}
|
|
|
|
jsPsych.data.addProperties({
|
|
subject: 1
|
|
});
|
|
|
|
|
|
jsPsych.init({
|
|
timeline: [block_1],
|
|
on_finish: function() {
|
|
jsPsych.data.addProperties({
|
|
completed: true
|
|
});
|
|
// data should have a subject and completed field for each trial.
|
|
jsPsych.data.displayData();
|
|
}
|
|
});
|
|
</script>
|
|
|
|
</html>
|