RelevanceQuest HIT Helper

(mTurk) Selects all "Non Adult" radio buttons in "Flag images - (WARNING: This HIT may contain adult content. Worker discretion is advised.)" Clicking on an image flags it as explicit. Clicking on an image twice flags it as fetish. Right clicking on an image flags it as gruesome. Middle clicking an image flags it as suggestive.

  1. // ==UserScript==
  2. // @name RelevanceQuest HIT Helper
  3. // @namespace http://ericfraze.com
  4. // @version 0.8
  5. // @description (mTurk) Selects all "Non Adult" radio buttons in "Flag images - (WARNING: This HIT may contain adult content. Worker discretion is advised.)" Clicking on an image flags it as explicit. Clicking on an image twice flags it as fetish. Right clicking on an image flags it as gruesome. Middle clicking an image flags it as suggestive.
  6. // @include https://s3.amazonaws.com/mturk_bulk/hits/*
  7. // @include https://www.mturkcontent.com/dynamic/hit*
  8. // @copyright 2014+, Eric Fraze
  9. // @require http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js
  10. // ==/UserScript==
  11.  
  12. $(document).ready(function() {
  13. // Make sure we are on the right HIT
  14. if ( ( $("label[for='illegal_content']:contains('We do our best to prevent illegal content from being included in the task.')").length )
  15. && ( $("#__Result1_0[value='PERVERSION']").length ) ) {
  16. // Check all radi buttons as non-adult
  17. $("input[value='NOT_ADULT']").prop('checked', true);
  18. // Check "fetish" on double click
  19. $("img").dblclick( function() {
  20. // Check the button
  21. $(this).parents("td").find("input[value='PERVERSION']").click();
  22.  
  23. // Focus so the enter key can submit the HIT
  24. $(this).parents("td").find("input[value='PERVERSION']").focusWithoutScrolling();
  25.  
  26. // Change image opacity so the user knows the script ran correctly
  27. $(this).css("opacity", "0.6");
  28. });
  29. // All other mouse clicks
  30. $('img').mousedown(function(event) {
  31. switch (event.which) {
  32. case 1:
  33. // Check "Adult" on left click
  34. $(this).parents("td").find("input[value='EXPLICIT']").click();
  35. $(this).parents("td").find("input[value='EXPLICIT']").focusWithoutScrolling();
  36. $(this).css("opacity", "0.6");
  37. break;
  38. case 2:
  39. // Check "Suggestive" on middle click
  40. $(this).parents("td").find("input[value='SUGGESTIVE']").click();
  41. $(this).parents("td").find("input[value='SUGGESTIVE']").focusWithoutScrolling();
  42. $(this).css("opacity", "0.6");
  43. break;
  44. case 3:
  45. // Check "Gruesome" on right click
  46. $(this).parents("td").find("input[value='GRUESOME']").click();
  47. $(this).parents("td").find("input[value='GRUESOME']").focusWithoutScrolling();
  48. $(this).css("opacity", "0.6");
  49. break;
  50. }
  51. });
  52.  
  53. // Stop right click menu
  54. document.addEventListener("contextmenu", function(e){
  55. if (e.target.nodeName === "IMG") {
  56. e.preventDefault();
  57. }
  58. }, false);
  59.  
  60. // Stop scrolling on focus of radio button
  61. $.fn.focusWithoutScrolling = function(){
  62. var x = window.scrollX, y = window.scrollY;
  63. this.focus();
  64. window.scrollTo(x, y);
  65. };
  66.  
  67. // Stop scrolling on middle mouse press
  68. $(document.body).on("mousedown", function (e) { e.preventDefault(); } );
  69.  
  70. }
  71. });

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址