CodingBat FULL cheat - codingbat.com

Fake stars and check mark, auto fetch answer in github raw

Verze ze dne 25. 05. 2020. Zobrazit nejnovější verzi.

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name        CodingBat FULL cheat - codingbat.com
// @namespace   SaigyoujiYuyuko233
// @match       https://codingbat.com/python/*
// @match       https://codingbat.com/python
// @match       https://codingbat.com/prob/*
// @grant       none
// @version     1.0
// @author      SaigyoujiYuyuko233
// @description Fake stars and check mark, auto fetch answer in github raw
// @require http://code.jquery.com/jquery-3.4.1.min.js
// ==/UserScript==

let answer = new Map()

// python - logic - 1
answer.set('p191645', "https://raw.githubusercontent.com/diezguerra/codingbat-python-solutions/master/list-1.py")
answer.set('p195669', "https://raw.githubusercontent.com/snowpolar/codingbat-solutions/master/Python/Logic-1/cigar_party.py");
answer.set('p129125', "https://raw.githubusercontent.com/snowpolar/codingbat-solutions/master/Python/Logic-1/date_fashion.py");
answer.set('p135815', "https://raw.githubusercontent.com/snowpolar/codingbat-solutions/master/Python/Logic-1/squirrel_play.py")
answer.set('p137202', "https://raw.githubusercontent.com/snowpolar/codingbat-solutions/master/Python/Logic-1/caught_speeding.py")
answer.set('p119867', "https://raw.githubusercontent.com/snowpolar/codingbat-solutions/master/Python/Logic-1/alarm_clock.py")
answer.set('', "")
answer.set('', "")
answer.set('', "")
answer.set('', "")
answer.set('', "")
answer.set('', "")


$("img[src='/c1.jpg']").each(function (n, el){
  $(el).attr("src", "/c2.jpg");
});

$("img[src='/s1.jpg']").each(function (n, el){
  $(el).attr("src", "/s2.jpg");
});

let url = window.location.href;
if (url.includes("prob") == true) {
  let problemID = url.split("/")[4];
  let problemAnswerUrl = answer.get(problemID);
  
  if (problemAnswerUrl == undefined) {
    console.log("No answer for question: " + problemID);
    return;
  }
  
  console.log("answer: " + problemAnswerUrl);
  
  let ret = $.ajax({
    url: problemAnswerUrl,
    method: "GET",
    async: false
  });
  
  let responseAnswer = ret.responseText;
  editor.setValue(responseAnswer);
}