mirror of
https://github.com/jspsych/jsPsych.git
synced 2025-05-11 16:18:11 +00:00
70 lines
2.0 KiB
HTML
70 lines
2.0 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta content="text/html;charset=utf-8" http-equiv="Content-Type">
|
|
<meta content="utf-8" http-equiv="encoding">
|
|
|
|
<!-- css -->
|
|
<!--<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
|
|
<link href="css/jquery-ui.css" rel="stylesheet" type="text/css">-->
|
|
|
|
<!-- SVG.js -->
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/svg.js/2.6.3/svg.min.js"></script>
|
|
|
|
<!-- JsPsych -->
|
|
<script src="../jspsych.js"></script>
|
|
<script src="../plugins/jspsych-virtual-chinrest.js"></script>
|
|
<link rel="stylesheet" href="../css/jspsych.css"></link>
|
|
|
|
</head>
|
|
|
|
<script>
|
|
|
|
// measure px2mm, viewing distance and px2deg
|
|
// do not resize
|
|
// note: pixels_per_unit will be ignored
|
|
let no_resize = {
|
|
type: 'virtual-chinrest',
|
|
blindspot_reps: 1,
|
|
resize_units: "none",
|
|
pixels_per_unit: 50
|
|
};
|
|
|
|
// measure px2mm, but not viewing distance and px2deg
|
|
// resize to cm (50 pixels per unit)
|
|
// note, you may still choose to estimate viewing distance even if resizing to cm or inches
|
|
let cm_resize = {
|
|
type: 'virtual-chinrest',
|
|
blindspot_reps: 0,
|
|
resize_units: "cm",
|
|
pixels_per_unit: 50
|
|
};
|
|
|
|
// measure px2mm, viewing distance and px2deg
|
|
// resize to degrees of visual angle (50 pixels per unit)
|
|
// don't report viewing distance to subject
|
|
let deg_resize = {
|
|
type: 'virtual-chinrest',
|
|
blindspot_reps: 1,
|
|
resize_units: "deg",
|
|
pixels_per_unit: 50,
|
|
// viewing_distance_report: 'none'
|
|
};
|
|
|
|
// resizing to degrees with no blindspot measurment is not possible
|
|
// this trial will throw an error
|
|
let error_trial = {
|
|
type: 'virtual-chinrest',
|
|
blindspot_reps: 0,
|
|
resize_units: "deg",
|
|
pixels_per_unit: 50
|
|
}
|
|
|
|
jsPsych.init({
|
|
timeline: [ deg_resize ],
|
|
on_finish: function() { jsPsych.data.displayData(); }
|
|
});
|
|
|
|
</script>
|
|
</html>
|