Compare commits

6 Commits
main ... master

Author SHA1 Message Date
Đặng Minh Quang
2e5c6a83dc Merge main into master to update to the latest version, preferring main's changes
All checks were successful
Deploy to Production / deploy (push) Successful in 8s
2026-02-27 15:52:31 +07:00
Đặng Minh Quang
ff8ec77f40 up lai game
All checks were successful
Deploy to Production / deploy (push) Successful in 9s
2026-01-21 15:50:54 +07:00
Đặng Minh Quang
92657bf568 Rename Source to source
All checks were successful
Deploy to Production / deploy (push) Successful in 8s
2026-01-21 15:37:07 +07:00
Đặng Minh Quang
3841e1da96 Update index.html
All checks were successful
Deploy to Production / deploy (push) Successful in 7s
2026-01-21 15:19:57 +07:00
silverpro89
dc642a3328 update CICD
All checks were successful
Deploy to Production / deploy (push) Successful in 7s
2026-01-21 15:17:09 +07:00
Đặng Minh Quang
bb7b411c60 Initial upload: Source and Game Build 2026-01-21 15:10:24 +07:00
33 changed files with 150 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 535 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 573 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 543 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 472 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 481 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 288 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 281 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

150
PairOrNotPair/tdv_sdk.js Normal file
View File

@@ -0,0 +1,150 @@
var tdv_sdk = {};
tdv_sdk.list = [
{
"id": "1",
"name": "dog",
"image": "https://images.senaai.vn/images/dog4.jpg",
"audio": "https://audio.senaai.vn/audio/en_female_1_dog.mp3"
},
{
"id": "2",
"name": "cat",
"image": "https://images.senaai.vn/images/cat_1.jpg",
"audio": "https://audio.senaai.vn/audio/en_female_1_cat.mp3"
},
{
"id": "3",
"name": "cow",
"image": "https://images.senaai.vn/images/cow1.jpg",
"audio": "https://audio.senaai.vn/audio/en_female_1_cow.mp3"
},
{
"id": "4",
"name": "fish",
"image": "https://images.senaai.vn/images/blue_fish1.jpg",
"audio": "https://audio.senaai.vn/audio/en_female_1_fish.mp3"
},
{
"id": "5",
"name": "bird",
"image": "https://images.senaai.vn/images/brown_bird1.jpg",
"audio": "https://audio.senaai.vn/audio/en_female_1_bird.mp3"
},
{
"id": "6",
"name": "duck",
"image": "https://images.senaai.vn/images/duck2.jpg",
"audio": "https://audio.senaai.vn/audio/en_female_1_duck.mp3"
}
];
tdv_sdk.max_question = 5; // CẤU HÌNH SỐ LƯỢNG CÂU HỎI TẠI ĐÂY
tdv_sdk.gameList = [];
tdv_sdk.currentLevel = 0;
tdv_sdk.score = 0;
tdv_sdk.shuffleArray = function(array) {
var newArray = array.slice();
for (let i = newArray.length - 1; i > 0; i--) {
const j = Math.floor(Math.random() * (i + 1));
[newArray[i], newArray[j]] = [newArray[j], newArray[i]];
}
return newArray;
};
tdv_sdk.start = function() {
tdv_sdk.currentLevel = 0;
tdv_sdk.score = 0;
tdv_sdk.gameList = [];
var shuffledList = tdv_sdk.shuffleArray(tdv_sdk.list);
var selectedItems = shuffledList.slice(0, tdv_sdk.max_question);
selectedItems.forEach(function(item) {
var isPair = Math.random() < 0.5;
var questionObj = {
image: item.image,
audio_image: item.audio,
is_pair: isPair
};
if (isPair) {
questionObj.text = item.name;
questionObj.audio_text = item.audio;
} else {
var distractor;
do {
distractor = tdv_sdk.list[Math.floor(Math.random() * tdv_sdk.list.length)];
} while (distractor.id === item.id);
questionObj.text = distractor.name;
questionObj.audio_text = distractor.audio;
}
tdv_sdk.gameList.push(questionObj);
});
};
tdv_sdk.getCurrentLevel = function() {
return tdv_sdk.currentLevel + 1;
};
tdv_sdk.getTotalQuestion = function() {
return tdv_sdk.max_question;
};
tdv_sdk.getCurImage = function() {
if (tdv_sdk.gameList[tdv_sdk.currentLevel]) {
return tdv_sdk.gameList[tdv_sdk.currentLevel].image;
}
return "";
};
tdv_sdk.getCurText = function() {
if (tdv_sdk.gameList[tdv_sdk.currentLevel]) {
return tdv_sdk.gameList[tdv_sdk.currentLevel].text;
}
return "";
};
tdv_sdk.isPair = function() {
if (tdv_sdk.gameList[tdv_sdk.currentLevel]) {
return tdv_sdk.gameList[tdv_sdk.currentLevel].is_pair ? 1 : 0;
}
return 0;
};
tdv_sdk.playAudio = function(url) {
if (window.audio && !window.audio.paused) {
window.audio.pause();
}
window.audio = new Audio(url);
window.audio.play();
};
tdv_sdk.playAudioImage = function() {
if (tdv_sdk.gameList[tdv_sdk.currentLevel]) {
tdv_sdk.playAudio(tdv_sdk.gameList[tdv_sdk.currentLevel].audio_image);
}
};
tdv_sdk.playAudioText = function() {
if (tdv_sdk.gameList[tdv_sdk.currentLevel]) {
tdv_sdk.playAudio(tdv_sdk.gameList[tdv_sdk.currentLevel].audio_text);
}
};
tdv_sdk.nextLevel = function() {
if (tdv_sdk.currentLevel < tdv_sdk.max_question) {
tdv_sdk.currentLevel++;
}
};
tdv_sdk.addScore = function() {
tdv_sdk.score++;
};
tdv_sdk.getScore = function() {
return tdv_sdk.score;
};