CurriculumStructure
교육과정 Chapter 트리 — 트래버설 / path / 구조 감사 checklist + verdict 집계 (Pure)
상태
| 항목 | 값 |
|---|---|
| Layer | core |
| Tier | L1 |
| Status | wip |
| Version | 0.9.0 |
| 가격 | Free (free) |
| **카� | |
| �고리** | Learning |
개요
개요
CurriculumStructure 는 multi-saas-kit 의 Layer 1 Core Plugin � 니다. 교육과정의 Chapter 계층 구조 (대단원 → 중단원 → 레슨) 를 다루는 표준 트래버설, path builder, 구조 감사 checklist, audit verdict 집계를 모델 의존 없이 Pure 로 제공합니다.
핵심 컴포넌트
ChapterNode (DTO)
Eloquent Chapter Model 의 부분집합. 트리 처리에 필요한 6개 필드만 보유 (id, parent_id, name, depth, sort_order, slug). fromArray() / toArray() 변환 helper.
ChapterTreeTraversal (Pure)
exam.how ChapterStructureAuditService::getAncestors / getChildren / getSiblings 추출. DB 의존 제거 — �
력으로 ChapterNode 배열을 받아 처리:
| 메서드 | 결과 |
|---|---|
ancestors($all, $id) | root 우선 정렬된 부모 체인 |
children($all, $id) | 직접 자식 (sort_order asc) |
siblings($all, $id) | 자기 자신 제외 형제 (sort_order asc) |
descendants($all, $id) | 모든 후손 (재귀, 깊이우선) |
ChapterPathBuilder (Pure)
exam.how Chapter::getFullPathAttribute 추출. "대단원 > 중단원 > 레슨" 형식 path 생성. separator config 으로 변경 가능.
$path = $builder->build($allNodes, $chapterId);
// 예: '수와 연산 > 덧�
� > 두 자릿수 덧�
�'
AuditChecklist (Pure constant)
exam.how ChapterStructureAuditService::getChecklistLabels 추출. 6개 표준 카�
�고리:
| Key | 한국어 라벨 |
|---|---|
scope_alignment | 학� |
| �/학기 범위 적합성 | |
hierarchy_balance | 단원-레슨 계층 균형 |
coverage_gap | 구성 누락/과다 여부 |
naming_clarity | 단원/레슨 � |
| � | |
| � | |
| 확성 | |
sequence_prerequisite | 학습 순서/선수학습 |
redundancy_overlap | 중복/겹침 위험 |
LLM 결과를 6개 카� �고리로 분류해 운영자가 일관된 형식으로 검토.
AuditVerdictAggregator (Pure)
exam.how ChapterStructureAuditService::aggregateProviderAudits 의 핵심 로직 추출.
여러 provider 의 verdict 을 하나로 집계 — 우선순위: fail > warn > pass. 즉 provider 중 하나라도 fail 이면 fail, 그 외 warn 이 있으면 warn, 모두 pass 면 pass. config 으로 우선순위 변경 가능.
$aggregator->aggregate(['pass', 'pass', 'fail']); // 'fail'
$aggregator->aggregate(['pass', 'warn', 'pass']); // 'warn'
// 체크리스트별 집계
$aggregator->aggregateByChecklist([
'scope_alignment' => ['pass', 'pass'],
'hierarchy_balance' => ['warn', 'fail'],
]);
// ['scope_alignment' => 'pass', 'hierarchy_balance' => 'fail']
설정 (config/curriculum-structure.php)
return [
'enabled' => env('PLG_CURRICULUM_STRUCTURE_ENABLED', true),
'tree' => [
'max_depth' => 2,
'path_separator' => ' > ',
],
'audit_checklist' => [
'scope_alignment' => '학�
�/학기 범위 적합성',
'hierarchy_balance' => '단원-레슨 계층 균형',
// ... 6개
],
'verdict_priority' => [
'fail' => 0, 'warn' => 1, 'pass' => 2,
],
];
사용 예시
use App\Plugins\CurriculumStructure\Data\ChapterNode;
use App\Plugins\CurriculumStructure\Services\{ChapterTreeTraversal, ChapterPathBuilder, AuditVerdictAggregator};
use App\Plugins\CurriculumStructure\Constants\AuditChecklist;
// Eloquent → ChapterNode 변환 (한 번만)
$nodes = Chapter::all()->map(fn ($c) => ChapterNode::fromArray($c->toArray()))->all();
// 트래버설
$traversal = new ChapterTreeTraversal;
$ancestors = $traversal->ancestors($nodes, $chapter->id);
// Full path
$path = ChapterPathBuilder::fromConfig(config('curriculum-structure'))->build($nodes, $chapter->id);
// Audit verdict 집계 (LLM 호출 결과 → 1 verdict)
$verdict = AuditVerdictAggregator::fromConfig(config('curriculum-structure'))
->aggregateByChecklist($providerResults);
출처
exam.how 의 Chapter Model + ChapterStructureAuditService (562줄) 에서 모델 의존 없는 Pure 부분만 추출. LLM 호출 / 외부 API 부분은 프로젝트 잔류.
다른 Plugin 과의 관계
- QuestionGeneration (Layer 3 Domain) 가 chapter 컨� �스트로 문제 생성
- ContentReview 가 audit verdict 으로 검수 흐름
다음 단계 (Phase 3+)
- 표준
Chapter/Subject/CourseModel + Migration (선택 활성) - Filament Resource (관리자 chapter 트리 편집)
- LLM provider 통합 (외부 audit 호출)
- 깊이 검증 + sort_order 자동 보정
라이선스
MIT
데모
- Platform 관리자 패널에서 메타 확인 🔒 로그인 필요
- 사용 예시 (PHP)
🛒 Plugin Store에서 보기: store.codebase.how/plugins/curriculum-structure