Created
August 20, 2015 16:04
-
-
Save jhamrick/a5d9889da15174a2e690 to your computer and use it in GitHub Desktop.
psiTurk default.html that generates random debug links
This file contains 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
<!doctype html> | |
<html> | |
<head> | |
<title>CompCog Psychology Experiment</title> | |
<script src="static/lib/jquery.min.js" type="text/javascript"></script> | |
<script src="static/lib/bootstrap.min.js"></script> | |
<link rel="stylesheet" href="static/css/bootstrap.min.css"> | |
<link rel="stylesheet" type="text/css" href="static/css/general.css" media="screen" /> | |
</head> | |
<body> | |
<div class="container-flex" id="container-ad"> | |
<h1>psiTurk Experiment</h1> | |
<p>Begin by viewing the <a href="#" id="ad-href">ad</a>.</p> | |
<script type="text/javascript"> | |
function makeid() | |
{ | |
var text = ""; | |
var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; | |
for( var i=0; i < 5; i++ ) | |
text += possible.charAt(Math.floor(Math.random() * possible.length)); | |
return text; | |
} | |
var assignmentId = "debug" + makeid(); | |
var hitId = "debug" + makeid(); | |
var workerId = "debug" + makeid(); | |
var href = "/ad?assignmentId=" + assignmentId + "&hitId=" + hitId + "&workerId=" + workerId + "&mode=debug" | |
$("#ad-href").attr("href", href); | |
</script> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment