// ==UserScript==// @name Edgenuity Toolkit// @namespace// @versio - Pastebin.com (2024)

  1. // ==UserScript==

  2. // @name Edgenuity Toolkit

  3. // @namespace

  4. // @version 0.9

  5. // @description Makes edgenuity better.

  6. // @author Ryan

  7. // @match https://r10.core.learn.edgenuity.com/Player/

  8. // @grant all

  9. // ==/UserScript==

  10. //---------------| Settings |--------------------

  11. var autofillVocab = false; //Fill the vocabulary for you.

  12. var autoContinue = false; //Automatically move to the next slide or section.

  13. var continueOnComplete = false; //Continue when the currently playing video finishes rather than when available.

  14. var clickWhileTalking = false; //Enables the ability to click while the speaker is talking

  15. var autoAnswer = false; //Automatically hits submit button for assignments to get to the answer faster.

  16. var showInvisible = false; //Set all objects visible.

  17. var settingsMenuVisible = true; //Show the floating settings menu in edgenuity.

  18. //=================DELAYS========================

  19. var vocabDelay = 700;

  20. var autoContinueDelay = 1000;

  21. var clickWhileTalkingDelay = 700;

  22. var randomAnswersDelay = 1000;

  23. var showInvisibleDelay = 1000;

  24. var continueOnCompleteDelay= 1000;

  25. //================Button Colours=================

  26. var clrDisabled = "black";

  27. var clrEnabled = "orange";

  28. var clrHover = "purple";

  29. //-----------------------------------------------

  30. var vocabTimer, continueTimer, cwtTimer, randomAnswersTimer,

  31. showInvisibleTimer, continueOnCompleteTimer;

  32. var divSettings, divContainer;

  33. var btnHide, btnToggleVocab, btnToggleContinue, btnToggleCWT,

  34. btnAutoAnswer, btnShowInvis, btnTranscript, btnContinueOnComplete;

  35. var divSettingsHidden = false;

  36. function createSettingsMenu() {

  37. console.log("Creating settings");

  38. divSettings = document.createElement("div");

  39. divContainer = document.createElement("div");

  40. btnToggleVocab = document.createElement("button");

  41. btnToggleContinue = document.createElement("button");

  42. btnToggleCWT = document.createElement("button");

  43. btnAutoAnswer = document.createElement("button");

  44. btnShowInvisible = document.createElement("button");

  45. btnTranscript = document.createElement("button");

  46. btnContinueOnComplete = document.createElement("button");

  47. btnHide = document.createElement("button");

  48. var updateButtons = function() {

  49. btnHide.style.backgroundColor = divSettingsHidden ? clrEnabled : clrDisabled;

  50. btnHide.style.color = "white";

  51. btnHide.style.width = "100%";

  52. divSettings.style.opacity = divSettingsHidden ? "0.03" : "0.7";

  53. btnHide.innerHTML = divSettingsHidden ? "[+]" : "[-]";

  54. btnToggleVocab.style.backgroundColor = autofillVocab ? clrEnabled : clrDisabled;

  55. btnToggleVocab.innerHTML = "AutoVocab";

  56. btnToggleContinue.style.backgroundColor = autoContinue ? clrEnabled : clrDisabled;

  57. btnToggleContinue.innerHTML = "AutoContinue";

  58. btnToggleCWT.style.backgroundColor = clickWhileTalking ? clrEnabled : clrDisabled;

  59. btnToggleCWT.innerHTML = "Enable clicking";

  60. btnAutoAnswer.style.backgroundColor = autoAnswer ? clrEnabled : clrDisabled;

  61. btnAutoAnswer.innerHTML = "Auto Answer";

  62. btnShowInvisible.style.backgroundColor = showInvisible ? clrEnabled : clrDisabled;

  63. btnShowInvisible.innerHTML = "Show invisible";

  64. btnTranscript.style.backgroundColor = clrDisabled;

  65. btnTranscript.innerHTML = "Parse Transcript";

  66. btnContinueOnComplete.style.backgroundColor = continueOnComplete ? clrEnabled : clrDisabled;

  67. btnContinueOnComplete.innerHTML = "next when ready";

  68. };

  69. updateButtons();

  70. divSettings.style.backgroundColor = "white";

  71. divSettings.style.width = "120px";

  72. divSettings.style.height = "auto";

  73. divSettings.style.zIndex = "100";

  74. divSettings.style.position = "absolute";

  75. divSettings.style.top = "50px";

  76. divSettings.style.left = "50%";

  77. divSettings.style.paddingTop = "15px";

  78. $(divSettings).draggable();

  79. btnHide.addEventListener("click", function() {

  80. if ( divSettingsHidden ) {

  81. divContainer.style.display = "block";

  82. divSettingsHidden = false;

  83. } else {

  84. divContainer.style.display = "none";

  85. divSettingsHidden = true;

  86. }

  87. updateButtons();

  88. });

  89. btnToggleVocab.addEventListener("click", function() {

  90. if ( autofillVocab ) {

  91. autofillVocab = false;

  92. clearInterval(vocabTimer);

  93. } else {

  94. autofillVocab = true;

  95. clearInterval(vocabTimer);

  96. vocabLoop();

  97. }

  98. updateButtons();

  99. });

  100. btnToggleContinue.addEventListener("click", function() {

  101. if ( autoContinue ) {

  102. autoContinue = false;

  103. clearInterval(continueTimer);

  104. } else {

  105. autoContinue = true;

  106. continueTimer = setInterval(goNext, autoContinueDelay);

  107. }

  108. updateButtons();

  109. });

  110. btnContinueOnComplete.addEventListener("click", function() {

  111. if ( continueOnComplete ) {

  112. continueOnComplete = false;

  113. clearInterval(continueOnCompleteTimer);

  114. } else {

  115. continueOnComplete = true;

  116. continueOnCompleteTimer = setInterval(continueWhenReady, continueOnCompleteDelay);

  117. }

  118. });

  119. btnToggleCWT.addEventListener("click", function() {

  120. if ( clickWhileTalking ) {

  121. clearInterval(cwtTimer);

  122. clickWhileTalking = false;

  123. } else {

  124. clickWhileTalking = true;

  125. cwtTimer = setInterval(enableClicking, clickWhileTalkingDelay);

  126. }

  127. updateButtons();

  128. });

  129. btnAutoAnswer.addEventListener("click", function() {

  130. if ( autoAnswer ) {

  131. autoAnswer = false;

  132. clearInterval(randomAnswersTimer);

  133. } else {

  134. autoAnswer = true;

  135. randomAnswersTimer = setInterval(setAnswers, randomAnswersDelay);

  136. }

  137. updateButtons();

  138. });

  139. btnShowInvisible.addEventListener("click", function() {

  140. if ( showInvisible ) {

  141. showInvisible = false;

  142. clearInterval(showInvisibleTimer);

  143. hideInvisibleItems();

  144. } else {

  145. showInvisible = true;

  146. showInvisibleTimer = setInterval(showInvisibleItems, showInvisibleDelay);

  147. }

  148. updateButtons();

  149. });

  150. btnTranscript.addEventListener("click", function() {

  151. var textContent = parseTranscript();

  152. if ( textContent !== "" ) {

  153. var div = $(document.createElement('div'))

  154. .css("max-width", "700px")

  155. .css("height", "auto")

  156. .css("position", "absolute")

  157. .css("top", $(divSettings).position().top+100+"px")

  158. .css("left", $(divSettings).position().left+100+"px")

  159. .css("z-index", "1000")

  160. .css("background-color", "black")

  161. .css("padding", "20px")

  162. .append(

  163. $(document.createElement('button'))

  164. .html("close")

  165. .on("click", function() {

  166. div.remove();

  167. })

  168. )

  169. .draggable();

  170. var textArea = $(document.createElement("textarea"))

  171. .css("height", "200px")

  172. .css("width", "100%")

  173. .css("resize", "both")

  174. .val(textContent)

  175. .on("click", function() {

  176. $(this).select();

  177. });

  178. div.append(textArea);

  179. $(document.body).append(div);

  180. }

  181. });

  182. divContainer.appendChild(btnToggleVocab);

  183. divContainer.appendChild(btnToggleContinue);

  184. divContainer.appendChild(btnContinueOnComplete);

  185. divContainer.appendChild(btnToggleCWT);

  186. divContainer.appendChild(btnAutoAnswer);

  187. divContainer.appendChild(btnShowInvisible);

  188. divContainer.appendChild(btnTranscript);

  189. //Transitioned to using jquery here

  190. $(divContainer).append(

  191. $(document.createElement('button')).

  192. html("Paint it black")

  193. .css("background-color", clrDisabled)

  194. .on("click", function() {

  195. $("*").not($(divSettings))

  196. .css("background-color", "black")

  197. .css("color", "white");

  198. })

  199. );

  200. $(divContainer).append(

  201. $(document.createElement('button')).

  202. html("Notepad")

  203. .css("background-color", clrDisabled)

  204. .on("click", function() {

  205. var div = $(document.createElement('div'))

  206. .css("width", "auto")

  207. .css("height", "auto")

  208. .css("position", "absolute")

  209. .css("top", $(divSettings).position().top+100+"px")

  210. .css("left", $(divSettings).position().left+100+"px")

  211. .css("z-index", "1000")

  212. .css("background-color", "black")

  213. .css("padding", "20px")

  214. .append(

  215. $(document.createElement('button'))

  216. .html("close")

  217. .css("display", "block")

  218. .on("click", function() {

  219. div.remove();

  220. })

  221. )

  222. .draggable();

  223. var textArea = $(document.createElement("textarea"))

  224. .css("min-height", "30px")

  225. .css("resize", "both")

  226. .css("display", "block");

  227. div.append(textArea);

  228. $(document.body).append(div);

  229. })

  230. );

  231. for ( var i=0; i < divContainer.childNodes.length; i++) {

  232. var n = divContainer.childNodes[i];

  233. n.style.width = "100%";

  234. n.style.fontSize = "13px";

  235. n.style.border = "none";

  236. n.style.borderRadius = "1px";

  237. n.style.color = "white";

  238. $(n).hover(function() {

  239. $(this).css("background-color", clrHover)

  240. .css("color", "white");

  241. }, function() {

  242. $(this).css("background-color", clrDisabled);

  243. updateButtons();

  244. });

  245. }

  246. divSettings.appendChild(btnHide);

  247. divSettings.appendChild(divContainer);

  248. document.body.appendChild(divSettings);

  249. }

  250. function vocabLoop() {

  251. try {

  252. vocabTimer = setInterval(scanVocab, vocabDelay);

  253. } catch (err) {

  254. console.log(err);

  255. }

  256. }

  257. function scanVocab() {

  258. var stage = document.getElementById("stageFrame");

  259. var frame;

  260. if ( stage ) {

  261. frame = stage.contentWindow.document;

  262. } else {

  263. return;

  264. }

  265. var vocabButton = stage.contentWindow.document.getElementsByClassName("plainbtn alt selected")[0];

  266. if ( vocabButton ) {

  267. var vocabInput = frame.getElementsByClassName("word-textbox word-normal")[0];

  268. if ( vocabInput ) {

  269. vocabInput.value = vocabButton.innerHTML;

  270. var playbutton = frame.getElementsByClassName("playbutton vocab-play")[0];

  271. if ( playbutton ) {

  272. playbutton.click();

  273. }

  274. var nextButton = frame.getElementsByClassName("uibtn-arrow-next")[0];

  275. if ( nextButton ) {

  276. nextButton.click();

  277. }

  278. }

  279. }

  280. }

  281. function continueWhenReady() {

  282. var frame = document.getElementById("stageFrame");

  283. if ( frame ) {

  284. frame = frame.contentWindow.document;

  285. var currentTime = document.getElementsByClassName("uid1_time")[0];

  286. if ( currentTime ) {

  287. currentTime = currentTime.innerHTML.split(" / ");

  288. if ((currentTime[0] && currentTime[1]) && currentTime[0] == currentTime[1]) {

  289. goNext();

  290. }

  291. }

  292. }

  293. }

  294. function goNext() {

  295. var footnavRight = document.getElementsByClassName("footnav goRight")[0];

  296. if ( footnavRight ) {

  297. footnavRight.click();

  298. }

  299. var frame = document.getElementById("stageFrame");

  300. if ( frame ) {

  301. frame = frame.contentWindow.document;

  302. var goRight = frame.getElementsByClassName("FrameRight")[0];

  303. if ( goRight ) {

  304. var b = goRight.firstChild;

  305. if ( b ) {

  306. b.click();

  307. }

  308. }

  309. }

  310. }

  311. function enableClicking() {

  312. var frame = document.getElementById("stageFrame");

  313. if ( frame ) {

  314. var invisodiv = frame.contentWindow.document.getElementById("invis-o-div");

  315. if ( invisodiv ) {

  316. //invisodiv.style.backgroundColor = "#00ff00";

  317. //invisodiv.style.opacity = "0.3";

  318. //invisodiv.style.pointerEvents = "none";

  319. invisodiv.parentNode.removeChild(invisodiv);

  320. }

  321. var submitBlocker = frame.contentWindow.document.getElementById("submitBlocker");

  322. if ( submitBlocker ) {

  323. submitBlocker.parentNode.removeChild(submitBlocker);

  324. }

  325. var submitLoading = frame.contentWindow.document.getElementById("submitLoading");

  326. if ( submitLoading ) {

  327. submitLoading.parentNode.removeChild(submitLoading);

  328. }

  329. }

  330. }

  331. function setAnswers() {

  332. var frame = document.getElementById("stageFrame");

  333. if ( frame ) {

  334. frame = frame.contentWindow.document;

  335. var preview = frame.getElementById("iFramePreview");

  336. if ( preview ) {

  337. preview = preview.contentWindow.document;

  338. var buttons = preview.getElementsByClassName("answer-choice-button");

  339. for( var i=0; i < buttons.length; i++ ) {

  340. buttons[i].checked = true;

  341. }

  342. var submit = frame.getElementById("btnCheck");

  343. if ( submit ) {

  344. submit.click();

  345. console.log(submit);

  346. }

  347. }

  348. }

  349. }

  350. function showInvisibleItems() {

  351. var frame = document.getElementById("stageFrame");

  352. if ( frame ) {

  353. frame = frame.contentWindow.document;

  354. $(frame.body).find("*:hidden").not(".uibtn")

  355. .show()

  356. .addClass("sethidden");

  357. }

  358. }

  359. function hideInvisibleItems() {

  360. var frame = document.getElementById("stageFrame");

  361. if ( frame ) {

  362. frame = frame.contentWindow.document;

  363. $(frame.body).find(".sethidden").hide();

  364. }

  365. }

  366. function parseTranscript() {

  367. var transcripts = document.getElementsByClassName("transcript-text");

  368. var total = "";

  369. for ( var i=0; i < transcripts.length; i++ ) {

  370. total += transcripts[i].innerHTML.trim()

  371. .replace(/( )+/g, " ")

  372. .replace("TEACHER: ", "\n\nTEACHER:\n") +

  373. " ";

  374. }

  375. return total;

  376. }

  377. (function() {

  378. 'use strict';

  379. //Generate Settings Menu

  380. if ( settingsMenuVisible ) {

  381. createSettingsMenu();

  382. }

  383. //VOCAB

  384. if ( autofillVocab ) {

  385. vocabLoop();

  386. }

  387. //autocontinue

  388. if ( autoContinue ) {

  389. continueTimer = setInterval(goNext, autoContinueDelay);

  390. }

  391. //click while talking

  392. if ( clickWhileTalking ) {

  393. cwtTimer = setInterval(enableClicking, clickWhileTalkingDelay);

  394. }

  395. //autoAnswer

  396. if ( autoAnswer ) {

  397. randomAnswersTimer = setInterval(setAnswers, randomAnswersDelay);

  398. }

  399. //show Invisible

  400. if ( showInvisible ) {

  401. showInvisibleTimer = setInterval(showInvisibleItems, showInvisibleDelay);

  402. }

  403. })();

// ==UserScript==// @name         Edgenuity Toolkit// @namespace// @versio - Pastebin.com (2024)

References

Top Articles
Latest Posts
Article information

Author: Aron Pacocha

Last Updated:

Views: 6565

Rating: 4.8 / 5 (68 voted)

Reviews: 91% of readers found this page helpful

Author information

Name: Aron Pacocha

Birthday: 1999-08-12

Address: 3808 Moen Corner, Gorczanyport, FL 67364-2074

Phone: +393457723392

Job: Retail Consultant

Hobby: Jewelry making, Cooking, Gaming, Reading, Juggling, Cabaret, Origami

Introduction: My name is Aron Pacocha, I am a happy, tasty, innocent, proud, talented, courageous, magnificent person who loves writing and wants to share my knowledge and understanding with you.