439 lines
No EOL
21 KiB
JavaScript
439 lines
No EOL
21 KiB
JavaScript
// Questions database for the Educational Tic Tac Toe game
|
||
// Organized by language, category, and question type
|
||
|
||
const questionsDB = {
|
||
english: {
|
||
math: {
|
||
truefalse: [
|
||
{
|
||
question: "The sum of angles in a triangle is 180 degrees.",
|
||
answer: true,
|
||
explanation: "In Euclidean geometry, the sum of the angles in any triangle is 180 degrees."
|
||
},
|
||
{
|
||
question: "Pi (π) is exactly equal to 22/7.",
|
||
answer: false,
|
||
explanation: "22/7 is just an approximation of pi. Pi is an irrational number."
|
||
},
|
||
{
|
||
question: "Any number raised to the power of 0 equals 1.",
|
||
answer: true,
|
||
explanation: "By definition, any non-zero number raised to the power of 0 equals 1."
|
||
},
|
||
{
|
||
question: "The square root of 4 is 2.",
|
||
answer: true,
|
||
explanation: "The square root of 4 is 2 because 2 × 2 = 4."
|
||
},
|
||
{
|
||
question: "There are 13 prime numbers less than 40.",
|
||
answer: false,
|
||
explanation: "There are 12 prime numbers less than 40: 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, and 37."
|
||
}
|
||
],
|
||
multiplechoice: [
|
||
{
|
||
question: "What is 7 × 8?",
|
||
options: ["54", "56", "64", "72"],
|
||
answer: 1,
|
||
explanation: "7 × 8 = 56"
|
||
},
|
||
{
|
||
question: "Which of these is a prime number?",
|
||
options: ["15", "21", "27", "29"],
|
||
answer: 3,
|
||
explanation: "29 is a prime number because it is only divisible by 1 and itself."
|
||
},
|
||
{
|
||
question: "What is the area of a square with sides of length 5?",
|
||
options: ["10", "20", "25", "30"],
|
||
answer: 2,
|
||
explanation: "The area of a square is side length squared: 5² = 25"
|
||
},
|
||
{
|
||
question: "If x + 5 = 12, what is x?",
|
||
options: ["5", "7", "12", "17"],
|
||
answer: 1,
|
||
explanation: "x + 5 = 12, so x = 12 - 5 = 7"
|
||
},
|
||
{
|
||
question: "What is the next number in the sequence: 2, 4, 8, 16, ...?",
|
||
options: ["24", "32", "36", "64"],
|
||
answer: 1,
|
||
explanation: "Each number is doubled to get the next number. 16 × 2 = 32"
|
||
}
|
||
]
|
||
}
|
||
},
|
||
arabic: {
|
||
islamic: {
|
||
multiplechoice: [
|
||
{
|
||
question: "س: من هو النبي محمد ﷺ؟",
|
||
options: [
|
||
"هو محمد بن عبد الله بن عبد المطلب، آخر الأنبياء والمرسلين",
|
||
"هو عيسى بن مريم، نبي من أنبياء الله",
|
||
"هو موسى بن عمران، كليم الله",
|
||
"هو إبراهيم الخليل، أبو الأنبياء"
|
||
],
|
||
answer: 0,
|
||
explanation: "ج: هو محمد بن عبد الله بن عبد المطلب، آخر الأنبياء والمرسلين"
|
||
},
|
||
{
|
||
question: "س: متى ولد النبي ﷺ؟",
|
||
options: [
|
||
"ولد يوم الاثنين 12 ربيع الأول في عام الفيل (حوالي سنة 571 ميلادية)",
|
||
"ولد يوم الجمعة 17 رمضان (حوالي سنة 570 ميلادية)",
|
||
"ولد يوم الأربعاء 10 محرم (حوالي سنة 569 ميلادية)",
|
||
"ولد يوم السبت 25 شوال (حوالي سنة 572 ميلادية)"
|
||
],
|
||
answer: 0,
|
||
explanation: "ج: ولد يوم الاثنين 12 ربيع الأول في عام الفيل (حوالي سنة 571 ميلادية)"
|
||
},
|
||
{
|
||
question: "س: لماذا سمي النبي ﷺ بالصادق الأمين؟",
|
||
options: [
|
||
"لأنه كان معروفًا بالصدق والأمانة بين الناس قبل البعثة",
|
||
"لأنه كان يحب الصدق ويكره الكذب",
|
||
"لأن قريش أطلقت عليه هذا اللقب بعد الهجرة",
|
||
"لأنه كان يأمر الناس بالصدق والأمانة"
|
||
],
|
||
answer: 0,
|
||
explanation: "ج: لأنه كان معروفًا بالصدق والأمانة بين الناس قبل البعثة."
|
||
},
|
||
{
|
||
question: "س: كم كان عمر النبي ﷺ عندما نزل عليه الوحي؟",
|
||
options: [
|
||
"30 سنة",
|
||
"35 سنة",
|
||
"40 سنة",
|
||
"45 سنة"
|
||
],
|
||
answer: 2,
|
||
explanation: "ج: كان عمره 40 سنة"
|
||
},
|
||
{
|
||
question: "س: أين نزل أول وحي على النبي ﷺ؟",
|
||
options: [
|
||
"في المسجد الحرام",
|
||
"في غار حراء بمكة",
|
||
"في بيته",
|
||
"في المدينة المنورة"
|
||
],
|
||
answer: 1,
|
||
explanation: "ج: في غار حراء بمكة"
|
||
},
|
||
{
|
||
question: "س: ما هي أول آية نزلت على النبي ﷺ؟",
|
||
options: [
|
||
"﴿اقْرَأْ بِاسْمِ رَبِّكَ الَّذِي خَلَقَ﴾",
|
||
"﴿بِسْمِ اللَّهِ الرَّحْمَنِ الرَّحِيمِ﴾",
|
||
"﴿الْحَمْدُ لِلَّهِ رَبِّ الْعَالَمِينَ﴾",
|
||
"﴿يَا أَيُّهَا الْمُدَّثِّرُ﴾"
|
||
],
|
||
answer: 0,
|
||
explanation: "ج: ﴿اقْرَأْ بِاسْمِ رَبِّكَ الَّذِي خَلَقَ﴾ (سورة العلق:1)."
|
||
}
|
||
]
|
||
},
|
||
beginners: {
|
||
truefalse: [
|
||
{
|
||
question: "كتاب = boek (Nederlands) / book (English)",
|
||
answer: true,
|
||
explanation: "Correct! كتاب betekent 'boek' in het Nederlands"
|
||
},
|
||
{
|
||
question: "قلم = tafel (Nederlands) / table (English)",
|
||
answer: false,
|
||
explanation: "Nee, قلم betekent 'pen' in het Nederlands. 'Tafel' is طاولة in het Arabisch"
|
||
},
|
||
{
|
||
question: "باب = deur (Nederlands) / door (English)",
|
||
answer: true,
|
||
explanation: "Correct! باب betekent 'deur' in het Nederlands"
|
||
},
|
||
{
|
||
question: "ماء = vuur (Nederlands) / fire (English)",
|
||
answer: false,
|
||
explanation: "Nee, ماء betekent 'water' in het Nederlands. 'Vuur' is نار in het Arabisch"
|
||
},
|
||
{
|
||
question: "شمس = zon (Nederlands) / sun (English)",
|
||
answer: true,
|
||
explanation: "Correct! شمس betekent 'zon' in het Nederlands"
|
||
},
|
||
{
|
||
question: "طعام = eten (Nederlands) / food (English)",
|
||
answer: true,
|
||
explanation: "Correct! طعام betekent 'eten' in het Nederlands"
|
||
},
|
||
{
|
||
question: "يد = voet (Nederlands) / foot (English)",
|
||
answer: false,
|
||
explanation: "Nee, يد betekent 'hand' in het Nederlands. 'Voet' is قدم in het Arabisch"
|
||
},
|
||
{
|
||
question: "قطة = kat (Nederlands) / cat (English)",
|
||
answer: true,
|
||
explanation: "Correct! قطة betekent 'kat' in het Nederlands"
|
||
},
|
||
{
|
||
question: "عين = oog (Nederlands) / eye (English)",
|
||
answer: true,
|
||
explanation: "Correct! عين betekent 'oog' in het Nederlands"
|
||
},
|
||
{
|
||
question: "أنف = oor (Nederlands) / ear (English)",
|
||
answer: false,
|
||
explanation: "Nee, أنف betekent 'neus' in het Nederlands. 'Oor' is أذن in het Arabisch"
|
||
},
|
||
{
|
||
question: "فم = mond (Nederlands) / mouth (English)",
|
||
answer: true,
|
||
explanation: "Correct! فم betekent 'mond' in het Nederlands"
|
||
},
|
||
{
|
||
question: "رأس = haar (Nederlands) / hair (English)",
|
||
answer: false,
|
||
explanation: "Nee, رأس betekent 'hoofd' in het Nederlands. 'Haar' is شعر in het Arabisch"
|
||
},
|
||
{
|
||
question: "قدم = voet (Nederlands) / foot (English)",
|
||
answer: true,
|
||
explanation: "Correct! قدم betekent 'voet' in het Nederlands"
|
||
},
|
||
{
|
||
question: "أب = moeder (Nederlands) / mother (English)",
|
||
answer: false,
|
||
explanation: "Nee, أب betekent 'vader' in het Nederlands. 'Moeder' is أم in het Arabisch"
|
||
},
|
||
{
|
||
question: "أخ = broer (Nederlands) / brother (English)",
|
||
answer: true,
|
||
explanation: "Correct! أخ betekent 'broer' in het Nederlands"
|
||
},
|
||
{
|
||
question: "جد = opa (Nederlands) / grandfather (English)",
|
||
answer: true,
|
||
explanation: "Correct! جد betekent 'opa' in het Nederlands"
|
||
},
|
||
{
|
||
question: "جدة = tante (Nederlands) / aunt (English)",
|
||
answer: false,
|
||
explanation: "Nee, جدة betekent 'oma' in het Nederlands. 'Tante' is عمة of خالة in het Arabisch"
|
||
},
|
||
{
|
||
question: "صديق = vriend (Nederlands) / friend (English)",
|
||
answer: true,
|
||
explanation: "Correct! صديق betekent 'vriend' in het Nederlands"
|
||
},
|
||
{
|
||
question: "مطبخ = badkamer (Nederlands) / bathroom (English)",
|
||
answer: false,
|
||
explanation: "Nee, مطبخ betekent 'keuken' in het Nederlands. 'Badkamer' is حمام in het Arabisch"
|
||
},
|
||
{
|
||
question: "غرفة = kamer (Nederlands) / room (English)",
|
||
answer: true,
|
||
explanation: "Correct! غرفة betekent 'kamer' in het Nederlands"
|
||
},
|
||
{
|
||
question: "سرير = stoel (Nederlands) / chair (English)",
|
||
answer: false,
|
||
explanation: "Nee, سرير betekent 'bed' in het Nederlands. 'Stoel' is كرسي in het Arabisch"
|
||
},
|
||
{
|
||
question: "طاولة = tafel (Nederlands) / table (English)",
|
||
answer: true,
|
||
explanation: "Correct! طاولة betekent 'tafel' in het Nederlands"
|
||
},
|
||
{
|
||
question: "حليب = melk (Nederlands) / milk (English)",
|
||
answer: true,
|
||
explanation: "Correct! حليب betekent 'melk' in het Nederlands"
|
||
},
|
||
{
|
||
question: "بيضة = kaas (Nederlands) / cheese (English)",
|
||
answer: false,
|
||
explanation: "Nee, بيضة betekent 'ei' in het Nederlands. 'Kaas' is جبن in het Arabisch"
|
||
},
|
||
{
|
||
question: "لحم = vlees (Nederlands) / meat (English)",
|
||
answer: true,
|
||
explanation: "Correct! لحم betekent 'vlees' in het Nederlands"
|
||
}
|
||
],
|
||
multiplechoice: [
|
||
{
|
||
question: "بيت",
|
||
options: ["Auto / Car", "Huis / House", "School / School", "Boom / Tree"],
|
||
answer: 1,
|
||
explanation: "Correct! بيت betekent 'huis' in het Nederlands (house in English)"
|
||
},
|
||
{
|
||
question: "مدرسة",
|
||
options: ["Ziekenhuis / Hospital", "Markt / Market", "School / School", "Bibliotheek / Library"],
|
||
answer: 2,
|
||
explanation: "Correct! مدرسة betekent 'school' in het Nederlands"
|
||
},
|
||
{
|
||
question: "سيارة",
|
||
options: ["Auto / Car", "Bus / Bus", "Fiets / Bicycle", "Trein / Train"],
|
||
answer: 0,
|
||
explanation: "Correct! سيارة betekent 'auto' in het Nederlands (car in English)"
|
||
},
|
||
{
|
||
question: "قمر",
|
||
options: ["Ster / Star", "Zon / Sun", "Maan / Moon", "Planeet / Planet"],
|
||
answer: 2,
|
||
explanation: "Correct! قمر betekent 'maan' in het Nederlands (moon in English)"
|
||
},
|
||
{
|
||
question: "كلب",
|
||
options: ["Kat / Cat", "Hond / Dog", "Vogel / Bird", "Vis / Fish"],
|
||
answer: 1,
|
||
explanation: "Correct! كلب betekent 'hond' in het Nederlands (dog in English)"
|
||
},
|
||
{
|
||
question: "طفل",
|
||
options: ["Man / Man", "Vrouw / Woman", "Kind / Child", "Opa / Grandfather"],
|
||
answer: 2,
|
||
explanation: "Correct! طفل betekent 'kind' in het Nederlands (child in English)"
|
||
},
|
||
{
|
||
question: "فاكهة",
|
||
options: ["Fruit / Fruit", "Groente / Vegetable", "Vlees / Meat", "Brood / Bread"],
|
||
answer: 0,
|
||
explanation: "Correct! فاكهة betekent 'fruit' in het Nederlands"
|
||
},
|
||
{
|
||
question: "نافذة",
|
||
options: ["Deur / Door", "Raam / Window", "Muur / Wall", "Vloer / Floor"],
|
||
answer: 1,
|
||
explanation: "Correct! نافذة betekent 'raam' in het Nederlands (window in English)"
|
||
},
|
||
{
|
||
question: "شعر",
|
||
options: ["Haar / Hair", "Oog / Eye", "Neus / Nose", "Oor / Ear"],
|
||
answer: 0,
|
||
explanation: "Correct! شعر betekent 'haar' in het Nederlands (hair in English)"
|
||
},
|
||
{
|
||
question: "أذن",
|
||
options: ["Neus / Nose", "Mond / Mouth", "Oor / Ear", "Tand / Tooth"],
|
||
answer: 2,
|
||
explanation: "Correct! أذن betekent 'oor' in het Nederlands (ear in English)"
|
||
},
|
||
{
|
||
question: "أم",
|
||
options: ["Vader / Father", "Moeder / Mother", "Zus / Sister", "Broer / Brother"],
|
||
answer: 1,
|
||
explanation: "Correct! أم betekent 'moeder' in het Nederlands (mother in English)"
|
||
},
|
||
{
|
||
question: "أخت",
|
||
options: ["Oom / Uncle", "Tante / Aunt", "Broer / Brother", "Zus / Sister"],
|
||
answer: 3,
|
||
explanation: "Correct! أخت betekent 'zus' in het Nederlands (sister in English)"
|
||
},
|
||
{
|
||
question: "خبز",
|
||
options: ["Brood / Bread", "Kaas / Cheese", "Melk / Milk", "Ei / Egg"],
|
||
answer: 0,
|
||
explanation: "Correct! خبز betekent 'brood' in het Nederlands (bread in English)"
|
||
},
|
||
{
|
||
question: "ماء",
|
||
options: ["Koffie / Coffee", "Thee / Tea", "Water / Water", "Sap / Juice"],
|
||
answer: 2,
|
||
explanation: "Correct! ماء betekent 'water' in het Nederlands"
|
||
},
|
||
{
|
||
question: "تفاحة",
|
||
options: ["Banaan / Banana", "Appel / Apple", "Sinaasappel / Orange", "Aardbei / Strawberry"],
|
||
answer: 1,
|
||
explanation: "Correct! تفاحة betekent 'appel' in het Nederlands (apple in English)"
|
||
},
|
||
{
|
||
question: "موز",
|
||
options: ["Appel / Apple", "Peer / Pear", "Banaan / Banana", "Druif / Grape"],
|
||
answer: 2,
|
||
explanation: "Correct! موز betekent 'banaan' in het Nederlands (banana in English)"
|
||
},
|
||
{
|
||
question: "برتقال",
|
||
options: ["Aardbei / Strawberry", "Sinaasappel / Orange", "Citroen / Lemon", "Kiwi / Kiwi"],
|
||
answer: 1,
|
||
explanation: "Correct! برتقال betekent 'sinaasappel' in het Nederlands (orange in English)"
|
||
},
|
||
{
|
||
question: "دجاج",
|
||
options: ["Vlees / Meat", "Vis / Fish", "Kip / Chicken", "Varken / Pork"],
|
||
answer: 2,
|
||
explanation: "Correct! دجاج betekent 'kip' in het Nederlands (chicken in English)"
|
||
},
|
||
{
|
||
question: "سمك",
|
||
options: ["Kip / Chicken", "Vlees / Meat", "Varken / Pork", "Vis / Fish"],
|
||
answer: 3,
|
||
explanation: "Correct! سمك betekent 'vis' in het Nederlands (fish in English)"
|
||
},
|
||
{
|
||
question: "جبن",
|
||
options: ["Kaas / Cheese", "Boter / Butter", "Yoghurt / Yogurt", "Room / Cream"],
|
||
answer: 0,
|
||
explanation: "Correct! جبن betekent 'kaas' in het Nederlands (cheese in English)"
|
||
},
|
||
{
|
||
question: "بيضة",
|
||
options: ["Melk / Milk", "Ei / Egg", "Boter / Butter", "Suiker / Sugar"],
|
||
answer: 1,
|
||
explanation: "Correct! بيضة betekent 'ei' in het Nederlands (egg in English)"
|
||
},
|
||
{
|
||
question: "كرسي",
|
||
options: ["Tafel / Table", "Stoel / Chair", "Kast / Cabinet", "Bed / Bed"],
|
||
answer: 1,
|
||
explanation: "Correct! كرسي betekent 'stoel' in het Nederlands (chair in English)"
|
||
},
|
||
{
|
||
question: "سرير",
|
||
options: ["Kast / Cabinet", "Tafel / Table", "Stoel / Chair", "Bed / Bed"],
|
||
answer: 3,
|
||
explanation: "Correct! سرير betekent 'bed' in het Nederlands (bed in English)"
|
||
},
|
||
{
|
||
question: "مطبخ",
|
||
options: ["Keuken / Kitchen", "Badkamer / Bathroom", "Slaapkamer / Bedroom", "Woonkamer / Living room"],
|
||
answer: 0,
|
||
explanation: "Correct! مطبخ betekent 'keuken' in het Nederlands (kitchen in English)"
|
||
},
|
||
{
|
||
question: "حمام",
|
||
options: ["Slaapkamer / Bedroom", "Woonkamer / Living room", "Badkamer / Bathroom", "Keuken / Kitchen"],
|
||
answer: 2,
|
||
explanation: "Correct! حمام betekent 'badkamer' in het Nederlands (bathroom in English)"
|
||
}
|
||
]
|
||
}
|
||
}
|
||
};
|
||
|
||
// Function to get a random question based on settings
|
||
function getRandomQuestion(language, category, type) {
|
||
// Validate parameters
|
||
if (!questionsDB[language] || !questionsDB[language][category] || !questionsDB[language][category][type]) {
|
||
console.error(`Invalid question parameters: ${language}, ${category}, ${type}`);
|
||
return null;
|
||
}
|
||
|
||
// Get the questions array
|
||
const questions = questionsDB[language][category][type];
|
||
|
||
// Return a random question
|
||
return questions[Math.floor(Math.random() * questions.length)];
|
||
}
|
||
|
||
// Export the function for use in other files
|
||
window.getRandomQuestion = getRandomQuestion; |