--- lib/domain/content-form.ts
+++ lib/domain/content-form.ts
... | ... | @@ -7,7 +7,6 @@ |
| 7 | 7 |
ANSWER_MESSAGE_ETC, |
| 8 | 8 |
ANSWER_MESSAGE_OPTIONS, |
| 9 | 9 |
MIN_COMIC_CUTS, |
| 10 |
- QUIZ_ANSWER_OPTIONS, |
|
| 11 | 10 |
QUIZ_LEVEL_OPTIONS, |
| 12 | 11 |
gradesOf, |
| 13 | 12 |
type ContentKeyword, |
... | ... | @@ -82,7 +81,7 @@ |
| 82 | 81 |
keywords: ContentKeyword[]; |
| 83 | 82 |
question: string; |
| 84 | 83 |
answer: string; |
| 85 |
- /** O·X 두 줄의 노출 문구. 정답이 아닌 쪽도 함께 보낸다(사용자 확정). */ |
|
| 84 |
+ /** 정답 선택지마다 한 줄씩의 노출 문구. 정답이 아닌 쪽도 함께 보낸다(사용자 확정). */ |
|
| 86 | 85 |
answerMessages: QuizAnswerMessage[]; |
| 87 | 86 |
explanation: string; |
| 88 | 87 |
isVisible: boolean; |
... | ... | @@ -235,7 +234,8 @@ |
| 235 | 234 |
|
| 236 | 235 |
export function validateQuizForm( |
| 237 | 236 |
values: QuizFormValues, |
| 238 |
- codes: SchoolGradeOptions |
|
| 237 |
+ codes: SchoolGradeOptions, |
|
| 238 |
+ answerOptions: readonly string[] |
|
| 239 | 239 |
): ValidationResult<QuizFormValues> {
|
| 240 | 240 |
const errors: ContentFormErrors = {};
|
| 241 | 241 |
validateGrades(values, codes, errors); |
... | ... | @@ -243,7 +243,7 @@ |
| 243 | 243 |
if (!QUIZ_LEVEL_OPTIONS.some((option) => option.value === values.level)) {
|
| 244 | 244 |
errors.level = '난이도를 선택해 주세요.'; |
| 245 | 245 |
} |
| 246 |
- if (!(QUIZ_ANSWER_OPTIONS as readonly string[]).includes(values.answer)) {
|
|
| 246 |
+ if (!answerOptions.includes(values.answer)) {
|
|
| 247 | 247 |
errors.answer = '정답을 선택해 주세요.'; |
| 248 | 248 |
} |
| 249 | 249 |
|
... | ... | @@ -262,7 +262,7 @@ |
| 262 | 262 |
errors |
| 263 | 263 |
); |
| 264 | 264 |
|
| 265 |
- // O·X 두 줄을 각각 검사한다 — 정답이 아닌 쪽도 보내므로 둘 다 유효해야 한다. |
|
| 265 |
+ // 정답 선택지 줄을 각각 검사한다 — 정답이 아닌 쪽도 보내므로 모두 유효해야 한다. |
|
| 266 | 266 |
const answerMessages = values.answerMessages.map((message) => {
|
| 267 | 267 |
if ( |
| 268 | 268 |
message.code !== '' && |
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?