& Content in Quizz Section & Add Layer Credit

This commit is contained in:
2026-05-06 10:39:07 +02:00
parent 520b06ee81
commit 8cbb76d2f3
4 changed files with 571 additions and 646 deletions
+4 -3
View File
@@ -27,7 +27,7 @@ try {
$queries = [];
$seed = date('Ymd');
foreach ($tablesAutorisees as $key => $table) {
$queries[] = "(SELECT explanation, planete_nom FROM $table WHERE explanation IS NOT NULL AND explanation != '' ORDER BY RAND($seed) LIMIT 3)";
$queries[] = "(SELECT explanation, planete_nom, url FROM $table WHERE explanation IS NOT NULL AND explanation != '' ORDER BY RAND($seed) LIMIT 3)";
}
$unionQuery = implode(' UNION ALL ', $queries);
@@ -61,9 +61,10 @@ try {
$text = substr($row['explanation'], 0, 200) . '...';
$questions[] = [
'q' => "De quel astre parle cette description ? « " . $text . " »",
'q' => "De quel astre parle cette description ? « " . $text . " »",
'options' => $optionsFr,
'a' => $correctFr
'a' => $correctFr,
'img' => isset($row['url']) ? $row['url'] : ''
];
}