Greasy Fork is available in English.

Google Forms Breakout Cheat!

For teachers who put students through Google Forms "Breakout Rooms".

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Google Forms Breakout Cheat!
// @description  For teachers who put students through Google Forms "Breakout Rooms".
// @icon         https://i.imgur.com/ORAaPzD.png
// @version      1

// @author       VillainsRule
// @namespace    https://villainsrule.xyz

// @match        https://docs.google.com/forms/*
// @run-at       document-start
// @grant        none
// ==/UserScript==

window.addEventListener('load', () => {
    const allFormSections = FB_PUBLIC_LOAD_DATA_.find(e => Array.isArray(e)).find(e => Array.isArray(e));
    const domSections = document.querySelectorAll('[data-params]');

    domSections.forEach((element) => {
        const sectId = element.getAttribute('data-params').match(/\[([0-9]+),/)
        const sect = allFormSections.find(i => i[0] === Number(sectId[1]));

        const possibleAnswers = sect[4]?. /* validation */ [0]?. /* first validator */ [4]?. /* i think 4 = valid idek */ [0]?. /* i dislike gf */ [2] /* the possible answers */;
        if (possibleAnswers) {
            const descElement = element.querySelector('div[role="heading"]')?.parentElement?.children[1];
            const prefix = descElement.innerText.length > 0 ? '\n\n' : '';
            if (descElement) descElement.textContent = prefix + `possible answers: ${possibleAnswers.map(e => `"${e}"`).join(',')}`;
        }
    });
});