-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPosNotAbsolute.html
403 lines (351 loc) · 19.5 KB
/
PosNotAbsolute.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
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
<meta charset="UTF-8" />
<title></title>
<style type="text/css">body{
background-color: #5e6062;
}
h3{
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
font-size: 20px;
color: white;
font-weight: bold;
}
.demographics{
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
font-size: 20px;
color: white;
}
.highlight-box {
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
border:solid 0px #98BE10;
background:#FCF9CE;
color:#333333;
padding:4px;
text-align:left;
font-size: 20px;
}
video{
margin: 20px;
}
#taskname{
font-weight: bold;
}
.instructions{
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
padding: 20px;
margin: 10px;
font-size: 20px;
font-weight: normal;
color: white;
}
.notice{
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
padding: 20px;
margin: 10px;
font-size: 20px;
font-weight: bold;
color: white;
}
p{
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
font-size: 20px;
font-weight: bold;
color: white;
}
button {
visibility: hidden;
background-color: transparent;
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
font-size: 30px;
font-weight: bold;
color: white;
}
#submitButton{
visibility: hidden;
background-color: transparent;
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
margin-top: 10px;
font-size: 30px;
font-weight: bold;
color: white;
}
.startButton{
margin-left: 20px;
}
.button2{
margin-left: 10px;
margin-right: 10px;
}
.button1, .button2, .button3{
display: inline-block;
vertical-align: top;
horiz-align: left;
margin-top: 85px;
}
#demoButton {
margin-left: 20px;
}
.counter{
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
font-size: 30px;
font-weight: bold;
color: white;
display: inline-block;
vertical-align: top;
}
#consentForm{
color: #4cd2da;
}
video::-webkit-media-controls, video::media-controls{
display:none !important;
}
#buttonCounter{
vertical-align:top;
}
</style>
<script type="text/javascript">
window.onload = screenBrowser;//beginTask;
var time0, rate;
var resp;
var trialNum=0;
var videos = ['2.2.mp4', '2.2.mp4', '2.2.mp4','2.2.mp4','2.2.mp4','2.2.mp4'];//['2.6.mp4', '2.4.mp4', '2.4.mp4', '2.6.mp4', '2.2.mp4', '2.4.mp4', '2.2.mp4', '2.8.mp4', '2.4.mp4', '3.1.mp4', '2.2.mp4', '2.8.mp4', '2.6.mp4', '2.4.mp4', '2.8.mp4', '2.4.mp4', '2.6.mp4', '2.6.mp4', '2.6.mp4', '2.8.mp4', '2.6.mp4', '2.6.mp4', '3.3.mp4', '3.2.mp4', '2.4.mp4', '3.2.mp4', '3.3.mp4', '2.2.mp4', '2.6.mp4', '3.2.mp4', '2.4.mp4', '2.4.mp4', '2.4.mp4', '2.4.mp4', '2.6.mp4', '3.2.mp4', '2.8.mp4', '3.3.mp4', '2.8.mp4', '2.2.mp4', '2.4.mp4', '2.2.mp4', '2.8.mp4', '2.2.mp4', '2.2.mp4', '2.2.mp4', '2.8.mp4', '2.4.mp4', '2.8.mp4', '2.2.mp4', '2.6.mp4', '2.2.mp4', '3.1.mp4', '2.8.mp4', '2.4.mp4', '2.6.mp4', '2.6.mp4', '2.6.mp4', '2.6.mp4', '2.2.mp4', '2.6.mp4', '2.6.mp4', '3.1.mp4', '2.2.mp4', '2.2.mp4', '2.8.mp4', '2.4.mp4', '2.4.mp4', '3.3.mp4', '2.6.mp4', '3.3.mp4', '2.8.mp4', '2.8.mp4', '2.6.mp4', '2.2.mp4', '2.6.mp4', '3.3.mp4', '2.4.mp4', '2.2.mp4', '2.2.mp4', '2.8.mp4', '2.8.mp4', '2.4.mp4', '2.4.mp4', '2.4.mp4', '2.8.mp4', '2.6.mp4', '3.2.mp4', '2.4.mp4', '2.8.mp4', '2.2.mp4', '2.6.mp4', '2.2.mp4', '3.1.mp4', '2.8.mp4', '2.2.mp4', '3.1.mp4', '2.2.mp4', '2.4.mp4', '2.6.mp4', '2.8.mp4', '2.8.mp4', '2.2.mp4', '2.4.mp4', '2.6.mp4', '2.4.mp4', '2.8.mp4', '2.6.mp4', '2.8.mp4', '2.8.mp4', '2.2.mp4', '2.2.mp4', '2.6.mp4', '3.1.mp4', '2.6.mp4', '2.4.mp4', '2.8.mp4', '3.2.mp4', '2.8.mp4', '2.2.mp4', '2.6.mp4', '2.4.mp4', '2.6.mp4', '2.8.mp4', '2.2.mp4', '2.2.mp4', '2.8.mp4', '2.8.mp4', '2.4.mp4', '2.4.mp4', '2.6.mp4', '2.8.mp4', '2.2.mp4', '2.8.mp4', '2.4.mp4', '2.2.mp4', '2.2.mp4', '2.4.mp4'];
var rates = [1,1,2,2,.5,.5]; //[2, 0.5, 2, 2, 0.5, 2, 2, 1, 2, 2, 2, 1, 1, 0.5, 2, 0.5, 1, 0.5, 2, 0.5, 1, 0.5, 1, 0.5, 2, 1, 2, 1, 0.5, 2, 2, 1, 1, 2, 0.5, 2, 0.5, 0.5, 1, 0.5, 0.5, 2, 0.5, 0.5, 2, 2, 1, 1, 0.5, 1, 2, 1, 0.5, 2, 1, 1, 1, 2, 0.5, 2, 1, 2, 1, 1, 1, 2, 2, 0.5, 2, 1, 1, 0.5, 2, 2, 1, 1, 0.5, 1, 0.5, 0.5, 1, 1, 1, 1, 0.5, 0.5, 0.5, 0.5, 0.5, 2, 1, 1, 0.5, 0.5, 1, 2, 2, 2, 0.5, 0.5, 2, 1, 1, 2, 0.5, 0.5, 0.5, 0.5, 2, 2, 0.5, 1, 0.5, 1, 1, 1, 2, 1, 2, 0.5, 2, 2, 2, 1, 1, 0.5, 1, 0.5, 1, 2, 2, 0.5, 2, 0.5, 0.5, 2, 0.5, 1];
var N = videos.length;
var times=[];
data=[];//"Trial,MovieName,Rate,Response,ReactionTime\n";
var stim;
var browserList =["Chrome", "Safari", "Microsoft Internet Explorer", "Netscape"]; //screen out firefox users
var objappVersion = navigator.appVersion;
var objAgent = navigator.userAgent;
var objbrowserName = navigator.appName;
var objfullVersion = ''+parseFloat(navigator.appVersion);
var objBrMajorVersion = parseInt(navigator.appVersion,10);
var objOffsetName,objOffsetVersion,ix;
// In Chrome
if ((objOffsetVersion=objAgent.indexOf("Chrome"))!=-1) {
objbrowserName = "Chrome";
objfullVersion = objAgent.substring(objOffsetVersion+7);
}
// In Microsoft internet explorer
else if ((objOffsetVersion=objAgent.indexOf("MSIE"))!=-1) {
objbrowserName = "Microsoft Internet Explorer";
objfullVersion = objAgent.substring(objOffsetVersion+5);
}
// In Firefox
else if ((objOffsetVersion=objAgent.indexOf("Firefox"))!=-1) {
objbrowserName = "Firefox";
objfullVersion = objAgent.substring(objOffsetVersion+5);
}
// In Safari
else if ((objOffsetVersion=objAgent.indexOf("Safari"))!=-1) {
objbrowserName = "Safari";
objfullVersion = objAgent.substring(objOffsetVersion+7);
if ((objOffsetVersion=objAgent.indexOf("Version"))!=-1)
objfullVersion = objAgent.substring(objOffsetVersion+8);
}
// For other browser "name/version" is at the end of userAgent
else if ((objOffsetName=objAgent.lastIndexOf(' ')+1) <
(objOffsetVersion=objAgent.lastIndexOf('/')) )
{
objbrowserName = objAgent.substring(objOffsetName,objOffsetVersion);
objfullVersion = objAgent.substring(objOffsetVersion+1);
if (objbrowserName.toLowerCase()==objbrowserName.toUpperCase()) {
objbrowserName = navigator.appName;
}
}
// trimming the fullVersion string at semicolon/space if present
if ((ix=objfullVersion.indexOf(";"))!=-1)
objfullVersion=objfullVersion.substring(0,ix);
if ((ix=objfullVersion.indexOf(" "))!=-1)
objfullVersion=objfullVersion.substring(0,ix);
objBrMajorVersion = parseInt(''+objfullVersion,10);
if (isNaN(objBrMajorVersion)) {
objfullVersion = ''+parseFloat(navigator.appVersion);
objBrMajorVersion = parseInt(navigator.appVersion,10);
}
function screenBrowser(){
//browser = window.navigator.userAgent.toLowerCase();
if (browserList.indexOf(objbrowserName) == -1 )
{
document.getElementById('container').style.visibility = "hidden";
alert('This browser is not compatible for this task. Please switch to either of ' + browserList);
} {
beginTask();
setupStim();
}
document.getElementById("browser").innerHTML = "<input type='hidden' name='browser' value = " + objbrowserName + ">";
}
function disableButtons(){
var col = "#A9A9A9";
document.getElementById('ba').disabled = true;
document.getElementById('da').disabled = true;
document.getElementById('ga').disabled = true;
document.getElementById('ba').style.color = col;
document.getElementById('da').style.color = col;
document.getElementById('ga').style.color = col;
}
function enableButtons(){
document.getElementById('ba').disabled = false;
document.getElementById('da').disabled = false;
document.getElementById('ga').disabled = false;
document.getElementById('ba').style.color = "white";
document.getElementById('da').style.color = "white";
document.getElementById('ga').style.color = "white";
}
function setupStim(){
stim = document.getElementById('movie');
stim.addEventListener('loadeddata', function() {
stim.defaultPlaybackRate = rates[trialNum];
stim.playbackRate = rates[trialNum];
stim.play();
setTimeout(enableButtons,stim.duration*(1/stim.playbackRate)*1000);
}, false);
}
function Demo(){
var demoVid = document.getElementById('demoVid');
demoVid.play();
document.getElementById('start').style.visibility = "visible";
}
function beginTask(){
document.getElementById('demoButton').style.visibility = "visible";
}
function Stimulus(trialNum, movieName,rate,response, rt) {
this.trialNum = trialNum;
this.movieName = movieName;
this.rate = rate;
this.response = response;
this.rt=rt;
}
function showOptions(){
document.getElementById('ba').style.visibility = "visible";
document.getElementById('da').style.visibility = "visible";
document.getElementById('ga').style.visibility = "visible";
}
function hideOptions(){
document.getElementById('ba').style.visibility = "hidden";
document.getElementById('da').style.visibility = "hidden";
document.getElementById('ga').style.visibility = "hidden";
}
function hideEverything(){
hideOptions();
hide('movie');
}
Stimulus.prototype.toString = function () {
var trial = "<input type='hidden' name='Trial_" + String(this.trialNum +1)+"'" + " value = " + (this.trialNum +1) + ">";
var stimulus = "<input type='hidden' name='stimulus_"+ String(this.trialNum +1)+"'" + " value = " + this.movieName + ">";
var playRate = "<input type='hidden' name='PlaybackRate_"+String(this.trialNum +1)+"'"+ " value = " + this.rate + ">";
var resp = "<input type='hidden' name='Response_"+String(this.trialNum +1)+"'"+ " value = " + this.response + ">";
var responseTime = "<input type='hidden' name='ReactionTime_"+String(this.trialNum +1)+"'"+" value = " + this.rt + ">";
var output = trial + stimulus + playRate + resp + responseTime;
return output
};
function hide(ID){
document.getElementById(ID).style.visibility = "hidden";
}
function playVideo(){
document.getElementById('instructions').innerHTML = "";
document.getElementById('demoVideoBox').innerHTML = "";
stim.src = "https://s3.amazonaws.com/mcgurkstimuli/" + videos[trialNum];
document.getElementById('p3').innerHTML = (trialNum + 1)+ ' / '+ N;
time0=performance.now();
return time0;
}
function choice(resp){
var time1 = performance.now();
stim.rt = Math.round(time1-time0);
stim.response = resp;
videos[trialNum] = new Stimulus(trialNum,stim.src,rate,resp,stim.rt);
videos[trialNum].rt = stim.rt;
videos[trialNum].response = stim.response;
videos[trialNum].movieName = stim.src;
videos[trialNum].rate = stim.playbackRate;
videos[trialNum].trial=trialNum;
data +=videos[trialNum];
trialNum++;
if (trialNum<N){
disableButtons();
playVideo();
}
else {
hideOptions();
hide('movie');
document.getElementById("inputfields").innerHTML = data;
document.getElementById('p3').innerHTML = "Thank you for your participation. In order to receive credit, please click the submit button.";
document.getElementById("submitButton").style.visibility = "visible";
}
}
</script>
<div id="container">
<h3 id="taskDescp">Watch 10 minutes of videos and transcribe what is said.</h3>
<div class="highlight-box" id="highlight-box">
<ul>
<li>Please accept this HIT before making any responses. Accepting the HIT after making responses can erase responses.</li>
</ul>
<ul>
<li>This HIT requires Javascript enabled latest versions of Chrome, Safari, or Internet Explorer.</li>
</ul>
<ul>
<li>
This task requires that you watch the video and listen to the soundtrack.
Please resize the window so that it fills as much of your screen as possible and adjust the volume so that you can clearly hear the soundtrack.
</li>
</ul>
<ul>
<li>Although on average this task takes about 15 minutes to complete, the task will not expire for an hour. We are offering $3.00 to complete the task. </li>
</ul>
</div>
<p id="consent">The results of these questions are being used for a scientific study. <a href="http://openwetware.org/wiki/Beauchamp:StudyOverviewMTurk" id="consentForm" target="_blank">Click here (opens in new window)</a> to learn more about the study details. By accepting this HIT, you are consenting to take part in the study. If you do not wish to take part, do not accept the HIT.</p>
<div class="demographics" id="demographics">
<p> </p>
<ul>
<li>Do you have a hearing impairment? <label for="hearYes">Yes</label><input id="hearYes" name="hear" type="radio" value="yes" /><label for="hearNo">No</label><input id="hearNo" name="hear" type="radio" value="no" /></li>
<li>Do you have a vision impairment (trouble seeing things even with glasses or contacts)? <label for="seeYes">Yes</label><input id="seeYes" name="see" type="radio" value="yes" /><label for="seeNo">No</label><input id="seeNo" name="see" type="radio" value="no" /></li>
<li>Was English the first language that you learned (your native language)? <label for="englishFirstYes">Yes</label><input id="englishFirstYes" name="englishFirst" type="radio" value="yes" /><label for="englishFirstNo">No</label><input id="englishFirstNo" name="englishFirst" type="radio" value="no" /></li>
<li>Are you fluent in English? <label for="fluentEnglishYes">Yes</label><input id="fluentEnglishYes" name="fluentEnglish" type="radio" value="yes" /><label for="fluentEnglishNo">No</label><input id="fluentEnglishNo" name="fluentEnglish" type="radio" value="no" /></li>
<li>Are you fluent in any language besides English? <label for="fluentOtherYes">Yes</label><input id="fluentOtherYes" name="fluentOther" type="radio" value="yes" /><label for="fluentOtherNo">No</label><input id="fluentOtherNo" name="fluentOther" type="radio" value="no" /></li>
<li>Gender: <label for="genderFemale">Female</label><input id="genderFemale" name="gender" type="radio" value="Female" /><label for="genderMale">Male</label><input id="genderMale" name="gender" type="radio" value="male" /></li>
<!--<label for="dnwGender">Other/Do not wish to answer</label><input id="dnwGender" name="gender" type="radio" value="DNW" />-->
<li>Age Range: <select name="ageRange"><option value="ZZ">Select One</option><option>18-25</option><option>26-35</option><option>36-45</option><option>46-55</option><option>56-65</option><option>66-75</option><option>over 75</option></select></li>
<!--<option value="DNW">Do not wish to answer</option>-->
<li>What state do you consider your primary residence: <select name="state"><option value="ZZ">Select One</option><option value="AL">Alabama</option><option value="AK">Alaska</option><option value="AZ">Arizona</option><option value="AR">Arkansas</option><option value="CA">California</option><option value="CO">Colorado</option><option value="CT">Connecticut</option><option value="DE">Delaware</option><option value="DC">District Of Columbia</option><option value="FL">Florida</option><option value="GA">Georgia</option><option value="HI">Hawaii</option><option value="ID">Idaho</option><option value="IL">Illinois</option><option value="IN">Indiana</option><option value="IA">Iowa</option><option value="KS">Kansas</option><option value="KY">Kentucky</option><option value="LA">Louisiana</option><option value="ME">Maine</option><option value="MD">Maryland</option><option value="MA">Massachusetts</option><option value="MI">Michigan</option><option value="MN">Minnesota</option><option value="MS">Mississippi</option><option value="MO">Missouri</option><option value="MT">Montana</option><option value="NE">Nebraska</option><option value="NV">Nevada</option><option value="NH">New Hampshire</option><option value="NJ">New Jersey</option><option value="NM">New Mexico</option><option value="NY">New York</option><option value="NC">North Carolina</option><option value="ND">North Dakota</option><option value="OH">Ohio</option><option value="OK">Oklahoma</option><option value="OR">Oregon</option><option value="PA">Pennsylvania</option><option value="RI">Rhode Island</option><option value="SC">South Carolina</option><option value="SD">South Dakota</option><option value="TN">Tennessee</option><option value="TX">Texas</option><option value="UT">Utah</option><option value="VT">Vermont</option><option value="VA">Virginia</option><option value="WA">Washington</option><option value="WV">West Virginia</option><option value="WI">Wisconsin</option><option value="WY">Wyoming</option><option value="XX">Other</option><option value="DNW">Do not wish to answer</option></select></li>
</ul>
<p> </p>
</div>
<hr id="line" />
<p class="instructions" id="taskname"><b>Audiovisual Task</b></p>
<p class="instructions" id="instructions">You will see videos and hear audio clips of a person saying syllables. Please watch the screen at all times.
After each video, press a button to indicate what the person said. If you are not sure, take your best guess. The buttons are inactive while the video is playing.
<br>Play the demo video to ensure that you can hear the actor and see the actor's entire face clearly. You can play the demo video multiple times.
<br>Press the "Begin Task" button to start...</p>
<div id="demoVideoBox">
<table width = "1000px" height = "500px"><tr>
<td width="640px">
<video id="demoVid" width = "640px" height = "480px"><source src="https://s3.amazonaws.com/mcgurkstimuli/3.3.mp4" /></video>
</td>
<td>
<p>Please accept HIT before playing the demo.
<br>If you can see the entire face of the actor, click the "Play Demo Video" button below.
</p>
<p><button id="demoButton" onclick="Demo()" type="button">Play Demo Video</button></p>
<p><button class="startButton" id="start" onclick="playVideo()" type="button">Begin Task</button></p>
</td>
</tr></table>
</div>
<div id="taskVideoBox">
<table width = "1000px" height = "500px"><tr>
<td width="640px">
<video id="movie" poster = "https://s3.amazonaws.com/mcgurkstimuli/greyBox.png" onended="showOptions()" width = "640px" height="480px"><source /></video>
</td>
<td id = "buttonCounter">
<p class="counter" id="p3"> </p>
<p>
<button class="button1" id="ba" onclick="choice('BA')" type="button">BA</button>
<button class="button2" id="da" onclick="choice('DA')" type="button">DA</button>
<button class="button3" id="ga" onclick="choice('GA')" type="button">GA</button>
</p>
<p><input id="submitButton" type="submit" /></p>
</td>
</tr></table>
</div>
<div id="inputfields"> </div>
<div id="browser"> </div>
</div>