-
Notifications
You must be signed in to change notification settings - Fork 1
/
template.htm
57 lines (51 loc) · 1.79 KB
/
template.htm
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
<!-- This file needs to be hosted on an external server. -->
<html>
<script language="Javascript">
//
// This method Gets URL Parameters (GUP)
//
function gup( name )
{
var regexS = "[\\?&]"+name+"=([^&#]*)";
var regex = new RegExp( regexS );
var tmpURL = window.location.href;
var results = regex.exec( tmpURL );
if( results == null )
return "";
else
return results[1];
}
</script>
<body>
<form id="mturk_form" method="POST" action="http://www.mturk.com/mturk/externalSubmit">
<input type="hidden" id="assignmentId" name="assignmentId" value="">
<h3>Look at the map picture and use street names to find the location on Google Maps. Submit the <a href="https://s3.amazonaws.com/ss12_mturk/instructions.jpg">link</a> for the given location.</h3>
<p>
<script language="Javascript">
document.write("<img src=\"https://s3.amazonaws.com/ss12_mturk/" + gup('img') + "\"></img>");
</script>
<textarea rows="1" cols="80">
</textarea>
<p>
<input id="submitButton" type="submit" name="Submit" value="Submit">
<p>
</form>
<script language="Javascript">
document.getElementById('assignmentId').value = gup('assignmentId');
//
// Check if the worker is PREVIEWING the HIT or if they've ACCEPTED the HIT
//
if (gup('assignmentId') == "ASSIGNMENT_ID_NOT_AVAILABLE")
{
// If we're previewing, disable the button and give it a helpful message
document.getElementById('submitButton').disabled = true;
document.getElementById('submitButton').value = "You must ACCEPT the HIT before you can submit the results.";
} else {
var form = document.getElementById('mturk_form');
if (document.referrer && ( document.referrer.indexOf('workersandbox') != -1) ) {
form.action = "http://workersandbox.mturk.com/mturk/externalSubmit";
}
}
</script>
</body>
</html>