jsPsych/tests&examples/jspsych-button-response.html
2015-07-17 10:17:11 -04:00

37 lines
906 B
HTML

<!doctype html>
<html>
<head>
<script src="js/jquery.min.js"></script>
<script src="../jspsych.js"></script>
<script src="../plugins/jspsych-button-response.js"></script>
<link rel="stylesheet" href="../css/jspsych.css"></link>
<style>
img { width: 300px; }
</style>
</head>
<body>
<div id="jspsych-target"></div>
</body>
<script>
var trials = {
type: 'button-response',
stimuli: ['img/happy_face_1.jpg'],
choices: ['Happy', 'Sad'],
prompt: "<p class='center-content'>What emotion is this person showing?</p>",
button_html: "<a class='jspsych-btn'>%choice%</a>"
};
function start(){
jsPsych.init({
display_element: $('#jspsych-target'),
experiment_structure: [trials],
on_finish: function(){jsPsych.data.displayData();}
});
}
jsPsych.preloadImages(['img/happy_face_1.jpg'], start);
</script>
</html>