MTurk A9 Category Validation-Windows

Assists with Category Validation HITs--modified from @tubedogg's script to be friendly with Windows

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name        MTurk A9 Category Validation-Windows
// @namespace   starvingstatic
// @description Assists with Category Validation HITs--modified from @tubedogg's script to be friendly with Windows
// @include     https://www.mturkcontent.com/dynamic/hit*
// @version     1.0
// @require     https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js
// @grant       none
// ==/UserScript==

/*
 Auto-selects "only one"
 - Ctrl + Shift for "no" (i.e. 0) objects in image
 - Ctrl + C for "more than 1" objects in image
 - Ctrl + Z for "only one" object in image
 - Ctrl + X for "is blocked or partially out of image"
 - Ctrl + V for "I'm not sure"
 - Ctrl + Alt for Submit
*/

$(document).ready(function() {
	if ($(":contains('If you don\'t know what a')").length) {
		$("input[value='Valid_Object']").prop('checked', true).click();
		$(document).keydown(function(event) {
			if (event.which == 16 && event.ctrlKey) {
				$("input[value='Missing_Object']").prop('checked', true).click();
			} else if (event.which == 90 && event.ctrlKey) {
				$("input[value='Valid_Object']").prop('checked', true).click();
			} else if (event.which == 86 && event.ctrlKey) {
				$("input[value='Cannot_See_Unsure']").prop('checked', true).click();
			} else if (event.which == 67 && event.ctrlKey) {
				$("input[value='Multiple_Objects']").prop('checked', true).click();
			} else if ((event.which == 88 || event.which == 80) && event.ctrlKey) {
				$("input[value='Partial_Object']").prop('checked', true);
			} else if (event.which == 18 && event.ctrlKey) {
				$("#submitButton").click();
			}
		});
	}
});