Exam 모듈
시험 생성, OMR 채점, 성적 분석을 담당하는 핵심 모듈입니다. 동기/비동기 OMR 채점, 상대/절대평가, 통계 분석 등 포괄적인 시험 관리 기능을 제공합니다.
모듈 개요
- 배포: lumie-backend 모놀리스의
modules/exam - 데이터베이스: PostgreSQL (멀티테넌트 RLS)
- 메시징: RabbitMQ (비동기 OMR 채점)
- 스토리지: MinIO (OMR 이미지 저장)
- 주요 의존성:
BillingService(internal-api), 외부 grading-svc(lumie-worker)
주요 기능
시험 관리
- 시험 생성 및 관리 (상대평가/절대평가/합불제)
- 시험 템플릿 관리
- 문항별 배점 및 정답 설정
- 등급 체계 설정 (9등급제/5등급제)
OMR 채점
- 단일 이미지 동기 채점
- 대량 이미지 비동기 배치 채점
- Presigned URL 기반 직접 업로드
- 전화번호 기반 학생 매칭
- 채점 결과 자동 저장
성적 분석
- 시험별 통계 (평균, 표준편차, 등급 분포)
- 학생별 성적 추이 분석
- 문항별 정답률 분석
- 학원별 성취도 비교
리포트 생성
- 학생별 성적표 이미지 생성
- AI 서비스 연동을 통한 리포트 생성
API 엔드포인트
시험 관리 API
시험 생성
POST /v1/exams
Content-Type: application/json
{
"name": "2024년 3월 모의고사",
"category": "GRADED",
"gradingType": "RELATIVE",
"gradeScale": "NINE_GRADE",
"totalQuestions": 30,
"correctAnswers": {
"1": "2", "2": "4", "3": "1"
},
"questionScores": {
"1": 3, "2": 3, "3": 4
},
"questionTypes": {
"1": "수학", "2": "수학", "3": "영어"
},
"passScore": 60
}
시험 목록 조회
GET /v1/exams?page=0&size=20
시험 상세 조회 (관리자용)
GET /v1/exams/{id}/detail
OMR 채점 API
단일 OMR 채점 (동기)
POST /v1/results/omr-grading/{examId}?studentId=123
Content-Type: multipart/form-data
image: omr_sheet.png
Presigned URL 생성 (배치 업로드용)
POST /v1/results/presigned-urls/{examId}
Content-Type: application/json
{
"fileNames": ["omr1.png", "omr2.png", "omr3.png"]
}
응답:
{
"batchKey": "abc12345",
"uploads": [
{
"fileName": "omr1.png",
"objectKey": "omr/tmp/c704d223/abc12345/omr1.png",
"uploadUrl": "https://minio.example.com/bucket/path?signature=..."
}
]
}
배치 OMR 채점 확인 (비동기)
POST /v1/results/batch-omr-grading/{examId}
Content-Type: application/json
{
"objectKeys": [
"omr/tmp/c704d223/abc12345/omr1.png",
"omr/tmp/c704d223/abc12345/omr2.png"
]
}
응답:
{
"jobId": 456
}
채점 작업 상태 조회
GET /v1/results/omr-jobs/{examId}/{jobId}/status
응답:
{
"jobId": 456,
"examId": 123,
"status": "COMPLETED",
"totalImages": 50,
"processedImages": 50,
"successCount": 48,
"failCount": 2,
"savedCount": 45,
"results": [
{
"fileName": "omr1.png",
"success": true,
"saved": true,
"phoneNumber": "1234-5678",
"studentId": 789,
"studentName": "김학생",
"totalScore": 85,
"grade": 2,
"resultId": 101
}
],
"createdAt": "2024-01-15T10:30:00Z"
}
성적 조회 API
시험 결과 목록
GET /v1/results/exam/{examId}
학생 성적 목록
GET /v1/results/student/{studentId}
문항별 결과
GET /v1/results/{resultId}/questions
OMR 이미지 조회
GET /v1/results/{resultId}/omr-image
Accept: image/png
통계 분석 API
시험 전체 통계
GET /v1/statistics/exam/{examId}
응답 예시:
{
"examId": 1,
"examName": "2024년 3월 모의고사",
"category": "GRADED",
"gradingType": "RELATIVE",
"gradeScale": "NINE_GRADE",
"participantCount": 150,
"average": 72.5,
"highest": 98,
"lowest": 32,
"standardDeviation": 15.2,
"gradeDistribution": [
{"grade": 1, "count": 7, "percentage": 4.7, "cutoffScore": 92},
{"grade": 2, "count": 15, "percentage": 10.0, "cutoffScore": 85}
],
"scoreRangeDistribution": [
{"range": "90-100", "count": 12, "percentage": 8.0},
{"range": "80-89", "count": 35, "percentage": 23.3}
]
}
학생 성적 목록 (페이지네이션)
GET /v1/statistics/exam/{examId}/students?page=0&size=20
선지별 선택률 분석
GET /v1/statistics/exam/{examId}/choice-distribution
학생 백분위/석차 조회
GET /v1/statistics/student/{studentId}/exam/{examId}/rank
대시보드 통계 조회
GET /v1/statistics/dashboard