forked from cromaLab/LegionTools
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
executable file
·437 lines (378 loc) · 20.9 KB
/
index.php
File metadata and controls
executable file
·437 lines (378 loc) · 20.9 KB
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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
<!DOCTYPE html>
<html>
<head>
<title>Retainer trigger</title>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="Retainer/scripts/gup.js"></script>
<script type="text/javascript" src="Retainer/scripts/trigger.js"></script>
<script type="text/javascript" src="Retainer/scripts/writeNumOnline.js"></script>
<script type="text/javascript" src="Retainer/scripts/bootstrap.touchspin.js"></script>
<script type="text/javascript" src="Retainer/scripts/hitsOverview.js"></script>
<script type="text/javascript" src="Retainer/scripts/jquery.blockUI.js"></script>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<script> var baseURL = "<?php include('config.php'); echo $baseURL; ?>"; </script>
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
<link rel="stylesheet" href="Retainer/style/trigger.css">
<link href="css/style.css" rel="stylesheet">
</head>
<body>
<div class="blocky">
<div class="container">
<div id = "loginModal" class="modal fade">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<!-- <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button> -->
<h4 class="modal-title">Login with your Mechanical Turk keys</h4>
</div>
<div class="modal-body">
<input id = "modalAccessKey" type="text" class="form-control" name="accessKey" placeholder="Access Key" required="" autofocus="" />
<input id = "modalSecretKey" type="text" class="form-control" name="secretKey" placeholder="Secret Key" required=""/>
</br>Your keys are never stored on our server.
</div>
<div class="modal-footer">
<!-- <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> -->
<button id = "modalLoginButton" type="button" class="btn btn-primary">Login</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title">Edit waiting page instructions</h4>
</div>
<div class="modal-body">
<textarea id = "waitingInstructions" class="form-control" rows="5"></textarea>
</div>
<div class="modal-footer">
<button id="waitingInstructionsUpdated" type="button" class="btn btn-primary" data-dismiss="modal">Save and close</button>
<!-- <button type="button" class="btn btn-primary">Save changes</button> -->
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="cool-block">
<div class="cool-block-bor">
<ul class="nav nav-tabs">
<li class="active"><a data-toggle="tab" href="#sectionA">Load Panel</a></li>
<li id = "recruitingTabLi" class = "disabled"><a data-toggle="tab" href="#sectionB">Recruiting Panel</a></li>
</ul>
<div class="tab-content">
<!-- Load Panel -->
<div id="sectionA" class="tab-pane fade in active">
<br />
<span class="grandTitre text-primary">Load an old expriment</span>
<form class="form-horizontal" role="form">
<div class="form-group air">
<label class="sr-only" for="taskSessionLoad">Load an old experiment</label>
<div class="col-lg-4 pull-right">
<select id = "taskSessionLoad" class="form-control"></select>
</div>
<button type="button" id='deleteExperiment' disabled='disabled' class="btn btn-danger pull-right" style='margin-left:10px;'>Delete</button>
<button type="button" id='copyExperiment' disabled='disabled' class="btn btn-default pull-right">Copy</button>
</div>
<!-- <button type="submit" id="loadTask" class="btn btn-default">Load</button> -->
</form>
<span class="grandTitre text-primary">OR create a new experiment</span>
<form class="form-horizontal" role="form">
<div class="form-group air">
<label for="taskSession" class="col-sm-4 control-label">Experiment name (remember this):</label>
<div class="col-sm-8">
<input type="text" class="form-control" id="taskSession" placeholder="Enter a task session name">
</div>
</div>
<div class="form-group air">
<label for="hitTitle" class="col-sm-4 control-label">HIT Title</label>
<div class="col-sm-8">
<input type="text" class="form-control" id="hitTitle" placeholder="Enter HIT title">
</div>
</div>
<div class="form-group air">
<label for="hitDescription" class="col-sm-4 control-label">HIT Description</label>
<div class="col-sm-8">
<input type="text" class="form-control" id="hitDescription" placeholder="Enter HIT description">
</div>
</div>
<div class="form-group air">
<label for="hitKeywords" class="col-sm-4 control-label">HIT Keywords</label>
<div class="col-sm-8">
<input type="text" class="form-control" id="hitKeywords" placeholder="Enter HIT keywords (space-separated)">
</div>
</div>
<div class="form-group row">
<label for="country" class="col-sm-4 control-label">Worker country</label>
<div class="col-sm-3">
<select id = "country" class="form-control">
<option>All</option>
<option>US</option>
</select>
</div>
<label for="percentApproved" class="col-sm-3 control-label">Min % approved</label>
<div class="col-sm-2">
<input type="number" min = "0" max = "100" class="form-control text-center" id="percentApproved" value = "0">
</div>
</div>
<div class="form-group air">
<div class="col-lg-offset-2 col-lg-10">
<div class="cta">
<div class="cta-buttons">
<button type="submit" id="addNewTask" class="btn btn-info btn-lg pull-right">Add new experiment</button>
<button disabled="disabled" type="submit" id="updateTask" class="btn btn-default btn-lg pull-right">Update</button>
</div>
</div>
</div>
</div>
</form>
</div>
<!--/ End Load Panel-->
<!-- Recruiting Panel -->
<div id="sectionB" class="tab-pane fade">
<div id = "recruitingDiv">
<span class="grandTitre text-primary">Recruiting</span>
<br /><br />
<form class="form-horizontal" role="form">
<div class="form-group">
<div class="btn-group col-lg-offset-1 col-lg-10">
<button id="yesSandbox" type="button" class="btn btn-lg btn-default active">Sandbox</button>
<button id="noSandbox" type="button" class="btn btn-lg btn-default">Live</button>
</div>
</div>
<div class="form-group">
<div class="col-lg-10 col-lg-offset-1">
<div class="input-group">
<span class="input-group-addon">Access Key</span>
<input type="text" id="accessKey" class="form-control" placeholder="Optional, can also edit amtKeys.php">
</div>
</div>
</div>
<div class="form-group">
<div class="col-lg-10 col-lg-offset-1">
<div class="input-group">
<span class="input-group-addon">Secret Key</span>
<input type="text" id="secretKey" class="form-control" placeholder="Optional, can also edit amtKeys.php">
</div>
<div class="checkbox">
<label>
<input id = "requireUniqueWorkers" type="checkbox" value="">
Require unique workers
</label>
<button id="resetUniqueWorkers" class="btn btn-danger btn-xs">Reset</button>
</div>
</div>
</div>
<div class="form-group">
<label class=" col-lg-offset-1 col-lg-6 control-label">For account balance, visit <a href="https://requester.mturk.com/mturk/youraccount" target="_blank">here.</a></label>
</div>
<div class="form-group">
<!-- Nav tabs -->
<ul class="nav nav-tabs" role="tablist">
<li id = "useRetainerMode" class="active"><a href="#retainerTab" role="tab" data-toggle="tab">Retainer</a></li>
<li id = "useAutoMode"><a href="#retainerTab" role="tab" data-toggle="tab">Auto</a></li>
<li id = "useDirectMode"><a href="#directTab" role="tab" data-toggle="tab">Direct (classic)</a></li>
</ul>
</div>
</form>
<!-- Tab panes -->
<div class="tab-content">
<div class="tab-pane active" id="retainerTab">
<div id="touchSpinDiv">
<form class="form-horizontal" role="form">
<div class=""
<div class="form-group someAirForRecruitingPanel">
<label class="col-lg-6 col-lg-offset-1 control-label">Target number of assignable HITs</label>
</div>
<div class="form-group someAirForRecruitingPanel">
<div class="col-lg-10 col-lg-offset-1">
<input id="currentTarget" class="text-center" type="text" value="0" name="currentTarget">
</div>
<script>
$("input[name='currentTarget']").TouchSpin();
</script>
</div>
</form>
</div>
<div id="priceRangeDiv"><p><form class="form-horizontal" role="form">
<div class="form-group someAirForRecruitingPanel">
<div class="col-lg-5 col-lg-offset-1">
<label for="minPrice">Min task price (cents)</label>
<input type="text" class="form-control" id="minPrice" placeholder="Min price in cents">
</div>
<div class="col-lg-5">
<label for="maxPrice">Max task price (cents)</label>
<input type="text" class="form-control" id="maxPrice" placeholder="Max price in cents">
</div>
<div class="col-lg-10 col-lg-offset-1">
<br/>
<label for="thirdPartyUrl">Third Party: Tutorial Page</label>
<input type="text" class="form-control" id="thirdPartyURL" placeholder="Enter the third party tutorial URL here">
</div>
<div class="col-lg-10 col-lg-offset-1">
<br/>
<label for="thirdPartyUrl">Third Party: Instructions Page</label>
<input type="text" class="form-control" id="thirdPartyInstr" placeholder="Enter the third party instructions URL here">
</div>
</div>
<!-- <button type="submit" id="updatePrice" class="btn btn-default">Update</button> -->
</form></p></div>
<!-- Button trigger modal -->
<form class="form-horizontal" role="form">
<div class="form-group someAirForRecruitingPanel">
<div class="col-lg-offset-1 col-lg-10">
<div class="cta">
<div class="cta-buttons">
<button type = "button" id="openInstructionsModal" class="btn btn-info btn-lg" data-toggle="modal" data-target="#myModal">Edit waiting page instructions</button>
</div>
</div>
</div>
</div>
</form>
<form id = "autoSendToURLForm" class="form-horizontal forAutoTab" role="form">
<div class="form-group">
<div class="col-lg-offset-1 col-lg-10">
<label for="autoSendToURL" class="col-sm-2 control-label">URL</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="autoSendToURL" placeholder="USE HTTPS! Enter URL to send workers to">
</div>
</div>
</div>
</form>
<form class="form-horizontal" role="form">
<div id = "startStopButtons">
<div class="form-group someAirForRecruitingPanel">
<div class="col-lg-offset-1 col-lg-10">
<div class="cta">
<div class="cta-buttons">
<button type="submit" id="startRecruiting" class="btn btn-info btn-lg">Start recruiting</button>
<button type="submit" id="stopRecruiting" class="btn btn-danger btn-lg">Stop recruiting</button>
</div>
</div>
</div>
</div>
</div>
</form>
</div>
<div class="tab-pane" id="directTab">
<br/>
<form id = "directModeForms" class="form-horizontal" role="form">
<div class="form-group someAirForRecruitingPanel">
<div class="col-lg-offset-1 col-lg-10">
<label for="sendToURL" class="col-sm-2 control-label">URL</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="sendToURL" placeholder="USE HTTPS! Enter URL to send workers to">
</div>
</div>
</div>
<div class="form-group someAirForRecruitingPanel">
<div class="col-lg-offset-1 col-lg-10">
<label for="sendToURL" class="col-sm-2 control-label">Price (cents)</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="price" placeholder="Price in cents">
</div>
</div>
</div>
<div class="form-group">
<div class="col-sm-12">
<div class="form-group row someAirForRecruitingPanel">
<div class="col-lg-offset-1 col-lg-10">
<label for="numHITs" class="col-sm-3 control-label">Num HITs</label>
<div class="col-sm-2">
<input type="text" class="form-control" id="numHITs" placeholder="">
</div>
<label for="numAssignments" class="col-sm-5 control-label">Num Assignments</label>
<div class="col-sm-2">
<input type="text" class="form-control" id="numAssignments" placeholder="">
</div>
</div>
</div>
</div>
</div>
</form>
<form class="form-horizontal" role="form">
<div id = "postExpireButtons">
<div class="form-group someAirForRecruitingPanel">
<div class="col-lg-offset-1 col-lg-8">
<div class="cta">
<div class="cta-buttons">
<button type="submit" id="postHITs" class="btn btn-info btn-lg">Post HITs</button>
<button type="submit" id="expireHITs" class="btn btn-danger btn-lg">Expire All HITs</button>
</div>
</div>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<!-- End Recruiting Panel -->
</div>
</div>
</div>
</div>
<div class="col-md-6">
<!-- Overview Tab -->
<div id = "overview">
<div class="cool-block">
<div class="cool-block-bor">
<span class="grandTitre text-primary">Overview</span>
<br /><br />
<form role="form" class="form-horizontal">
<div class="cta">
<div class="cta-buttons">
<button type="submit" id="reloadHits" class="btn btn-info btn-sm">Load HITs</button>
<button type="submit" id="approveAll" class="btn btn-success btn-sm">Approve all loaded HITs</button>
<button type="submit" id="disposeAll" class="btn btn-warning btn-sm">Dispose all loaded HITs</button>
</div>
</div>
</form>
</br>
<ul class="list-group" id="hitsList">
</ul>
</div>
<!-- <div class="col-sm-6"> -->
</div>
</div>
<!--/ Overview Tab -->
<!-- Workers Tab -->
<div id = "triggerDiv">
<div class="cool-block">
<div class="cool-block-bor">
<span class="grandTitre text-primary">Workers ready</span>
<p id = "numOnlineText"><span id="numOnline">x</span></p>
<form class="form-horizontal" role="form">
<div class="form-group">
<div class="col-lg-10 col-lg-offset-1">
<input type="text" class="form-control" id="fireToURL" placeholder="Use HTTPs enter URL to send workers to ...">
</div>
</div>
<div class="form-group">
<div class="col-lg-10 col-lg-offset-1">
<input type="text" class="form-control" id="numFire" placeholder="Number of workers to route">
</div>
</div>
<div class="form-group" id = "fireButtonsGroup">
<div class="col-lg-offset-1 col-lg-10">
<div class="cta">
<div class="cta-buttons pull-right">
<button type="submit" id="fireWorkers" class="btn btn-info btn-sm">Route!</button>
<button type="submit" id="clearQueue" class="btn btn-danger btn-sm">Clear entire queue (pays workers)</button>
</div>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
<!--/ End Workers Tab -->
</div>
</div>
</body>
</html>