<?php
require_once 'config/database.php';

$online_exam_id = 1;

// Fetch exam questions
$stmt = $pdo->prepare("SELECT * FROM online_exam_questions WHERE online_exam_id = ? ORDER BY id ASC");
$stmt->execute([$online_exam_id]);
$questions = $stmt->fetchAll();

echo "Questions for exam ID $online_exam_id:\n";
foreach ($questions as $index => $question) {
    echo "Index: " . ($index + 1) . " | DB ID: " . $question['id'] . " | Question: " . substr($question['question_text'], 0, 30) . "...\n";
    echo "  Name attribute should be: question" . $question['id'] . "\n";
}
?>