ading2210 / edulastic-tools Goto Github PK
View Code? Open in Web Editor NEWA collection of scripts for screwing around with the online testing software Edulastic.
License: GNU General Public License v3.0
A collection of scripts for screwing around with the online testing software Edulastic.
License: GNU General Public License v3.0
After the rebrand to "Peardeck", it now throws an error saying "ERROR: invalid url"
function http_get(url, callback, headers=[], method="GET", content=null) {
let request = new XMLHttpRequest();
request.addEventListener("load", callback);
request.open(method, url, true);
for (const header of headers) {
request.setRequestHeader(header[0], header[1]);
}
request.send(content);
}
function main() {
let url_regex = /https://assessment.peardeck.com/home/class/([a-f0-9]+)/test/([a-f0-9]+)/testActivityReport/([a-f0-9]+)/;
if (!url_regex.test(window.location)) {
alert("Error: Invalid URL.\n\nFor reference, the URL should look like this:\nhttps://app.edulastic.com/home/class/CLASS_ID/test/TEST_ID/testActivityReport/TEST_REPORT_ID");
return;
}
let matches = url_regex.exec(window.location);
let group_id = matches[1];
let test_id = matches[3];
let request_url = https://assessment.peardeck.com/api/test-activity/${test_id}/report?groupId=${group_id}
;
let token_list = JSON.parse(localStorage.getItem("tokens"));
let token = localStorage.getItem(token_list[0]);
let headers = [
["Authorization", token]
];
http_get(request_url, function(){
if (this.status != 200) {
alert(Error: Status code ${this.status} recieved while trying to fetch the API.
);
return;
}
let report = JSON.parse(this.responseText);
let wrong = report.result.testActivity.wrong;
let total = report.result.questionActivities.length;
let percent = (100*(total-wrong)/total).toFixed(2);
alert(${total-wrong}/${total} questions correct (~${percent}%)
);
}, headers);
}
main();
us
does it still work?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.