您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Selection hotkeys and auto-submit for Lili Dworkin's HIT 'Choose Subject of Homework Question'
- // ==UserScript==
- // @name 'Choose Subject of Homework Question'
- // @version 1.0
- // @description Selection hotkeys and auto-submit for Lili Dworkin's HIT 'Choose Subject of Homework Question'
- // @author TheFrostlixen
- // @include https://www.mturkcontent.com/dynamic/*
- // @match https://www.mturk.com/mturk/accept?*
- // @match https://www.mturk.com/mturk/previewandaccept?*
- // @grant none
- // @namespace https://greasyfork.org/en/users/34060
- // @require https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js
- // ==/UserScript==
- var submit = true;
- var $j = jQuery.noConflict(true);
- // verify HIT
- if ( $j('strong:homework question')) {
- // This HIT is a match for the script, so get it set up
- document.addEventListener( "keydown", key, false);
- $j("input[name='Q1Answer']").eq(5).click();
- $j("input[id='submitButton']").focus();
- }
- // Wait for keypress
- function key(i) {
- if (i.keyCode >= 97 && i.keyCode <= 103) { // numpad 1-7
- $j("input[name='Q1Answer']").eq(i.keyCode - 97).click();
- if (submit) {
- $j("input[id='submitButton']").click();
- }
- }
- if (i.keyCode == 13) { // enter
- console.log( $j("input[id='submitButton']") );
- $j("input[id='submitButton']").click();
- }
- }