mirror of
https://github.com/jspsych/jsPsych.git
synced 2025-05-10 19:20:55 +00:00
44 lines
1.0 KiB
HTML
44 lines
1.0 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
|
|
<head>
|
|
<script src="../jspsych.js"></script>
|
|
<script src="../plugins/jspsych-html.js"></script>
|
|
<link rel="stylesheet" href="../css/jspsych.css"></link>
|
|
</head>
|
|
<body></body>
|
|
<script>
|
|
/*
|
|
this demo will only work if run online or with special permissions enable offline
|
|
for chrome, launch the browser from the command-line:
|
|
chrome --allow-file-access-from-files
|
|
*/
|
|
|
|
var check_consent = function(elem) {
|
|
if (document.getElementById('consent_checkbox').checked) {
|
|
return true;
|
|
} else {
|
|
alert("If you wish to participate, you must check the box next to the statement 'I agree to participate in this study.'");
|
|
return false;
|
|
}
|
|
return false;
|
|
};
|
|
|
|
var consent_block = {
|
|
type: "html",
|
|
force_refresh: true,
|
|
url: "external_html/simple_consent.html",
|
|
cont_btn: "start",
|
|
check_fn: check_consent
|
|
}
|
|
|
|
jsPsych.init({
|
|
timeline: [consent_block],
|
|
on_finish: function() {
|
|
jsPsych.data.displayData();
|
|
}
|
|
});
|
|
</script>
|
|
|
|
</html>
|