feat: Update Curriculum Studio with AI Assets panel to manually generate and input NotebookLM assets

This commit is contained in:
Hamza-Ayed
2026-08-29 02:01:52 +03:00
parent 074c08fc6f
commit 135a379b32
5 changed files with 217 additions and 5 deletions
@@ -156,6 +156,31 @@ class CurriculumService
return "# محتوى المنهاج\nالمحتوى المعتمد للمنهاج الرسمي.";
}
public static function saveLessonAiAssets(string $relativePath, array $assets): bool
{
self::ensureStorage();
$baseName = preg_replace('/\.md$/i', '', ltrim($relativePath, '/'));
$jsonPath = self::$storagePath . '/' . $baseName . '_ai_assets.json';
$dir = dirname($jsonPath);
if (!is_dir($dir)) {
mkdir($dir, 0777, true);
}
return file_put_contents($jsonPath, json_encode($assets, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT)) !== false;
}
public static function getLessonAiAssets(string $relativePath): array
{
self::ensureStorage();
$baseName = preg_replace('/\.md$/i', '', ltrim($relativePath, '/'));
$jsonPath = self::$storagePath . '/' . $baseName . '_ai_assets.json';
if (file_exists($jsonPath)) {
return json_decode(file_get_contents($jsonPath), true) ?: [];
}
return [];
}
/**
* Fast Keyword Search across All Markdown Files
*/