<?php
// Script to fix the Bangla subject calculation for marks_obtained

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

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

$content = str_replace($search, $replace, $content);

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