-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path1_get_prolific_id.html
112 lines (95 loc) · 4.49 KB
/
1_get_prolific_id.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Get Prolific ID</title>
<script src = "./extra_functions/jquery-3.4.1.js" type="text/javascript"></script>
<script src="jatos.js"></script>
</head>
<body style="background-color:#b9c6c7;">
<div align="center" style="display: flex; flex-direction: column; margin: auto; flex: 1 1 100%; width: 90%; height: 90%;">
<div id="prolific_div" style="visibility:hidden; font-family: 'Open Sans', 'Arial', sans-serif; font-size: 150%; line-height: 1.2em;">
<br><br><br><p style="font-family: 'Open Sans', 'Arial', sans-serif; line-height: 1.6em; vertical-align:middle">Please enter your prolific ID (you can copy&paste from the prolific website) and press ENTER: <textarea id="prolific_id" rows="1" cols="20" style="vertical-align:middle; font-size: 18px; line-height: 1.5em;"></textarea></p>
</div>
<div id="error_msg" style="font-family: 'Open Sans', 'Arial', sans-serif; font-size: 150%; line-height: 1.2em;"></div>
</div>
</body>
<script>
var mw = 750;
var mh = 700;
// var mw = 600;
// var mh = 600;
jatos.onLoad(function() {
// Create a variable to hold all the results from components. For some of the components, the keys will be created at the time
jatos.studySessionData.outputData = {
consent_results: [],
browser_device_test_results: [],
instructions_results: {
phase_1: [],
phase_2: [],
phase_3: [],
},
post_practice_instructions_results: {
phase_1: [],
phase_2: [],
phase_3: [],
},
phase_results: [],
intermediate_feedback_results: [],
phase_1_debrief_results: [],
phase_2_debrief_results: [],
phase_3_debrief_results: [],
phase_1_transitions_results: [],
phase_2_transitions_results: [],
phase_3_transitions_results: [],
};
// Enter PID automatically or manually? Auto for debug
let autoPID = false
if (!autoPID){
$("#prolific_id").keypress(function (e) {
if(e.which == 13) {
e.preventDefault();
jatos.studySessionData.prolific_ID = $("#prolific_id").val();
jatos.studySessionData.window_width = window.innerWidth
jatos.studySessionData.window_height = window.innerHeight
jatos.submitResultData("[get_pid_comp_start---" +
JSON.stringify(jatos.studySessionData) +
"---get_pid_comp_end]", jatos.startNextComponent);
}
});
} else {
jatos.studySessionData.prolific_ID = "test";
jatos.submitResultData('[get_pid_comp_start---' + JSON.stringify(jatos.studySessionData) +
'---get_pid_comp_end]', jatos.startNextComponent);
}
var w = window.innerWidth;
var h = window.innerHeight;
if(w < mw || h < mh) {
var interval = setInterval(function(){
var w = window.innerWidth;
var h = window.innerHeight;
if(w < mw || h < mh){
$("#error_msg").html('<p>Your browser window is too small to complete this experiment. '+
'Please maximize the size of your browser window. If your browser window is already maximized, try entering the fullscreen mode. '+
'If that does not help either, you will not be able to complete this experiment.</p>'+
'<p>The minimum width is '+mw+'px. Your current width is '+w+'px.</p>'+
'<p>The minimum height is '+mh+'px. Your current height is '+h+'px.</p>');
} else {
clearInterval(interval);
document.getElementById("error_msg").style.visibility = "hidden";
document.getElementById("prolific_div").style.visibility = "visible";
return;
}
}, 100);
} else {
document.getElementById("error_msg").style.visibility = "hidden";
document.getElementById("prolific_div").style.visibility = "visible";
};
// document.getElementById("error_msg").style.visibility = "hidden";
// document.getElementById("prolific_div").style.visibility = "visible";
// Make JATOS remember that this session was run
jatos.studySessionData.latestFinishedComponentId = jatos.componentId;
jatos.studySessionData.latestFinishedComponentPos = jatos.componentPos;
jatos.studySessionData.latestFinishedComponentTitle = jatos.componentProperties.title;
});
</script>