BigIdeasMath Homework Tool

Get the answers for bigideas math (only works on homework assignments, not tests/practice tests)

  1. // ==UserScript==
  2. // @name BigIdeasMath Homework Tool
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.18.2
  5. // @description Get the answers for bigideas math (only works on homework assignments, not tests/practice tests)
  6. // @author theusaf
  7. // @match https://*.bigideasmath.com/BIM/student/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. function detect(){
  12. if(document.getElementsByClassName("check dark").length == 1){
  13. window.ansget = document.createElement("textarea");
  14. ansget.style = "position: absolute; top: 300px; right: 80px; z-index: 10000; color: black"
  15. document.body.append(ansget);
  16. setup();
  17. return;
  18. }
  19. setTimeout(detect,1000);
  20. };
  21.  
  22. function setup(){
  23. var prevID;
  24. function replaceItems(l){
  25. for(let i in l){
  26. l[i] = String(l[i]);
  27. l[i] = l[i].replace(/(\\\(x\\\))/img,"x");
  28. l[i] = l[i].replace(/(\\\(y\\\))/img,"y");
  29. l[i] = l[i].replace(/(\\frac)/img,"fct");
  30. l[i] = l[i].replace(/(\\sqrt)/img,"sqrt");
  31. l[i] = l[i].replace(/(\\ge)/img,"≥");
  32. l[i] = l[i].replace(/(&lt;)/img,"<");
  33. l[i] = l[i].replace(/(&gt;)/img,">");
  34. l[i] = l[i].replace(/(&nbsp;)/img,"");
  35. l[i] = l[i].replace(/(\\left\()/img,"(");
  36. l[i] = l[i].replace(/(\\right\))/img,")");
  37. l[i] = l[i].replace(/(\\le)/img,"≤");
  38. l[i] = l[i].replace(/(\\ne)/img,"≠");
  39. l[i] = l[i].replace(/(\\pm)/img,"∓");
  40. l[i] = l[i].replace(/(\\infty)/img,"∞");
  41. l[i] = l[i].replace(/(\\times)/img,"*");
  42. l[i] = l[i].replace(/(<span>)/img,"");
  43. l[i] = l[i].replace(/(<\/span>)/img,"");
  44. l[i] = l[i].replace(/(<em>)/img,"");
  45. l[i] = l[i].replace(/(<\/em>)/img,"");
  46. l[i] = l[i].replace(/(\\cdot)/img," x ");
  47. l[i] = l[i].replace(/(\\theta)/img,"θ");
  48. l[i] = l[i].replace(/(\\pi)/img,"π");
  49.  
  50. l[i] = l[i].replace(/\\/img,"");
  51. l[i] = l[i].replace(/{/img,"(");
  52. l[i] = l[i].replace(/}/img,")");
  53. }
  54. return l;
  55. }
  56. function listEdit(item,list){
  57. var numorstr = item.filter(function(o){
  58. return typeof(o) == "string" || typeof(o) == "number";
  59. });
  60. if(numorstr.length > 0){
  61. for(let i in numorstr){
  62. list.push(numorstr[i]);
  63. }
  64. }
  65. var hasvalue = item.filter(function(o){
  66. return typeof(o.value) == "string" || typeof(o.value) == "number";
  67. });
  68. if(hasvalue.length > 0){
  69. for(let i in hasvalue){
  70. list.push(hasvalue[i].value);
  71. }
  72. }
  73. var remainingarrays = item.filter(function(o){
  74. return typeof(o.push) == "function";
  75. });
  76. if(remainingarrays.length > 0){
  77. //recursion.
  78. for(let i in remainingarrays){
  79. var a = listEdit(remainingarrays[i],[]);
  80. for(let e in a){
  81. list.push(a[e]);
  82. }
  83. }
  84. }
  85. return list;
  86. }
  87. function run(){
  88. try{
  89. if(prevID !== LearnosityAssess.getCurrentItem().response_ids[0]){
  90. var lists = [];
  91. var newlists = [];
  92. prevID = LearnosityAssess.getCurrentItem().response_ids[0];
  93. for(let i in LearnosityAssess.getCurrentItem().response_ids){
  94. lists.push(LearnosityAssess.getQuestions()[LearnosityAssess.getCurrentItem().response_ids[i]].validation.valid_response.value);
  95. }
  96. for(let i in lists){
  97. var a = listEdit(lists[i],[]);
  98. for(let e in a){
  99. newlists.push(a[e]);
  100. }
  101. newlists.push("|");
  102. }
  103. newlists = replaceItems(newlists);
  104. ansget.innerText = newlists;
  105. }
  106. }catch(e){
  107. console.error(e);
  108. clearInterval(runcheat);
  109. }
  110. }
  111. window.runcheat = setInterval(run,500);
  112. }
  113. detect();