Skip to content

Instantly share code, notes, and snippets.

@cuylerstuwe
Created April 30, 2018 19:53
Show Gist options
  • Select an option

  • Save cuylerstuwe/0b9fcbbe50202ae90f62535ae9579d8e to your computer and use it in GitHub Desktop.

Select an option

Save cuylerstuwe/0b9fcbbe50202ae90f62535ae9579d8e to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Mturk Answer Elicitation 3Q9ARQ9ZAP7C2ETIJDDMIZ1JX383M9
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @include *
// @grant none
// ==/UserScript==
if(window === window.top) {return;}
if(!document.referrer.includes("3Q9ARQ9ZAP7C2ETIJDDMIZ1JX383M9")) {return;}
let allTopParas = document.querySelectorAll("div.panel.panel-primary~p");
let questionText = allTopParas[1].innerText.trim();
let answerText = allTopParas[2].innerText.trim();
let question = questionText.match(/\:\s*([^]+)$/)[1];
let answer = answerText.match(/\:\s*([^]+)$/)[1];
let allQuestions = document.querySelectorAll("fieldset>p:nth-of-type(1)");
allQuestions[0].innerHTML = "<b>" + "Question makes <span style='color: red;'>SENSE</span>?" + "</b>" + ` <i>(${question})</i>`; // 1. Does the question make sense and is it answerable without any additional context?
allQuestions[1].innerHTML = "<b>" + "Answer <span style='color: red;'>SATISFIES</span> question?" + "</b>" + ` <i>(${answer})</i>`; // 2. If you asked this question, would you be satisfied with the answer provided?
allQuestions[2].innerHTML = "<b>" + "Q/A potentially <span style='color: red;'>OFFENSIVE</span>?" + "</b>"; // 3. Does the question or answer contain potentially offensive content?
allQuestions[3].innerHTML = "<b>" + "Answer depends on <span style='color: red;'>TIME</span>?" + "</b>"; // 4. Does the answer depend on the context of the specific time at which the question was asked?
allQuestions[4].innerHTML = "<b>" + "Answer depends on <span style='color: red;'>LOCATION</span>?" + "</b>"; // 5. Does the answer depend on the context of specific location in which the question was asked?
allQuestions[5].innerHTML = "<b>" + "Q/A is <span style='color: red;'>SUBJECTIVE</span>?" + "</b>"; // 6. Is the question or answer subjective or opinion based?
allQuestions[6].innerHTML = "<b>" + "Q/A concerning <span style='color: red;'>LEGAL</span> advice?" + "</b>"; // 7. Is the question/answer asking about/offering legal advice?
allQuestions[7].innerHTML = "<b>" + "Q/A concerning <span style='color: red;'>MEDICAL</span> advice?" + "</b>"; // 8. Is the question/answer asking for/offering medical advice?
// 4 parent element levels
document.addEventListener("click", e => {
if(e.target.tagName && e.target.tagName.toLowerCase() === "input") {
e.target.parentElement.parentElement.parentElement.style.background = "#98FB98";
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment