up
All checks were successful
Deploy to Production / deploy (push) Successful in 9s

This commit is contained in:
lubukhu
2026-01-24 14:32:16 +07:00
parent 08e6fbe612
commit 05547ef4b8

View File

@@ -253,32 +253,23 @@ var tdv_sdk = {
// ==================== LOGIC CHÍNH: LOAD CÂU HỎI ==================== // ==================== LOGIC CHÍNH: LOAD CÂU HỎI ====================
lastLoadedLevel: -1, lastLoadedLevel: -1,
loadQuestions: function () { loadQuestion: function () {
if (this.lastLoadedLevel === this.level && this.currentWords.length > 0) {
console.log("⏭️ Sentence", this.level + 1, "already loaded, skipping...");
return;
}
this.currentQuestion = this.list[this.level]; this.currentQuestion = this.list[this.level];
if (this.currentQuestion) { if (!this.currentQuestion) return;
// ===== NORMALIZE DATA (COMPANY STANDARD) =====
var q = this.currentQuestion;
// Chuẩn công ty this.questionStartTime = new Date();
if (q.question && !q.sentence) { this.waitingForServerVerify = false;
q.sentence = q.question;
}
// Options / words // Normalize question array
if (Array.isArray(q.options) && !q.parts) { this.sequence.originalQuestion =
q.parts = q.options; JSON.parse(JSON.stringify(this.currentQuestion.question || []));
} this.sequence.userSequence =
JSON.parse(JSON.stringify(this.sequence.originalQuestion));
// Fallback cuối this.sequence.isCompleted = false;
if (!q.parts && q.sentence) {
q.parts = q.sentence.split(/\s+/); window.answerResult = -1;
} window.gameState = 0;
}
}, },
// Tính width dựa trên số từ và độ dài từ dài nhất // Tính width dựa trên số từ và độ dài từ dài nhất