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

// Check pass marks for ICT subject (ID 54) for class 10
echo "<h2>Checking ICT subject pass marks</h2>";

$stmt = $pdo->prepare("SELECT * FROM subject_mark_distribution WHERE subject_id = 54 AND class_id = 10 AND session = '2025' AND exam_type = 'final'");
$stmt->execute();
$smd = $stmt->fetchAll();

echo "<h3>Subject Mark Distribution:</h3>";
if ($smd) {
    foreach ($smd as $dist) {
        echo "<p>Total Marks: " . $dist['total_marks'] . ", Pass Marks: " . $dist['overall_pass_marks'] . "</p>";
    }
} else {
    echo "<p>No subject_mark_distribution found</p>";
}

// Check mark_distributions as fallback
$stmt = $pdo->prepare("SELECT * FROM mark_distributions WHERE subject_id = 54 AND class_id = 10 AND session = '2025' AND exam_type = 'final'");
$stmt->execute();
$md = $stmt->fetchAll();

echo "<h3>Mark Distributions:</h3>";
if ($md) {
    foreach ($md as $dist) {
        echo "<p>Total Marks: " . $dist['total_marks'] . ", Pass Marks: " . $dist['pass_marks'] . "</p>";
    }
} else {
    echo "<p>No mark_distributions found</p>";
}
?>