Created
November 14, 2010 23:35
-
-
Save johnjosephhorton/676230 to your computer and use it in GitHub Desktop.
Some code for doing simple A/B-type randomization for locally-hosted HITs on Amazon Mechanical Turk (MTurk)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
function rand(){ | |
if (Math.random() > .5){ | |
document.getElementById('boss').style.visibility="hidden"; | |
} else { | |
document.getElementById('requester').style.visibility="hidden"; | |
} | |
} | |
</script> | |
<p>What country are your from?</p> | |
<p><input type="radio" name="country" value="US" />US<br /> | |
<input type="radio" name="country" value="India" />India<br /> | |
<input type="radio" name="country" value="Other" />Other</p> | |
<div hidden="false" id="boss"> | |
<h3>What percentage (between 0 and 100) of Employers in your home country would you estimate treat workers honestly and fairly?</h3> | |
<input type="text" id="real" name="real" /></div> | |
<div hidden="false" id="requester"> | |
<h3>What percentage (between 0 and 100) of Mechanical Turk Requesters would you estimate treat workers honestly and fairly?</h3> | |
<input type="text" id="amt" name="amt" /></div> | |
<p><iframe height="1" onload="rand()"></iframe></p> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment