This commit is contained in:
Ross
2021-02-28 22:56:41 +00:00
parent 112109d07c
commit c8a3aa1549
2 changed files with 3 additions and 16 deletions
+2 -4
View File
@@ -110,19 +110,17 @@ function submissionError(data, ans) {
});
}
// TODO: async request
export function getQuestion(url, question_number, question_total) {
console.log("Downloading ", url, question_number, question_total);
console.log("Downloading question ", url, question_number, question_total);
return $.ajax({
dataType: "json",
url: url,
progress: function (e) {
console.log(e);
if (e.lengthComputable) {
var completedPercentage = Math.round((e.loaded * 100) / e.total);
$("#progress").html(
`Downloading [${question_number}/${question_total}]${completedPercentage}%<br/>${helper.formatBytes(
`Downloading question [${question_number}/${question_total}]<br/>${completedPercentage}%<br/>${helper.formatBytes(
e.total
)}`
);