Greasy Fork is available in English.

Cambridge One Helper Script

Melhorar a experiência de uso na plataforma Cambridge One

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

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

(I already have a user script manager, let me install it!)

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.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         Cambridge One Helper Script
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Melhorar a experiência de uso na plataforma Cambridge One
// @author       Você
// @match        https://www.cambridgeone.org/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // 1. Interceptar requisições para capturar dados (por exemplo, quizzes ou lições)
    const originalFetch = window.fetch;
    window.fetch = function() {
        return originalFetch.apply(this, arguments).then(response => {
            if (response.url.includes('/api')) {
                // Verifica se a requisição é relevante para o que você quer capturar
                response.clone().json().then(data => {
                    console.log('Dados capturados:', data);
                    // Manipular dados ou exibir na interface, se necessário
                });
            }
            return response;
        });
    };

    // 2. Adicionar um botão para acessar dicas ou respostas
    const helperButton = document.createElement('button');
    helperButton.innerText = 'Mostrar Respostas';
    helperButton.style.position = 'fixed';
    helperButton.style.left = '10px';
    helperButton.style.top = '10px';
    helperButton.style.zIndex = '1000';
    helperButton.onclick = () => {
        alert('As respostas dos quizzes vão aparecer aqui.');
        // Lógica para mostrar respostas extraídas de quizzes
    };
    document.body.appendChild(helperButton);

    // 3. Adicionar automaticamente respostas em quizzes ou tarefas
    const addAnswers = () => {
        const quizContainer = document.querySelector('.quiz-container'); // Exemplo de classe, ajuste conforme necessário
        if (quizContainer) {
            const answersDiv = document.createElement('div');
            answersDiv.innerHTML = '<h3>Respostas:</h3><p>Resposta 1, Resposta 2, etc.</p>';
            quizContainer.appendChild(answersDiv);
        }
    };

    // Executa o script após carregar a página
    window.onload = function() {
        addAnswers();
    };

})();