This commit is contained in:
@@ -261,6 +261,19 @@ var tdv_sdk = {
|
||||
|
||||
this.currentQuestion = this.list[this.level];
|
||||
if (this.currentQuestion) {
|
||||
// ===== NORMALIZE DATA FROM SDK IFRAME =====
|
||||
if (this.currentQuestion.content && !this.currentQuestion.sentence) {
|
||||
this.currentQuestion.sentence = this.currentQuestion.content;
|
||||
}
|
||||
|
||||
if (Array.isArray(this.currentQuestion.options) && !this.currentQuestion.parts) {
|
||||
this.currentQuestion.parts = this.currentQuestion.options;
|
||||
}
|
||||
|
||||
// Fallback cuối: nếu vẫn chưa có parts
|
||||
if (!this.currentQuestion.parts && this.currentQuestion.sentence) {
|
||||
this.currentQuestion.parts = this.currentQuestion.sentence.split(/\s+/);
|
||||
}
|
||||
// Lấy câu đúng từ field "sentence"
|
||||
this.correctSentence = String(this.currentQuestion.sentence || "").trim();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user