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

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

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name            autonomnom - VisionTurk - See the Images and Answer Multiple Choice Questions
// @author          mkrobert
// @namespace       mkrobert
// @include         *
// @version         0.01
// @grant           none
// @description:en  Select 
// @icon http://mturkgrind.com/data/avatars/l/8/8874.jpg?1445404860
// @require      https://code.jquery.com/jquery-2.1.4.min.js
// ==/UserScript==

if ($("h3:contains(See the Images and Answer Multiple Choice Questions)").length)
    runScript();

function runScript()
{
    $('#start-btn').focus(); //saves you from needing to click on the background at the start
    window.onkeydown = function(e)
    {
        //Press 1 through 4 for Red, Yellow or Green choices.
        if (e.keyCode === 82) {//press the r key for red box
            $('#optionsRadios0').click(); 
            $('#next-btn').click();
        }
        if (e.keyCode === 89) {//press the y key for yellow box
            $('#optionsRadios1').click();
            $('#next-btn').click();
        }
        if (e.keyCode === 71) {//press the g key for green box
            $('#optionsRadios2').click();
            $('#next-btn').click();
        }
        if (e.keyCode === 66) {//press the b key for blue box
            $('#optionsRadios3').click();
            $('#next-btn').click();
        }
        //Start, Continue to the Next, or Go Back

        if (e.keyCode === 81) //press the q key to Start 
            $('#start-btn').click();
        if (e.keyCode === 87) //press the w key for Back 
            $('#prev-btn').click();
        if (e.keyCode === 69) //press the e key for Next 
            $('#next-btn').click();

        //Submit
        if (e.keyCode === 192) // press the grave accent key ` for Submit
            $('#submit-btn').click();
    }
}