Quizlet 'Learn' Mode Global Input Stopper

Disable page click from going to the next question without permission. Additionally, "Enter" key will submit answers, and "space" will override incorrect answers. Only accept 'enter', 'space' keys and 'click' events.

이 스크립트를 설치하려면 Tampermonkey, Greasemonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

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

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Userscripts와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 유저 스크립트 관리자 확장 프로그램이 필요합니다.

(이미 유저 스크립트 관리자가 설치되어 있습니다. 설치를 진행합니다!)

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

(이미 유저 스타일 관리자가 설치되어 있습니다. 설치를 진행합니다!)

// ==UserScript==
// @name        Quizlet 'Learn' Mode Global Input Stopper
// @description Disable page click from going to the next question without permission. Additionally, "Enter" key will submit answers, and "space" will override incorrect answers. Only accept 'enter', 'space' keys and 'click' events.
// @author      Kai Krause <[email protected]>
// @match       http://quizlet.com/*/write*
// @match       https://quizlet.com/*/write*
// @version     1.3.4
// @grant       none
// @namespace QZLT_LearnKBMode
// ==/UserScript==

window.addEventListener('load', function() {
	Element.NativeEvents={click:2,dblclick:0,mouseup:0,mousedown:0,contextmenu:0,mousewheel:0,DOMMouseScroll:0,mouseover:0,mouseout:0,mousemove:0,selectstart:1,selectend:0,keydown:0,keypress:0,keyup:0,input:0,orientationchange:2,touchstart:2,touchmove:2,touchend:2,touchcancel:2,gesturestart:2,gesturechange:2,gestureend:2,focus:2,blur:2,change:2,reset:2,select:2,submit:2,paste:2,oninput:2,load:2,unload:1,beforeunload:2,resize:1,move:1,DOMContentLoaded:1,readystatechange:1,error:1,abort:1,scroll:1};

	window.addEventListener("keydown", enter, true);
	
	function enter(charE) {
		var answerBtn = document.getElementById("js-learnModeAnswerButton");
		var checkBtn = document.getElementsByClassName("LearnModeMain-anyKey");
		var overrideBtn = document.getElementsByClassName("LearnModeGradeAnswerView-overrideLink");
		if (charE.keyCode == "13") {
			if (answerBtn){
				answerBtn.click();
			} else if (checkBtn) {
				checkBtn[0].click();
			}
		}
		if (charE.keyCode == "32") {
			if (overrideBtn){
				overrideBtn[0].click();
			}
		}
	}
}, false);