// ==UserScript==
// @name Google Forms Helper
// @namespace https://github.com
// @version 0.1
// @description Aids to solve google forms
// @author erucix
// @match https://docs.google.com/forms/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=google.com
// @grant none
// @license MIT
// @downloadURL none
// ==/UserScript==
(function() {
'use strict';
const searchURL = "https://google.com/search?q=";
const container = document.querySelectorAll(".geS5n");
container.forEach((element, index) => {
let questionContainer = element.querySelector(".z12JJ");
let answersContainer = element.querySelectorAll(".nWQGrd");
let options = "";
let question = questionContainer.textContent;
answersContainer.forEach((points) => {
options += points.textContent + " \n";
});
let spanElement = document.createElement("span");
spanElement.innerHTML = `
SEARCH
COPY
`;
questionContainer.appendChild(spanElement);
let copyButton = questionContainer.querySelector(".copyText");
copyButton.addEventListener("click", function () {
navigator.clipboard.writeText(question + "\n" + options);
copyButton.innerText = "Copied";
setTimeout(function(){
copyButton.innerText = "Copy";
},5000);
});
let anotherSpan = document.createElement("span");
anotherSpan.innerHTML += `
GoogleAI Answer:
Waiting for answer...