Kahoot cheats MOD MENU

Hey guys this is an update old update mod menu for kahoot enter the quiz I'd NOT GAME PIN what should I make next?

  1. // ==UserScript==
  2. // @name Kahoot cheats MOD MENU
  3. // @version 1.0.42
  4. // @namespace https://github.com
  5. // @description Hey guys this is an update old update mod menu for kahoot enter the quiz I'd NOT GAME PIN what should I make next?
  6. // @license MIT Thatoneguy54321
  7. // @author Thatoneguy54321
  8. // @match https://kahoot.it/*
  9. // @icon https://www.google.com/s2/favicons?sz=64&domain=kahoot.it
  10. // @grant none
  11. // ==/UserScript==
  12. var Version = '1.0.29'
  13.  
  14. var questions = [];
  15. var info = {
  16. numQuestions: 0,
  17. questionNum: -1,
  18. lastAnsweredQuestion: -1,
  19. defaultIL:true,
  20. ILSetQuestion:-1,
  21. };
  22. var PPT = 950;
  23. var Answered_PPT = 950;
  24. var autoAnswer = false;
  25. var showAnswers = false;
  26. var inputLag = 100;
  27.  
  28. function FindByAttributeValue(attribute, value, element_type) {
  29. element_type = element_type || "*";
  30. var All = document.getElementsByTagName(element_type);
  31. for (var i = 0; i < All.length; i++) {
  32. if (All[i].getAttribute(attribute) == value) { return All[i]; }
  33. }
  34. }
  35.  
  36. const uiElement = document.createElement('div');
  37. uiElement.className = 'floating-ui';
  38. uiElement.style.position = 'absolute';
  39. uiElement.style.top = '5%';
  40. uiElement.style.left = '5%';
  41. uiElement.style.width = '33vw';
  42. uiElement.style.height = 'auto';
  43. uiElement.style.backgroundColor = '#149983';
  44. uiElement.style.borderRadius = '1vw';
  45. uiElement.style.boxShadow = '0px 0px 10px 0px rgba(0, 0, 0, 0.5)';
  46. uiElement.style.zIndex = '9999';
  47.  
  48. const handle = document.createElement('div');
  49. handle.className = 'handle';
  50. handle.style.fontFamily = '"Montserrat", "Noto Sans Arabic", "Helvetica Neue", Helvetica, Arial, sans-serif;';
  51. handle.style.fontSize = '1.5vw';
  52. handle.textContent = 'Kahoot!';
  53. handle.style.color = 'white';
  54. handle.style.width = '97.5%';
  55. handle.style.height = '2.5vw';
  56. handle.style.backgroundColor = '#321066';
  57. handle.style.borderRadius = '1vw 1vw 0 0';
  58. handle.style.cursor = 'grab';
  59. handle.style.textAlign = 'left';
  60. handle.style.paddingLeft = '2.5%';
  61. handle.style.lineHeight = '2vw';
  62. uiElement.appendChild(handle);
  63.  
  64. const closeButton = document.createElement('div');
  65. closeButton.className = 'close-button';
  66. closeButton.textContent = '✕';
  67. closeButton.style.position = 'absolute';
  68. closeButton.style.top = '0';
  69. closeButton.style.right = '0';
  70. closeButton.style.width = '12.5%';
  71. closeButton.style.height = '2.5vw';
  72. closeButton.style.backgroundColor = 'red';
  73. closeButton.style.color = 'white';
  74. closeButton.style.borderRadius = '0 1vw 0 0';
  75. closeButton.style.display = 'flex';
  76. closeButton.style.justifyContent = 'center';
  77. closeButton.style.alignItems = 'center';
  78. closeButton.style.cursor = 'pointer';
  79. handle.appendChild(closeButton);
  80.  
  81. const minimizeButton = document.createElement('div');
  82. minimizeButton.className = 'minimize-button';
  83. minimizeButton.textContent = '─';
  84. minimizeButton.style.color = 'white';
  85. minimizeButton.style.position = 'absolute';
  86. minimizeButton.style.top = '0';
  87. minimizeButton.style.right = '12.5%';
  88. minimizeButton.style.width = '12.5%';
  89. minimizeButton.style.height = '2.5vw';
  90. minimizeButton.style.backgroundColor = 'gray';
  91. minimizeButton.style.borderRadius = '0 0 0 0';
  92. minimizeButton.style.display = 'flex';
  93. minimizeButton.style.justifyContent = 'center';
  94. minimizeButton.style.alignItems = 'center';
  95. minimizeButton.style.cursor = 'pointer';
  96. handle.appendChild(minimizeButton);
  97.  
  98. const header = document.createElement('h2');
  99. header.textContent = 'QUIZ ID NOT PIN';
  100. header.style.display = 'block';
  101. header.style.margin = '1vw';
  102. header.style.textAlign = 'center';
  103. header.style.fontFamily = '"Montserrat", "Noto Sans Arabic", "Helvetica Neue", Helvetica, Arial, sans-serif;';
  104. header.style.fontSize = '2vw';
  105. header.style.color = 'white';
  106. header.style.textShadow = `
  107. -1px -1px 0 rgb(47, 47, 47),
  108. 1px -1px 0 rgb(47, 47, 47),
  109. -1px 1px 0 rgb(47, 47, 47),
  110. 1px 1px 0 rgb(47, 47, 47)
  111. `;
  112.  
  113. uiElement.appendChild(header);
  114.  
  115. const inputContainer = document.createElement('div');
  116. inputContainer.style.display = 'flex';
  117. inputContainer.style.justifyContent = 'center';
  118.  
  119. const inputBox = document.createElement('input');
  120. inputBox.type = 'text';
  121. inputBox.style.color = 'black';
  122. inputBox.placeholder = 'Put the quiz id here from the host search bar';
  123. inputBox.style.width = '27.8vw';
  124. inputBox.style.height = '1.5vw';
  125. inputBox.style.margin = '0vw';
  126. inputBox.style.padding = '0vw';
  127. inputBox.style.padding = '0';
  128. inputBox.style.border = '.1vw solid black';
  129. inputBox.style.borderRadius = '1vw';
  130. inputBox.style.outline = 'none';
  131. inputBox.style.textAlign = 'center';
  132. inputBox.style.fontSize = '1.15vw';
  133.  
  134.  
  135. inputContainer.appendChild(inputBox);
  136. uiElement.appendChild(inputContainer);
  137.  
  138. const header2 = document.createElement('h2');
  139. header2.textContent = 'POINTS PER QUESTION';
  140. header2.style.display = 'block';
  141. header2.style.margin = '1vw';
  142. header2.style.textAlign = 'center';
  143. header2.style.fontFamily = '"Montserrat", "Noto Sans Arabic", "Helvetica Neue", Helvetica, Arial, sans-serif;';
  144. header2.style.fontSize = '2vw';
  145. header2.style.color = 'white';
  146. header2.style.textShadow = `
  147. -1px -1px 0 rgb(47, 47, 47),
  148. 1px -1px 0 rgb(47, 47, 47),
  149. -1px 1px 0 rgb(47, 47, 47),
  150. 1px 1px 0 rgb(47, 47, 47)
  151. `;
  152.  
  153. uiElement.appendChild(header2);
  154.  
  155. const sliderContainer = document.createElement('div');
  156. sliderContainer.style.width = '80%';
  157. sliderContainer.style.margin = '1vw auto';
  158. sliderContainer.style.display = 'flex';
  159. sliderContainer.style.alignItems = 'center';
  160. sliderContainer.style.justifyContent = 'center';
  161.  
  162. const pointsLabel = document.createElement('span');
  163. pointsLabel.textContent = 'Points per Question: 950';
  164. pointsLabel.style.fontFamily = '"Montserrat", "Noto Sans Arabic", "Helvetica Neue", Helvetica, Arial, sans-serif;';
  165. pointsLabel.style.fontSize = '1.5vw';
  166. pointsLabel.style.margin = '1vw';
  167. pointsLabel.style.marginLeft = '1vw';
  168. pointsLabel.style.marginRight = '1vw';
  169. pointsLabel.style.color = 'white';
  170. sliderContainer.appendChild(pointsLabel);
  171.  
  172. const pointsSlider = document.createElement('input');
  173. pointsSlider.type = 'range';
  174. pointsSlider.min = '500';
  175. pointsSlider.max = '1000';
  176. pointsSlider.value = '950';
  177. pointsSlider.style.width = '70%';
  178. pointsSlider.style.marginLeft = '1vw';
  179. pointsSlider.style.marginRight = '1vw';
  180.  
  181.  
  182. pointsSlider.style.border = 'none';
  183. pointsSlider.style.outline = 'none';
  184. pointsSlider.style.cursor = 'ew-resize';
  185. pointsSlider.className = 'custom-slider';
  186.  
  187.  
  188. sliderContainer.appendChild(pointsSlider);
  189.  
  190.  
  191. uiElement.appendChild(sliderContainer);
  192.  
  193. pointsSlider.addEventListener('input', () => {
  194. const points = +pointsSlider.value;
  195. PPT = points;
  196. pointsLabel.textContent = 'Points per Question: ' + points;
  197. });
  198.  
  199. const header3 = document.createElement('h2');
  200. header3.textContent = 'ANSWERING';
  201. header3.style.display = 'block';
  202. header3.style.margin = '1vw';
  203. header3.style.textAlign = 'center';
  204. header3.style.fontFamily = '"Montserrat", "Noto Sans Arabic", "Helvetica Neue", Helvetica, Arial, sans-serif;';
  205. header3.style.fontSize = '2vw';
  206. header3.style.color = 'white';
  207. header3.style.textShadow = `
  208. -1px -1px 0 rgb(47, 47, 47),
  209. 1px -1px 0 rgb(47, 47, 47),
  210. -1px 1px 0 rgb(47, 47, 47),
  211. 1px 1px 0 rgb(47, 47, 47)
  212. `;
  213.  
  214. uiElement.appendChild(header3);
  215.  
  216. const autoAnswerSwitchContainer = document.createElement('div');
  217. autoAnswerSwitchContainer.className = 'switch-container';
  218. autoAnswerSwitchContainer.style.display = 'flex';
  219. autoAnswerSwitchContainer.style.alignItems = 'center';
  220. autoAnswerSwitchContainer.style.justifyContent = 'center';
  221. uiElement.appendChild(autoAnswerSwitchContainer);
  222.  
  223. const autoAnswerLabel = document.createElement('span');
  224. autoAnswerLabel.textContent = 'Auto Answer';
  225. autoAnswerLabel.className = 'switch-label';
  226. autoAnswerLabel.style.fontFamily = '"Montserrat", "Noto Sans Arabic", "Helvetica Neue", Helvetica, Arial, sans-serif;';
  227. autoAnswerLabel.style.fontSize = '1.5vw';
  228. autoAnswerLabel.style.color = 'white';
  229. autoAnswerLabel.style.margin = '2.5vw'
  230. autoAnswerSwitchContainer.appendChild(autoAnswerLabel);
  231.  
  232. const autoAnswerSwitch = document.createElement('label');
  233. autoAnswerSwitch.className = 'switch';
  234. autoAnswerSwitchContainer.appendChild(autoAnswerSwitch);
  235.  
  236. const autoAnswerInput = document.createElement('input');
  237. autoAnswerInput.type = 'checkbox';
  238. autoAnswerInput.addEventListener('change', function() {
  239. autoAnswer = this.checked;
  240. info.ILSetQuestion = info.questionNum
  241. });
  242. autoAnswerSwitch.appendChild(autoAnswerInput);
  243.  
  244. const autoAnswerSlider = document.createElement('span');
  245. autoAnswerSlider.className = 'slider';
  246. autoAnswerSwitch.appendChild(autoAnswerSlider);
  247.  
  248. const showAnswersSwitchContainer = document.createElement('div');
  249. showAnswersSwitchContainer.className = 'switch-container';
  250. showAnswersSwitchContainer.style.display = 'flex';
  251. showAnswersSwitchContainer.style.alignItems = 'center';
  252. showAnswersSwitchContainer.style.justifyContent = 'center';
  253. uiElement.appendChild(showAnswersSwitchContainer);
  254.  
  255. const showAnswersLabel = document.createElement('span');
  256. showAnswersLabel.textContent = 'Show Answers';
  257. showAnswersLabel.className = 'switch-label';
  258. showAnswersLabel.style.fontFamily = '"Montserrat", "Noto Sans Arabic", "Helvetica Neue", Helvetica, Arial, sans-serif;';
  259. showAnswersLabel.style.fontSize = '1.5vw';
  260. showAnswersLabel.style.color = 'white';
  261. showAnswersLabel.style.margin = '2.5vw'
  262. showAnswersSwitchContainer.appendChild(showAnswersLabel);
  263.  
  264. const showAnswersSwitch = document.createElement('label');
  265. showAnswersSwitch.className = 'switch';
  266. showAnswersSwitchContainer.appendChild(showAnswersSwitch);
  267.  
  268. const showAnswersInput = document.createElement('input');
  269. showAnswersInput.type = 'checkbox';
  270. showAnswersInput.addEventListener('change', function() {
  271. showAnswers = this.checked;
  272. });
  273. showAnswersSwitch.appendChild(showAnswersInput);
  274.  
  275. const showAnswersSlider = document.createElement('span');
  276. showAnswersSlider.className = 'slider';
  277. showAnswersSwitch.appendChild(showAnswersSlider);
  278.  
  279.  
  280. const style = document.createElement('style');
  281. style.textContent = `
  282. .custom-slider {
  283. background: white
  284. border: none;
  285. outline: none;
  286. cursor: ew-resize;
  287. appearance: none; /* Remove default appearance */
  288. height: 0; /* Set the height to match the thumb height */
  289. }
  290.  
  291. .custom-slider::-webkit-slider-thumb {
  292. appearance: none; /* Remove default appearance */
  293. width: 1.75vw; /* Set width of the slider handle */
  294. height: 1.75vw; /* Set height of the slider handle */
  295. background-color: rgb(47, 47, 47); /* Set handle color to dark gray */
  296. border-radius: 50%; /* Create a circle for the handle */
  297. cursor: ew-resize; /* Horizontal resize cursor */
  298. margin-top: -0.5vw; /* Adjust margin-top to vertically center the thumb */
  299. }
  300.  
  301. .custom-slider::-webkit-slider-runnable-track {
  302. width: 100%; /* Set track width to 100% */
  303. height: 0.75vw; /* Set track height to match the thumb height */
  304. background-color: white; /* Set track color to white */
  305. cursor: ew-resize; /* Horizontal resize cursor */
  306. border-radius: 1vw; /* Set rounded corners for the track */
  307. background: linear-gradient(to right, red, yellow, limegreen); /* Gradient from red to yellow to green */
  308. }
  309.  
  310.  
  311.  
  312. :root {
  313. --switch-width: 5.9vw;
  314. --switch-height: 3.3vw;
  315. --slider-size: 2.5vw;
  316. --slider-thumb-size: 1.3vw;
  317. }
  318.  
  319. .switch {
  320. position: relative;
  321. display: inline-block;
  322. width: var(--switch-width);
  323. height: var(--switch-height);
  324. margin: 2.5vw;
  325. }
  326.  
  327. .switch input {
  328. opacity: 0;
  329. width: 0;
  330. height: 0;
  331. }
  332.  
  333. .slider {
  334. position: absolute;
  335. cursor: pointer;
  336. top: 0;
  337. left: 0;
  338. right: 0;
  339. bottom: 0;
  340. background-color: red;
  341. transition: 0.8s;
  342. border-radius: .5vw
  343. }
  344.  
  345. .slider:before {
  346. position: absolute;
  347. content: "";
  348. height: var(--slider-size);
  349. width: var(--slider-size);
  350. left: calc(var(--slider-thumb-size) / 3);
  351. bottom: calc(var(--slider-thumb-size) / 3);
  352. background-color: rgb(43, 43, 43);
  353. transition: 0.8s;
  354. border-radius: .5vw
  355. }
  356.  
  357. input:checked + .slider {
  358. background-color: green;
  359. }
  360.  
  361. input:focus + .slider {
  362. box-shadow: 0 0 1px green;
  363. }
  364.  
  365. input:checked + .slider:before {
  366. transform: translateX(calc(var(--slider-size)));
  367. }
  368.  
  369. `;
  370. document.head.appendChild(style);
  371.  
  372. const header4 = document.createElement('h2');
  373. header4.textContent = 'INFO';
  374. header4.style.display = 'block';
  375. header4.style.margin = '1vw';
  376. header4.style.textAlign = 'center';
  377. header4.style.fontFamily = '"Montserrat", "Noto Sans Arabic", "Helvetica Neue", Helvetica, Arial, sans-serif;';
  378. header4.style.fontSize = '2vw';
  379. header4.style.color = 'white';
  380. header4.style.textShadow = `
  381. -1px -1px 0 rgb(47, 47, 47),
  382. 1px -1px 0 rgb(47, 47, 47),
  383. -1px 1px 0 rgb(47, 47, 47),
  384. 1px 1px 0 rgb(47, 47, 47)
  385. `;
  386.  
  387. uiElement.appendChild(header4)
  388.  
  389. const questionsLabel = document.createElement('span');
  390. questionsLabel.textContent = 'Question 0 / 0';
  391. questionsLabel.style.display = 'block';
  392. questionsLabel.style.fontFamily = '"Montserrat", "Noto Sans Arabic", "Helvetica Neue", Helvetica, Arial, sans-serif;';
  393. questionsLabel.style.fontSize = '1.5vw';
  394. questionsLabel.style.textAlign = 'center';
  395. questionsLabel.style.margin = '1vw';
  396. questionsLabel.style.marginLeft = '1vw';
  397. questionsLabel.style.marginRight = '1vw';
  398. questionsLabel.style.color = 'white';
  399. uiElement.appendChild(questionsLabel);
  400.  
  401. const inputLagLabel = document.createElement('span');
  402. inputLagLabel.textContent = 'Input lag : 125 ms';
  403. inputLagLabel.style.display = 'block';
  404. inputLagLabel.style.fontFamily = '"Montserrat", "Noto Sans Arabic", "Helvetica Neue", Helvetica, Arial, sans-serif;';
  405. inputLagLabel.style.fontSize = '1.5vw';
  406. inputLagLabel.style.textAlign = 'center';
  407. inputLagLabel.style.margin = '1vw';
  408. inputLagLabel.style.marginLeft = '1vw';
  409. inputLagLabel.style.marginRight = '1vw';
  410. inputLagLabel.style.color = 'white';
  411. uiElement.appendChild(inputLagLabel);
  412.  
  413. const versionLabel = document.createElement('h1');
  414. versionLabel.textContent = 'Ownership of Rylan Rude V'+Version;
  415. versionLabel.style.fontFamily = '"Montserrat", "Noto Sans Arabic", "Helvetica Neue", Helvetica, Arial, sans-serif;';
  416. versionLabel.style.fontSize = '2.5vw';
  417. versionLabel.style.display = 'block';
  418. versionLabel.style.textAlign = 'center';
  419. versionLabel.style.marginTop = '3.5vw';
  420. versionLabel.style.marginLeft = '1vw';
  421. versionLabel.style.marginRight = '1vw';
  422. versionLabel.style.color = 'white';
  423. uiElement.appendChild(versionLabel);
  424.  
  425. const githubContainer = document.createElement('div');
  426. githubContainer.style.textAlign = 'center';
  427. githubContainer.style.marginTop = '1vw';
  428.  
  429. const githubLabel = document.createElement('span');
  430. githubLabel.textContent = 'GitHub: ';
  431. githubLabel.style.fontFamily = '"Montserrat", "Noto Sans Arabic", "Helvetica Neue", Helvetica, Arial, sans-serif;';
  432. githubLabel.style.fontSize = '1.5vw';
  433. githubLabel.style.margin = '0 1vw';
  434. githubLabel.style.color = 'white';
  435. githubContainer.appendChild(githubLabel);
  436.  
  437. const githubUrl = document.createElement('a');
  438. githubUrl.textContent = 'Thatoneguy54321';
  439. githubUrl.href = 'https://github.com/jokeri2222';
  440. githubUrl.target = '_blank';
  441. githubUrl.style.fontFamily = '"Montserrat", "Noto Sans Arabic", "Helvetica Neue", Helvetica, Arial, sans-serif;';
  442. githubUrl.style.fontSize = '1.5vw';
  443. githubUrl.style.margin = '0 1vw';
  444. githubUrl.style.color = 'white';
  445. githubContainer.appendChild(githubUrl);
  446.  
  447. const githubUrl2 = document.createElement('a');
  448. githubUrl2.textContent = 'Epic0001';
  449. githubUrl2.href = 'https://github.com/Epic0001';
  450. githubUrl2.target = '_blank';
  451. githubUrl2.style.fontFamily = '"Montserrat", "Noto Sans Arabic", "Helvetica Neue", Helvetica, Arial, sans-serif;';
  452. githubUrl2.style.fontSize = '1.5vw';
  453. githubUrl2.style.margin = '0 1vw';
  454. githubUrl2.style.color = 'white';
  455. githubContainer.appendChild(githubUrl2);
  456.  
  457. uiElement.appendChild(githubContainer);
  458.  
  459. closeButton.addEventListener('click', () => {
  460. document.body.removeChild(uiElement);
  461. autoAnswer = false;
  462. showAnswers = false;
  463. });
  464.  
  465. let isMinimized = false;
  466.  
  467. minimizeButton.addEventListener('click', () => {
  468. isMinimized = !isMinimized;
  469.  
  470. if (isMinimized) {
  471. header.style.display = 'none';
  472. header2.style.display = 'none';
  473. header3.style.display = 'none';
  474. header4.style.display = 'none';
  475. inputContainer.style.display = 'none';
  476. questionsLabel.style.display = 'none';
  477. versionLabel.style.display = 'none';
  478. inputLagLabel.style.display='none';
  479. githubContainer.style.display = 'none';
  480.  
  481. sliderContainer.style.display = 'none';
  482. autoAnswerSwitchContainer.style.display = 'none';
  483. showAnswersSwitchContainer.style.display = 'none';
  484.  
  485. uiElement.style.height = '2.5vw';
  486. handle.style.height = '100%';
  487. closeButton.style.height = '100%';
  488. minimizeButton.style.height = '100%';
  489. } else {
  490. header.style.display = 'block';
  491. header2.style.display = 'block';
  492. header3.style.display = 'block';
  493. header4.style.display = 'block';
  494. inputContainer.style.display = 'flex';
  495. questionsLabel.style.display = 'block';
  496. versionLabel.style.display = 'block';
  497. inputLagLabel.style.display='block';
  498. githubContainer.style.display = 'block';
  499.  
  500. handle.style.height = '2.5vw';
  501. uiElement.style.height = 'auto';
  502. closeButton.style.height = '2.5vw';
  503. minimizeButton.style.height = '2.5vw';
  504.  
  505. sliderContainer.style.display = 'flex';
  506. autoAnswerSwitchContainer.style.display = 'flex';
  507. showAnswersSwitchContainer.style.display = 'flex';
  508. }
  509. });
  510.  
  511. function parseQuestions(questionsJson){
  512. let questions = []
  513. questionsJson.forEach(function (question){
  514. let q = {type:question.type, time:question.time}
  515. if (['quiz', 'multiple_select_quiz'].includes(question.type)){
  516. var i=0
  517. q.answers = []
  518. q.incorrectAnswers = []
  519. question.choices.forEach(function(choise){
  520. if (choise.correct) {
  521. q.answers.push(i)
  522. }
  523. else{
  524. q.incorrectAnswers.push(i)
  525. }
  526. i++
  527. })
  528. }
  529. if (question.type == 'open_ended')
  530. {
  531. q.answers = []
  532. question.choices.forEach(function(choise){
  533. q.answers.push(choise.answer)
  534. })
  535. }
  536. questions.push(q)
  537. })
  538. return questions
  539. }
  540.  
  541. function handleInputChange() {
  542. const quizID = inputBox.value;
  543. const url = 'https://kahoot.it/rest/kahoots/' + quizID;
  544.  
  545. if (quizID != "") {
  546. fetch(url)
  547. .then(response => {
  548. if (!response.ok) {
  549. throw new Error('');
  550. }
  551. return response.json();
  552. })
  553. .then(data => {
  554. inputBox.style.backgroundColor = 'green'
  555.  
  556. questions=parseQuestions(data.questions)
  557. info.numQuestions=questions.length
  558. })
  559. .catch(error => {
  560. inputBox.style.backgroundColor = 'red';
  561.  
  562. info.numQuestions = 0
  563. });
  564. } else {
  565. inputBox.style.backgroundColor = 'white';
  566. info.numQuestions = 0
  567.  
  568. }
  569. }
  570.  
  571. inputBox.addEventListener('input', handleInputChange);
  572.  
  573. document.body.appendChild(uiElement);
  574.  
  575. let isDragging = false;
  576. let offsetX, offsetY;
  577.  
  578. handle.addEventListener('mousedown', (e) => {
  579. isDragging = true;
  580. offsetX = e.clientX - uiElement.getBoundingClientRect().left;
  581. offsetY = e.clientY - uiElement.getBoundingClientRect().top;
  582. });
  583.  
  584. document.addEventListener('mousemove', (e) => {
  585. if (isDragging) {
  586. const x = e.clientX - offsetX;
  587. const y = e.clientY - offsetY;
  588.  
  589. uiElement.style.left = x + 'px';
  590. uiElement.style.top = y + 'px';
  591. }
  592. });
  593.  
  594. document.addEventListener('mouseup', () => {
  595. isDragging = false;
  596. });
  597.  
  598.  
  599. function onQuestionStart(){
  600. console.log(inputLag)
  601. var question = questions[info.questionNum]
  602. if (showAnswers){
  603. highlightAnswers(question)
  604. }
  605. if (autoAnswer){
  606. answer(question, (question.time - question.time / (500/(PPT-500))) - inputLag)
  607. }
  608. }
  609.  
  610. function highlightAnswers(question){
  611. question.answers.forEach(function (answer) {
  612. setTimeout(function() {
  613. FindByAttributeValue("data-functional-selector", 'answer-'+answer, "button").style.backgroundColor = 'rgb(0, 255, 0)'
  614. }, 0)
  615. })
  616. question.incorrectAnswers.forEach(function (answer) {
  617. setTimeout(function() {
  618. FindByAttributeValue("data-functional-selector", 'answer-'+answer, "button").style.backgroundColor = 'rgb(255, 0, 0)'
  619. }, 0)
  620. })
  621. }
  622.  
  623. function answer(question, time) {
  624. Answered_PPT = PPT
  625.  
  626. var delay = 0
  627. if (question.type == 'multiple_select_quiz') delay = 60
  628. setTimeout(function() {
  629. if (question.type == 'quiz') {
  630. const key=(+question.answers[0]+1).toString();
  631. const event = new KeyboardEvent('keydown', { key });
  632. window.dispatchEvent(event);
  633. }
  634. if (question.type == 'multiple_select_quiz') {
  635. question.answers.forEach(function (answer) {
  636. setTimeout(function() {
  637. const key=(+answer+1).toString();
  638. const event = new KeyboardEvent('keydown', { key });
  639. window.dispatchEvent(event);
  640. }, 0)
  641. })
  642. setTimeout(function() {
  643. FindByAttributeValue("data-functional-selector", 'multi-select-submit-button', "button").click()
  644. }, 0)
  645. }
  646. }, time - delay)
  647. }
  648.  
  649. let isHidden = false;
  650. document.addEventListener('keydown', (event)=> {
  651. if (event.key == "h" && event.altKey)
  652. {
  653. isHidden = !isHidden
  654. }
  655.  
  656. if (event.key == "x" && event.altKey){
  657. document.body.removeChild(uiElement);
  658. autoAnswer = false;
  659. showAnswers = false;
  660. }
  661.  
  662. if (isHidden)
  663. {
  664. uiElement.style.display = 'none'
  665. }
  666. else
  667. {
  668. uiElement.style.display = 'block'
  669. }
  670. })
  671.  
  672. setInterval(function () {
  673. var textElement = FindByAttributeValue("data-functional-selector", "question-index-counter", "div")
  674. if (textElement){
  675.  
  676. info.questionNum = +textElement.textContent - 1
  677. }
  678. if (FindByAttributeValue("data-functional-selector", 'answer-0', "button") && info.lastAnsweredQuestion != info.questionNum)
  679. {
  680. info.lastAnsweredQuestion = info.questionNun
  681. onQuestionStart()
  682. }
  683. if (autoAnswer){
  684. if (info.ILSetQuestion != info.questionNum){
  685. var ppt = Answered_PPT
  686. if (ppt > 987) ppt = 1000
  687. var incrementElement = FindByAttributeValue("data-functional-selector", "score-increment", "span")
  688. if (incrementElement){
  689. info.ILSetQuestion = info.questionNum
  690. var increment = +incrementElement.textContent.split(" ")[1]
  691. if (increment != 0){
  692. inputLag += (ppt-increment)*15
  693. if (inputLag < 0) {
  694. inputLag -= (ppt-increment)*15
  695. inputLag += (ppt-increment/2)*15
  696. }
  697. inputLag = Math.round(inputLag)
  698. }
  699. }
  700. }
  701. }
  702. questionsLabel.textContent = 'Question '+(info.questionNum+1)+' / '+info.numQuestions;
  703. inputLagLabel.textContent = 'Input lag : '+inputLag+' ms';
  704. }, 1)

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址