Khan Hackademy

Khan Hackademy is a script that gets a full score on every Khan Academy exercise you complete.

  1. // ==UserScript==
  2. // @name Khan Hackademy
  3. // @description Khan Hackademy is a script that gets a full score on every Khan Academy exercise you complete.
  4. // @author TheTridentGuy (thetridentguy.com)
  5. // @namespace https://thetridentguy.com
  6. // @license GPL v3 - http://www.gnu.org/licenses/gpl-3.0.txt
  7. // @copyright Copyright (C) 2025 Aiden Bohlander
  8. // @include https://khanacademy.org/*
  9. // @include https://*.khanacademy.org/*
  10. // @version 1.0
  11. // @run-at document-end
  12. // ==/UserScript==
  13. /**
  14. * This program is free software: you can redistribute it and/or modify
  15. * it under the terms of the GNU General Public License as published by
  16. * the Free Software Foundation, either version 3 of the License, or
  17. * (at your option) any later version.
  18. *
  19. * This program is distributed in the hope that it will be useful,
  20. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  21. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  22. * GNU General Public License for more details.
  23. *
  24. * You should have received a copy of the GNU General Public License
  25. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  26. */
  27. (() => {
  28. const fetch_lag = 500;
  29. const exec_lag = 500;
  30. const og_stringify = JSON.stringify;
  31. const $ = (...args) => {return document.querySelector(...args)}
  32. JSON.stringify = (obj) => {
  33. if(!obj){return og_stringify(obj)}
  34. if(obj.operationName == "attemptProblem"){
  35. console.log("Sneaking into the teachers office...");
  36. console.log("Grabbed your work: ", obj);
  37. console.log("Giving you an A...");
  38. obj.variables.input.completed = true;
  39. console.log("Mission accomplished, exfiltrating.");
  40. if(obj.variables.input.attemptNumber == 1){
  41. setTimeout(() => {
  42. console.log("Getting you to the next question...");
  43. $("[data-testid='exercise-skip-button']").click();
  44. setTimeout(() => {
  45. $("[data-testid='exercise-next-question']").click();
  46. }, exec_lag);
  47. }, fetch_lag);
  48. }
  49. }
  50. return og_stringify(obj)
  51. };
  52. setInterval(() => {
  53. try{
  54. let header = $("[data-testid='header-logo']");
  55. header.innerHTML = "<span style='font-size: x-large;'>Khan Hackademy</span>";
  56. let donation_link = $("[data-testid='header-donate-link']");
  57. let new_donation_link = donation_link.cloneNode(true);
  58. let donation_icon = new_donation_link.firstElementChild.outerHTML;
  59. new_donation_link.innerHTML = "Star the repo" + donation_icon;
  60. new_donation_link.href = "https://github.com/TheTridentGuy/KhanHackademy/";
  61. donation_link.parentElement.replaceChild(new_donation_link, donation_link);
  62. clearInterval(edit_interval);
  63. }catch{
  64. }
  65. }, 500);
  66. })();