<?php
// Script to fix the Bangla subject calculation - obtained marks should be sum of CQ avg and MCQ avg

$file_path = 'reports/all_subjects_marksheet.php';
$content = file_get_contents($file_path);

// Fix the Bangla subject combination logic
$content = str_replace(
    '$combined[\'marks_obtained\'] = $combined[\'marks_obtained\'] / $count;',
    '// For Bangla: obtained marks = CQ average + MCQ average (as per user requirement)' . "\n" . '        $combined[\'marks_obtained\'] = $combined[\'cq_marks\'] + $combined[\'mcq_marks\'];',
    $content
);

file_put_contents($file_path, $content);
echo "Bangla calculation fixed successfully!\n";
?>