PICheat

Cheat that shows the test answers on pasja-informatyki.pl

当前为 2025-03-10 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         PICheat
// @namespace    http://tampermonkey.net/
// @version      1.1
// @description  Cheat that shows the test answers on pasja-informatyki.pl
// @author       nyxiereal
// @match        https://pasja-informatyki.pl/*/test/*
// @grant        none
// @license GPL-3.0
// ==/UserScript==

(function() {
    'use strict';

    // Extract the ans array from the HTML content
    const ansLine = document.body.innerHTML.match(/ans\[\d+\] = "[a-z]";/g);
    if (ansLine) {
        const ansArray = ansLine.map(item => item.match(/"([a-z])"/)[1]);

        // Create a container for the list
        const container = document.createElement('div');
        container.style.position = 'fixed';
        container.style.top = '50px';
        container.style.left = '0';
        container.style.width = '75px';
        container.style.backgroundColor = '#f8f9fa';
        container.style.zIndex = '1000';
        container.style.padding = '10px';
        container.style.boxShadow = '0 2px 4px rgba(0,0,0,0.1)';
        container.style.overflowY = 'auto';
        container.style.maxHeight = '90vh';

        // Create the list
        const list = document.createElement('ol');
        ansArray.forEach((item, index) => {
            const listItem = document.createElement('li');
            listItem.textContent = `${item}`;
            list.appendChild(listItem);
        });

        // Create the hide button
        const hideButton = document.createElement('button');
        hideButton.textContent = 'Hide';
        hideButton.style.padding = '5px 10px';
        hideButton.style.backgroundColor = '#007bff';
        hideButton.style.color = 'white';
        hideButton.style.border = 'none';
        hideButton.style.borderRadius = '3px';
        hideButton.style.cursor = 'pointer';
        hideButton.style.marginTop = '10px';

        // Append the list and button to the container
        container.appendChild(list);
        container.appendChild(hideButton);

        // Append the container to the body
        document.body.appendChild(container);

        // Add event listener to the hide button
        hideButton.addEventListener('click', () => {
            container.style.display = 'none';
        });
    }
})();