Sleazy Fork is available in English.

prawojazdy360.pl

Script that adds keyboard shortcuts to the prawojazdy360.pl 'kurs' section.

As of 18/07/2019. See the latest version.

// ==UserScript==
// @name         prawojazdy360.pl
// @namespace    http://tampermonkey.net/
// @version      0.4
// @description  Script that adds keyboard shortcuts to the prawojazdy360.pl 'kurs' section.
// @author       Borowy Alan
// @match        *://www.prawo-jazdy-360.pl/kurs*
// @match        *://www.prawo-jazdy-360.pl/test*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    const video = document.getElementById('media-video')
    const yesButton = document.getElementById('Answers-0')
    const noButton = document.getElementById('Answers-1')
    const nextQuestionButton = document.getElementById('btn-next')
        ? document.getElementById('btn-next')
        : document.getElementsByClassName('btn-next')[1]
    const firstAnswer = document.getElementById('Answers-0')
    const secondAnswer = document.getElementById('Answers-1')
    const thirdAnswer = document.getElementById('Answers-2')

    document.onkeyup = function(e) {
        if (e.code == 'KeyP') {
            video.focus()
            video.play()
        } else if (e.code == 'KeyT') {
            yesButton.click()
            saveAnswer()
        } else if (e.code == 'KeyN') {
            noButton.click()
            saveAnswer()
        } else if (e.code == 'Enter') {
            nextQuestionButton.click()
        } else if (e.code =='KeyA' || e.code == 'Digit1' || e.code == 'Digit8') {
            firstAnswer.click()
            saveAnswer()
        }
        else if (e.code =='KeyB' || e.code == 'Digit2' || e.code == 'Digit9') {
            secondAnswer.click()
            saveAnswer()
        }
        else if (e.code =='KeyC' || e.code == 'Digit3' || e.code == 'Digit0') {
            thirdAnswer.click()
            saveAnswer()
        }
    };
})();