상위 Story
목표
시험 답안 제출 및 결과 처리 로직 구현
API 연동
POST /vocab/test/{userId}/submit
Request
{
"testId": "uuid",
"answers": [
{"questionId": 1, "wordId": "uuid", "answer": "apple"},
{"questionId": 2, "wordId": "uuid", "answer": "book"}
]
}
Response
{
"testId": "uuid",
"totalQuestions": 20,
"correctCount": 18,
"incorrectCount": 2,
"successRate": 90.0,
"results": [
{
"questionId": 1,
"isCorrect": true,
"userAnswer": "apple",
"correctAnswer": "apple"
}
]
}
처리 로직
- 모든 문제 풀이 완료 or 타이머 종료
- 답안 배열 생성
- API 제출
- 결과 페이지로 이동 (/vocab/test/result/:testId)
완료 조건
상위 Story
목표
시험 답안 제출 및 결과 처리 로직 구현
API 연동
POST /vocab/test/{userId}/submitRequest
{ "testId": "uuid", "answers": [ {"questionId": 1, "wordId": "uuid", "answer": "apple"}, {"questionId": 2, "wordId": "uuid", "answer": "book"} ] }Response
{ "testId": "uuid", "totalQuestions": 20, "correctCount": 18, "incorrectCount": 2, "successRate": 90.0, "results": [ { "questionId": 1, "isCorrect": true, "userAnswer": "apple", "correctAnswer": "apple" } ] }처리 로직
완료 조건