autonomnom - VisionTurk - See the Images and Answer Multiple Choice Questions

Select

当前为 2015-10-22 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name autonomnom - VisionTurk - See the Images and Answer Multiple Choice Questions
  3. // @author mkrobert
  4. // @namespace mkrobert
  5. // @include *
  6. // @version 0.01
  7. // @grant none
  8. // @description:en Select
  9. // @icon http://mturkgrind.com/data/avatars/l/8/8874.jpg?1445404860
  10. // @require https://code.jquery.com/jquery-2.1.4.min.js
  11. // @description Select
  12. // ==/UserScript==
  13.  
  14. if ($("h3:contains(See the Images and Answer Multiple Choice Questions)").length)
  15. runScript();
  16.  
  17. function runScript()
  18. {
  19. $('#start-btn').focus(); //saves you from needing to click on the background at the start
  20. window.onkeydown = function(e)
  21. {
  22. //Press 1 through 4 for Red, Yellow or Green choices.
  23. if (e.keyCode === 82) {//press the r key for red box
  24. $('#optionsRadios0').click();
  25. $('#next-btn').click();
  26. }
  27. if (e.keyCode === 89) {//press the y key for yellow box
  28. $('#optionsRadios1').click();
  29. $('#next-btn').click();
  30. }
  31. if (e.keyCode === 71) {//press the g key for green box
  32. $('#optionsRadios2').click();
  33. $('#next-btn').click();
  34. }
  35. if (e.keyCode === 66) {//press the b key for blue box
  36. $('#optionsRadios3').click();
  37. $('#next-btn').click();
  38. }
  39. //Start, Continue to the Next, or Go Back
  40.  
  41. if (e.keyCode === 81) //press the q key to Start
  42. $('#start-btn').click();
  43. if (e.keyCode === 87) //press the w key for Back
  44. $('#prev-btn').click();
  45. if (e.keyCode === 69) //press the e key for Next
  46. $('#next-btn').click();
  47.  
  48. //Submit
  49. if (e.keyCode === 192) // press the grave accent key ` for Submit
  50. $('#submit-btn').click();
  51. }
  52. }