[.01 Vale]Click on the described object

1-3 to select radio buttons,` to submit, hide instructions. Select radio button before clicking image to submit correctly

当前为 2015-07-19 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name [.01 Vale]Click on the described object
  3. // @author robert
  4. // @namespace https://greasyfork.org/en/users/13168-robert
  5. // @description 1-3 to select radio buttons,` to submit, hide instructions. Select radio button before clicking image to submit correctly
  6. // @include https://www.mturkcontent.com/dynamic/hit*
  7. // @version 1
  8. // @grant none
  9. // @require http://code.jquery.com/jquery-2.1.0.min.js
  10. // ==/UserScript==
  11. var autosubmit = false;
  12. var hideInstructions = true;
  13.  
  14. if(hideInstructions)
  15. {
  16. $("h2:contains('Instructions')").hide();
  17. $("h3:contains('Examples:')").hide();
  18. $("img[class='imagecontainer']").hide();
  19. $("ul:contains('Please click anywhere inside')").hide();
  20. }
  21. if ( $("p:contains('Please click on the following object:')").length )
  22. {
  23. $("input:radio[id='Confident']").focus();
  24. if(autosubmit)
  25. window.onkeydown = function(e)
  26. {
  27. if (e.keyCode === 97 || e.keyCode === 49) //1
  28. {
  29. $("input:radio[id='Confident']").click();
  30. if (autosubmit)
  31. $("input[id='submitButton']").click();
  32. }
  33. if (e.keyCode === 98 || e.keyCode === 50) //2
  34. {
  35. $("input:radio[id='MultiObj']").click();
  36. if (autosubmit)
  37. $("input[id='submitButton']" ).click();
  38. }
  39. if (e.keyCode === 99 || e.keyCode === 51) //3
  40. {
  41. $("input:radio[id='NoObj']").click();
  42. if (autosubmit)
  43. $("input[id='submitButton']" ).click();
  44. }
  45. if (e.keyCode === 192 ) //`
  46. $("input[id='submitButton']").click();
  47. };
  48. }
  49. /*
  50. <input id="submitButton" type="submit" value="complete the task before you can submit" disabled="" autocomplete="off">
  51. <input id="submitButton" type="submit" value="submit" autocomplete="off">
  52. */