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

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

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

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

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