mirror of
https://github.com/jspsych/jsPsych.git
synced 2025-05-12 00:28:11 +00:00
add tests
This commit is contained in:
parent
1218c58350
commit
bf3dd20bad
35
tests&examples/jspsych-similarity.html
Normal file
35
tests&examples/jspsych-similarity.html
Normal file
@ -0,0 +1,35 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<script src="js/jquery.min.js"></script>
|
||||
<script src="js/jquery-ui.min.js"></script>
|
||||
<script src="../jspsych.js"></script>
|
||||
<script src="../plugins/jspsych-similarity.js"></script>
|
||||
<link rel="stylesheet" href="css/jquery-ui.css"></link>
|
||||
<link rel="stylesheet" href="../css/jspsych.css"></link>
|
||||
<style>
|
||||
img { width: 300px; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="jspsych-target"></div>
|
||||
</body>
|
||||
<script>
|
||||
|
||||
var block_1 = {
|
||||
type: 'similarity',
|
||||
stimuli: [['img/happy_face_1.jpg', 'img/sad_face_1.jpg']],
|
||||
prompt: '<p class="center-content">How similar are these pictures?</p>'
|
||||
}
|
||||
|
||||
function start(){
|
||||
jsPsych.init({
|
||||
display_element: $('#jspsych-target'),
|
||||
experiment_structure: [block_1]
|
||||
});
|
||||
}
|
||||
|
||||
jsPsych.preloadImages(['img/happy_face_1.jpg','img/sad_face_1.jpg'], start);
|
||||
|
||||
</script>
|
||||
</html>
|
34
tests&examples/jspsych-single-stim.html
Normal file
34
tests&examples/jspsych-single-stim.html
Normal file
@ -0,0 +1,34 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<script src="js/jquery.min.js"></script>
|
||||
<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>
|
||||
<div id="jspsych-target"></div>
|
||||
</body>
|
||||
<script>
|
||||
|
||||
var block_1 = {
|
||||
type: 'single-stim',
|
||||
stimuli: ['img/happy_face_1.jpg', 'img/sad_face_1.jpg'],
|
||||
choices: [89,78], // Y or N
|
||||
prompt: '<p class="center-content">Have you seen this face before? Y or N.</p>'
|
||||
}
|
||||
|
||||
function start(){
|
||||
jsPsych.init({
|
||||
display_element: $('#jspsych-target'),
|
||||
experiment_structure: [block_1]
|
||||
});
|
||||
}
|
||||
|
||||
jsPsych.preloadImages(['img/happy_face_1.jpg','img/sad_face_1.jpg'], start);
|
||||
|
||||
</script>
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user