-
Notifications
You must be signed in to change notification settings - Fork 0
/
1_get_prolific_id_aya.html
56 lines (42 loc) · 2.06 KB
/
1_get_prolific_id_aya.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Stopmotion Memory</title>
<script src = "/study_assets_root/stopmotion_immediate/jquery-3.3.1.min.js" type="text/javascript"></script>
<script src="/assets/javascripts/jatos.js"></script>
</head>
<body>
<div align="center" style="display: flex; flex-direction: column; margin: auto; flex: 1 1 100%; width: 90%; height: 90%;">
<div id="prolific_div" style="font-family: 'Open Sans', 'Arial', sans-serif; font-size: 150%; line-height: 1.2em;">
</div>
</div>
</body>
<script>
jatos.onLoad(function() {
var result_data = {};
// Gets the pID from the query line and uses that if it's defined
var query_pID = jatos.urlQueryParameters.PARTICIPANT_ID;
if (typeof query_pID != 'undefined') {
// So we got it from the URL
jatos.studySessionData.prolific_ID = query_pID;
result_data.pID_source = 'query';
result_data.prolific_ID = jatos.studySessionData.prolific_ID;
jatos.addJatosIds(result_data);
jatos.submitResultData("[" + JSON.stringify(result_data) + "]", jatos.startNextComponent);
} else {
// Otherwise check if its autoPID
$("#prolific_div").html("<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>");
$("#prolific_id").keypress(function (e) {
if(e.which == 13) {
e.preventDefault();
jatos.studySessionData.prolific_ID = $("#prolific_id").val();
result_data.pID_source = 'user';
result_data.prolific_ID = jatos.studySessionData.prolific_ID;
jatos.addJatosIds(result_data);
jatos.submitResultData("[" + JSON.stringify(result_data) + "]", jatos.startNextComponent);
}
});
}
});
</script>