|
|
|
@ -2,6 +2,7 @@
|
|
|
|
|
$(document).ready(function () {
|
|
|
|
|
var results = Array();
|
|
|
|
|
var ctime;
|
|
|
|
|
var flag_again = false;
|
|
|
|
|
var flag_create = false;
|
|
|
|
|
var score = 0;
|
|
|
|
|
var usetime = 0;
|
|
|
|
@ -25,25 +26,71 @@ $(document).ready(function () {
|
|
|
|
|
});
|
|
|
|
|
$("#create").click(function (e) {
|
|
|
|
|
e.preventDefault();
|
|
|
|
|
$("#show").hide();
|
|
|
|
|
if (module) {
|
|
|
|
|
if (parseFloat(btn.text()) == 0 || btn.text() == "") {
|
|
|
|
|
results = [];
|
|
|
|
|
score = 0;
|
|
|
|
|
usetime = 0;
|
|
|
|
|
begin();
|
|
|
|
|
} else {
|
|
|
|
|
return;
|
|
|
|
|
if (!flag_again) {
|
|
|
|
|
flag_again = true;
|
|
|
|
|
console.log(flag_again);
|
|
|
|
|
if (language == 1 && confirm("答题须知:除法的商请以分数形式输入!示例:1 ÷ 2 = 1/2!")) {
|
|
|
|
|
$("#show").hide();
|
|
|
|
|
if (module) {
|
|
|
|
|
if (parseFloat(btn.text()) == 0 || btn.text() == "") {
|
|
|
|
|
results = [];
|
|
|
|
|
score = 0;
|
|
|
|
|
usetime = 0;
|
|
|
|
|
begin();
|
|
|
|
|
} else {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if (language != -1) {
|
|
|
|
|
alert("请先选择出题模式。");
|
|
|
|
|
} else {
|
|
|
|
|
alert("Please Choose Module First!");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else if (language == -1 && confirm("Answer note: Please enter the quotient of division as a fraction! Such as: 1 ÷ 2 = 1/2!")) {
|
|
|
|
|
|
|
|
|
|
$("#show").hide();
|
|
|
|
|
if (module) {
|
|
|
|
|
if (parseFloat(btn.text()) == 0 || btn.text() == "") {
|
|
|
|
|
results = [];
|
|
|
|
|
score = 0;
|
|
|
|
|
usetime = 0;
|
|
|
|
|
begin();
|
|
|
|
|
} else {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if (language != -1) {
|
|
|
|
|
alert("请先选择出题模式。");
|
|
|
|
|
} else {
|
|
|
|
|
alert("Please Choose Module First!");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if (language != -1) {
|
|
|
|
|
alert("请先选择出题模式。");
|
|
|
|
|
$("#show").hide();
|
|
|
|
|
if (module) {
|
|
|
|
|
if (parseFloat(btn.text()) == 0 || btn.text() == "") {
|
|
|
|
|
results = [];
|
|
|
|
|
score = 0;
|
|
|
|
|
usetime = 0;
|
|
|
|
|
begin();
|
|
|
|
|
} else {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
alert("Please Choose Module First!");
|
|
|
|
|
if (language != -1) {
|
|
|
|
|
alert("请先选择出题模式。");
|
|
|
|
|
} else {
|
|
|
|
|
alert("Please Choose Module First!");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
console.log(results);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//console.log(results);
|
|
|
|
|
});
|
|
|
|
|
$("#exchange").change(function (e) {
|
|
|
|
|
e.preventDefault();
|
|
|
|
@ -155,7 +202,9 @@ $(document).ready(function () {
|
|
|
|
|
var tmp = res[i].result;
|
|
|
|
|
var reg = /\s+/g;
|
|
|
|
|
//console.log(typeof tmp + " " + tmp);
|
|
|
|
|
tmp = tmp.replace(reg, "");
|
|
|
|
|
if (typeof tmp == "string") {
|
|
|
|
|
tmp = tmp.replace(reg, "");
|
|
|
|
|
}
|
|
|
|
|
//results.push(res[i].result);
|
|
|
|
|
results.push(tmp);
|
|
|
|
|
}
|
|
|
|
|