Century Tech Auto Answer

Auto answer questions on Century Tech

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

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

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

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

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==UserScript==
// @name         Century Tech Auto Answer
// @namespace    http://tampermonkey.net/
// @version      0.2
// @description  Auto answer questions on Century Tech
// @author       You
// @match        https://app.century.tech/*
// @grant        none
// @license      MIT; https://opensource.org/licenses/MIT
// ==/UserScript==

(function() {
    'use strict';
    
    // Function to auto-answer questions
    function autoAnswer() {
        var questions = document.querySelectorAll('.question');
        
        questions.forEach(function(question) {
            // Try to find the correct answer
            var correctAnswer = question.querySelector('.correct-answer');
            if (correctAnswer) {
                // If a correct answer is found, select it
                var answerInput = correctAnswer.previousElementSibling; // Assuming the input is before the label
                if (answerInput && answerInput.type === 'radio') {
                    answerInput.checked = true;
                    answerInput.labels[0].click(); // Simulate the click on the label
                }
            } else {
                // If no correct answer is found, select the first available answer
                var firstAnswerInput = question.querySelector('input[type="radio"]');
                if (firstAnswerInput) {
                    firstAnswerInput.checked = true;
                    firstAnswerInput.labels[0].click(); // Simulate the click on the label
                }
            }
        });

        // Submit answers
        var submitButton = document.querySelector('.submit-button');
        if (submitButton) {
            submitButton.click();
        }
    }

    // Run the auto-answer function
    autoAnswer();
})();