jsPsych/examples/jspsych-categorize.html
2017-06-21 09:10:56 -04:00

39 lines
975 B
HTML

<!DOCTYPE html>
<html>
<head>
<script src="../jspsych.js"></script>
<script src="../plugins/jspsych-categorize.js"></script>
<link rel="stylesheet" href="../css/jspsych.css"></link>
<style>
img {
width: 300px;
}
</style>
</head>
<body></body>
<script>
var trials = {
type: 'categorize',
stimulus: 'img/happy_face_1.jpg',
key_answer: 72,
choices: [72, 83],
text_answer: 'happy',
correct_text: "<p class='center-content'>Correct. This face is %ANS%.</p>",
incorrect_text: "<p class='center-content'>Incorrect. This face is %ANS%. Please press the correct key to continue.</p>",
prompt: "<p class='center-content'>Press H if the face is happy. Press S if the face is sad.</p>",
timing_response: 1500,
show_feedback_on_timeout: false,
force_correct_button_press: true
};
jsPsych.init({
timeline: [trials],
on_finish: function() {
jsPsych.data.displayData();
}
});
</script>
</html>