-
Notifications
You must be signed in to change notification settings - Fork 1
/
passthru.php
185 lines (161 loc) · 6.88 KB
/
passthru.php
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
<?php
session_start();
$passthruurl = base64_decode($_REQUEST["taskurl"]);
foreach ($_GET as $key=>$value) {
if($key != "taskurl") {
$passthruurl .= $key . "=" . $value;
}
}
$passthru = FALSE;
// PASSTHRU CONDITIONS
// 1. ASSIGNMENT_ID_NOT_AVAILABLE
if($_REQUEST["assignmentId"] == "ASSIGNMENT_ID_NOT_AVAILABLE") {
//header("location: " . $passthruurl);
$r = "no assignment";
$passthru = TRUE;
} else if(!isset($_REQUEST["workerId"])) {
// 2. no workerId
$r = "no workerid";
$passthru = TRUE;
} else {
// Here begins database accesses.
$filename = dirname(__FILE__) . '/turkers.db';
//unlink($filename);
$db = new PDO('sqlite:' . $filename);
$db->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );
// 1. create a sqlite database table with the following columns if it does not already exist: id, timestamp, workerid
$stmt = $db->prepare('CREATE TABLE IF NOT EXISTS consent (id INTEGER PRIMARY KEY AUTOINCREMENT, timestamp TIMESTAMP, workerid varchar(32))');
$stmt->execute();
// workerId
$wid = $_REQUEST["workerId"];
// 2. check for workerId
$stmt = $db->prepare('select id from consent where workerid = :wid');
$stmt->execute(array(':wid' => $wid));
$rows = $stmt->fetch(PDO::FETCH_NUM);
// 3. if no workerId found, insert it,
// but only if the user agreed to everything.
$now = date('Y-m-d H:i:s');
if($rows === FALSE) {
if(isset($_REQUEST["age18"]) && isset($_REQUEST["understood"]) && isset($_REQUEST["wantto"]) &&
$_REQUEST["age18"]=="yes" && $_REQUEST["understood"]=="yes" && $_REQUEST["wantto"]=="yes") {
$stmt = $db->prepare('INSERT INTO consent (timestamp, workerid) VALUES(:timestamp, :wid)');
$ret = $stmt->execute(array(':wid' => $wid, ':timestamp' => $now));
$passthru = TRUE;
$r = "workerid doesn't exist, agree";
} else {
$r = "workerid doesn't exist, no agree";
}
}
else {
$r = "exists";
$passthru = TRUE;
}
}
if($passthru == TRUE) {
//header("location: " . )
}
?>
<!doctype html>
<html>
<head>
<title>Augmenting Computation with Input From People</title>
<style>
html,body {
font-family: verdana, sans serif;
font-size: 0.9em;
height: 100%;
}
.container {
height: 70%;
overflow: scroll;
border: 3px solid #aaa;
}
.container,.consent {
width: 60%;
margin: auto;
padding: 5px;
}
input[type=submit],input[type=checkbox] {
line-height: 2.5em;
font-size: 3.5em;
font-weight: bold;
}
</style>
</head>
<body>
<?php
//echo "PASS" . $passthru . " -- " . $r . "\n";
?>
<p class="consent" style="padding: 2em 0">
Please read the information below, complete the three questions below it, and click the button to continue to the task. You will only need to do this step once for all of our tasks.
</p>
<div class="container">
<h1>Augmenting Computation with Input From People</h1>
<p>
This task is part of a research study conducted by Jeffrey Bigham at Carnegie Mellon University and is funded by Carnegie Mellon University.
</p>
<p>
The purpose of the research is to understand how small bits of human work may be able to allow computers to perform tasks that they cannot do currently, e.g. reliably convert speech to text, understand the visual information in images, or respond naturally to natural language questions.
</p>
<h2>Procedures</h2>
<p>
If you participate, you will be asked to complete or simply view one or more interaction tasks, which may involve entering a text description (e.g., describing an image or sound), controlling an interface (e.g., clicking buttons, navigating an avatar to a specified target), or typing responses to provided questions (e.g., answering, "what is a good restaurant in Pittsburgh?"). The duration of these tasks will be at least one minute and no more than one hour. You may quit after any task and be compensated proportional to the time spent.
</p>
<h2>Participant Requirements</h2>
<p>
Participation in this study is limited to individuals aged 18 and older.
</p>
<h2>Risks</h2>
<p>
The risks and discomfort associated with participation in this study are no greater than those ordinarily encountered in daily life or during other online activities. As with other tasks in your daily life, you may tire or become bored completing our tasks. There is also a risk of confidentiality being breached.
</p>
<h2>Benefits</h2>
<p>
There may be no personal benefit from your participation in the study but the knowledge received may be of value to humanity.
</p>
<h2>Compensation & Costs</h2>
<p>
You will be compensated for your participation in this study at the rate of $10 per hour. There will be no cost to you if you participate in this study. If you decide to end the Study early, you will be compensated for the portion that you completed.
</p>
<h2>Confidentiality</h2>
<p>
The data captured for the research does not include any personally identifiable information about you. Your IP address will not be captured.
</p>
<h2>Right to Ask Questions & Contact Information</h2>
<p>
If you have any questions about this study, you should feel free to ask them by contacting the Principal Investigator now at Jeffrey P. Bigham, Human-Computer Interaction Institute, 5000 Forbes Ave, Pittsburgh, PA 15213. (412) 945-0708, jbigham@cs.cmu.edu. If you have questions later, desire additional information, or wish to withdraw your participation please contact the Principal Investigator by mail, phone or e-mail in accordance with the contact information listed above.
</p>
<p>
If you have questions pertaining to your rights as a research participant; or to report objections to this study, you should contact the Office of Research integrity and Compliance at Carnegie Mellon University. Email: irb-review@andrew.cmu.edu . Phone: 412-268-1901 or 412-268-5460.
</p>
<h3>Voluntary Participation</h3>
<p>
Your participation in this research is voluntary. You may discontinue participation at any time during the research activity.
</p>
</div>
<div class="consent" style="background-color: #EEE">
<form method="post">
<?php
foreach ($_GET as $key=>$value) {
echo "<input type='hidden' name='" . $key . "' value='" . $value . "'>\n";
}
?>
<input type="hidden" name="taskurl" value="<?= $_REQUEST["taskurl"] ?>">
<input type="hidden" name="submitting" value="true">
<p>
<label><input type="radio" name="age18" value="yes">Yes</label> <label><input type="radio" name="age18" value="no">No</label>
I am age 18 or older.
<br>
<label><input type="radio" name="understood" value="yes">Yes</label> <label><input type="radio" name="understood" value="no">No</label>
I have read and understand the information above.
<br>
<label><input type="radio" name="wantto" value="yes">Yes</label> <label><input type="radio" name="wantto" value="no">No</label>
I want to participate in this research and continue with the task.
</p>
<p>
<input type="submit" value="Continue to the Task">
</p>
</form>
</div>
</body>
</html>