diff --git a/backend/app/Controllers/CurriculumController.php b/backend/app/Controllers/CurriculumController.php index 52b76b6..a5ccc3e 100644 --- a/backend/app/Controllers/CurriculumController.php +++ b/backend/app/Controllers/CurriculumController.php @@ -73,9 +73,10 @@ class CurriculumController error_reporting(E_ALL); ob_start(); - // Execute the script logic natively by setting argv - $argv = ['curriculum_worker.php', $taskId]; - $_SERVER['argv'] = $argv; + // CRITICAL: Set $GLOBALS['argv'] so the required worker script can access $argv[1] + // (In a web request, $argv is empty — we must set it globally before requiring the worker) + $GLOBALS['argv'] = ['curriculum_worker.php', $taskId]; + $_SERVER['argv'] = $GLOBALS['argv']; require $scriptPath; diff --git a/backend/app/Views/StudentPortal.php b/backend/app/Views/StudentPortal.php index fe01635..15397e3 100644 --- a/backend/app/Views/StudentPortal.php +++ b/backend/app/Views/StudentPortal.php @@ -637,7 +637,7 @@ class StudentPortal -
+