-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
77 lines (66 loc) · 2.99 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<!DOCTYPE html>
<html>
<head>
<!-- Title shown in tab -->
<title>University of Sussex - Research</title>
<!-- Load all necessary plugins -->
<script src="https://unpkg.com/jspsych@8.0.2"></script>
<script src="https://unpkg.com/@jspsych/plugin-browser-check@1.0.3"></script>
<script src="https://unpkg.com/@jspsych/plugin-survey@2.0.0"></script>
<!-- <script src="https://unpkg.com/@jspsych/plugin-html-button-response@1.2.0"></script>
<script src="https://unpkg.com/@jspsych-contrib/plugin-pipe"></script> -->
<!-- Plots -->
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<script src="https://realitybending.github.io/JSmisc/misc/plots.js"></script>
<script src="https://unpkg.com/@jspsych/plugin-canvas-button-response@2.0.0"></script>
<!-- Load parameters here (always below the loading of the JsPsych) -->
<!-- <script src="intero.js"></script> -->
<script src="demographics.js"></script>
<link
href="https://unpkg.com/jspsych@8.0.1/css/jspsych.css"
rel="stylesheet"
type="text/css"
/>
<link
rel="stylesheet"
href="https://unpkg.com/@jspsych/plugin-survey@2.0.0/css/survey.css"
/>
</head>
<body></body>
<script>
// Initialize experiment =================================================
var timeline = []
var jsPsych = initJsPsych({
// show_progress_bar: true,
on_finish: function () {
// jsPsych.data.displayData("json") // Display data in browser
window.location =
"https://realitybending.github.io/research/#participate" // Redirect to lab website
// If prolific and passed the attention check, redirect to prolific completion link
if (jsPsych.data.urlVariables()["exp"] == "prolific") {
d = jsPsych.data
.get()
.filter({ screen: "demographics_debrief" })["trials"][0]
if (d["Reward"] == "Automatic") {
window.location =
"https://app.prolific.com/submissions/complete?cc=C8I1NGST"
} else {
window.location =
"https://app.prolific.com/submissions/complete?cc=C1BHVQIZ"
}
}
},
})
// Participant ID
const participantID = jsPsych.randomization.randomID(10)
timeline.push(ConsentForm)
timeline.push(demographics_browser_info)
timeline.push(demographic_questions)
timeline.push(demographics_wearables)
timeline.push(experiment_feedback)
timeline.push(demographics_debriefing)
timeline.push(demographics_endscreen)
/* ----------------- Run the timeline ----------------- */
jsPsych.run(timeline)
</script>
</html>