OneClick Tools - McGraw-Hill

Copy/Google with a single click on all McGraw-Hill quiz questions of your course.

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 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         OneClick Tools - McGraw-Hill
// @namespace    https://greasyfork.org/en/users/670188-hacker09?sort=daily_installs
// @version      4
// @description  Copy/Google with a single click on all McGraw-Hill quiz questions of your course.
// @author       hacker09
// @match        https://ezto.mheducation.com/ext/map/index.html*
// @icon         https://t3.gstatic.com/faviconV2?client=SOCIAL&type=FAVICON&fallback_opts=TYPE,SIZE,URL&url=https://ezto.mheducation.com&size=64
// @run-at       document-end
// @grant        none
// ==/UserScript==

setInterval(() => {
  (function() {
    'use strict';
    document.querySelector("#question-info-holder")?.remove();
    document.querySelector(".Win32").style.cursor = "pointer"; //Change cursor style to pointer
    document.querySelector(".Win32").addEventListener('mouseup', function(event) { //When the mouse is clicked
      event.preventDefault(); //Prevent the default context menu from being opened
      if (event.button === 0) { //If the user single click anywhere on the question/answer
        navigator.clipboard.writeText(document.querySelector(".Win32").innerText.replaceAll(/\n|\s+|%media:case.jpg%|Required information|Skip to question|View the animation below, then complete the quiz to test your knowledge of the concept./gm, ' ')); //Copy the text and question
      } else if (event.button === 2) { //If the user right click anywhere on the question/answer
        navigator.clipboard.writeText(document.querySelector(".Win32").querySelector(".question, .worksheet__main > p")?.innerText); //Copy the question
        open('https://www.google.com/search?q=' + encodeURIComponent(document.querySelector(".Win32").innerText.replaceAll(/\n|\s+|%media:case.jpg%|Required information|Skip to question|View the animation below, then complete the quiz to test your knowledge of the concept./gm, ' '))); //Google the question and answer
      } //Finishes the else condition
    }); //Finishes the mouseup event listener
  })()
}, 1000);