From 9686ccabc346a9ea57f4a6feac05c495d4793860 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20S=C3=A4ume?= Date: Thu, 23 May 2024 19:48:43 +0200 Subject: [PATCH] Cleanup --- README.md | 21 +++++++++++++-------- src/main.user.js | 4 +--- types/Answer.d.js | 5 ++--- types/GM_xmlhttpRequest.d.js | 17 ++++++++--------- 4 files changed, 24 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index af857e5..000891c 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,24 @@ -# CCNA Autofill Userscript +# CCNA Autofill UserScript -A Userscript for autofilling the Answers on the **CCNA**. +A UserScript for autofilling the Answers on the **CCNA**. inspired by [Merlinfuchs/ccna-extension](https://github.com/merlinfuchs/ccna-extension). +## Project Status +This UserScript is only tested with [ViolentMonkey](https://violentmonkey.github.io/) on the **CCNAv7**. + +## Requirements +Use a Userscript Client/Manager like [Violentmonkey](https://violentmonkey.github.io/) or [Tampermonkey](https://www.tampermonkey.net/). + +> **Info:** *[Violentmonkey](https://violentmonkey.github.io/) is highly recommended*. + ## Installation -Use a userscript client like [ViolentMonkey](https://violentmonkey.github.io/), [Tampermonkey](https://www.tampermonkey.net/). +> **Info:** *If you **just** installed your UserScript Client/Manager, reload this page, to enable the manager itselfe, for the install button to work* -[![Install USerscript](https://img.shields.io/badge/Install_Userscript-Install_Userscript?style=for-the-badge&logo=tampermonkey&logoColor=brown&color=lightgray)](https://git.euph.dev/SZUT-Dominik/CCNA_Autofill_Userscript/raw/branch/main/src/main.user.js) +[![Install USerscript](https://img.shields.io/badge/Install_Userscript-Install_Userscript?style=for-the-badge&logo=greasyfork&logoColor=black&color=brown)](https://git.euph.dev/SZUT-Dominik/CCNA_Autofill_Userscript/raw/branch/main/src/main.user.js) -## Status - -This Userscript is only tested with [ViolentMonkey](https://violentmonkey.github.io/) on the **CCNAv7**. ## Usage - +This only works directly on the exam website. - **p**: Paste your answer-URL from [ItexamAnswers](https://itexamanswers.net) for the **CCNAv7** use [these](https://itexamanswers.net/ccna-1-v7-modules-1-3-basic-network-connectivity-and-communications-exam-answers.html). - **a**: Try autofilling the current answer. There won't be any visual feedback when it fails. - **n**: Go to the next Question. \ No newline at end of file diff --git a/src/main.user.js b/src/main.user.js index 32dbf22..ac4c3ae 100644 --- a/src/main.user.js +++ b/src/main.user.js @@ -1,10 +1,8 @@ // ==UserScript== // @name CCNA Autofill -// @namespace Violentmonkey Scripts +// @namespace https://git.euph.dev/Snoweuph // @match *://assessment.netacad.net/* // @match *://www.assessment.netacad.net/* -// @match *://www.google.com/* -// @match *://www.google.de/* // @require https://git.euph.dev/SZUT-Dominik/CCNA_Autofill_Userscript/raw/branch/main/src/fetch.js // @require https://git.euph.dev/SZUT-Dominik/CCNA_Autofill_Userscript/raw/branch/main/src/answer.js // @grant GM_setValue diff --git a/types/Answer.d.js b/types/Answer.d.js index d6d11c0..ac3db36 100644 --- a/types/Answer.d.js +++ b/types/Answer.d.js @@ -1,6 +1,5 @@ /** - * Object representing a question with answers. * @typedef {Object} Answer - * @property {string} question - The question. - * @property {Array} answers - An array of answers. + * @property {string} question + * @property {Array} answers */ diff --git a/types/GM_xmlhttpRequest.d.js b/types/GM_xmlhttpRequest.d.js index b2382da..9d09b8f 100644 --- a/types/GM_xmlhttpRequest.d.js +++ b/types/GM_xmlhttpRequest.d.js @@ -1,14 +1,13 @@ /** - * Makes an HTTP request using GM.xmlHttpRequest. - * @param {Object} details - Details of the HTTP request. - * @param {string} details.method - The HTTP request method (e.g., 'GET', 'POST'). - * @param {string} details.url - The URL to send the request to. - * @param {Object} [details.headers] - Additional headers to include in the request. - * @param {function(GMXMLHttpRequestResponse):void} [details.onload] - Optional. Will be called when the request has completed successfully. Passed one argument, the Response Object. - * @param {Function} [details.onerror] - Optional. Will be called if an error occurs while processing the request. Passed one argument, the Response Object. - * @returns {undefined} + * @param {Object} request + * @param {string} request.method + * @param {string} request.url + * @param {Object} [request.headers] + * @param {function(GMXMLHttpRequestResponse):void} [request.onload] + * @param {Function} [request.onerror] + * @returns {void} */ -function GM_xmlhttpRequest(details) {} +function GM_xmlhttpRequest(request) {} /** * Response object for the HTTP request.