퀴즈 파일 A단계: 관리자 → 퀴즈 '파일로 만들기'(.xlsx·.csv를 브라우저가 라이브러리 없이 읽음, 열 이름으로 링크·정답·설명·힌트·순번 인식, 시트 선택, 잘못된 링크·중복 영상 표시), 편집 화면 '파일에서 가져오기'(뒤에 추가·목록 바꾸기)·'엑셀로 내보내기'·빈 양식. 파일 곡은 적힌 값 그대로(DB 연결·검토 대기 없음). 곡별 힌트를 하나씩 보여 준 뒤 초성 힌트(자동은 N초마다, 투표는 한 번에 하나)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
EJClaw
2026-10-23 18:06:28 +09:00
parent e44df482a6
commit 3c5e26f9b7
23 changed files with 1285 additions and 55 deletions

View File

@@ -30,6 +30,8 @@ export interface QuizSong {
/** Main artist ids (same singer not twice in a row, docs/05 출제 목록). */
artistIds: number[];
lyrics: string | null;
/** 제작된 퀴즈: the song's own hints, shown one by one before the 초성 hint. */
hints?: string[];
}
export function quizSong(db: Database, id: number): QuizSong | null {
@@ -73,9 +75,9 @@ export function quizSong(db: Database, id: number): QuizSong | null {
export function quizItemSong(db: Database, quizId: number, itemId: number): QuizSong | null {
const it = db
.query<
{ id: number; song_id: number | null; video_id: string; title: string; artist: string; title_answers: string; artist_answers: string; duration_sec: number | null; auto: number; start_sec: number | null; highlight_sec: number | null },
{ id: number; song_id: number | null; video_id: string; title: string; artist: string; title_answers: string; artist_answers: string; hints: string; duration_sec: number | null; auto: number; start_sec: number | null; highlight_sec: number | null },
[number, number]
>('SELECT id, song_id, video_id, title, artist, title_answers, artist_answers, duration_sec, auto, start_sec, highlight_sec FROM custom_quiz_items WHERE quiz_id = ? AND id = ?')
>('SELECT id, song_id, video_id, title, artist, title_answers, artist_answers, hints, duration_sec, auto, start_sec, highlight_sec FROM custom_quiz_items WHERE quiz_id = ? AND id = ?')
.get(quizId, itemId);
if (!it) return null;
const base = it.song_id ? quizSong(db, it.song_id) : null;
@@ -103,6 +105,7 @@ export function quizItemSong(db: Database, quizId: number, itemId: number): Quiz
artistAliases: uniq([...(JSON.parse(it.artist_answers) as string[]), ...(base ? [base.artist, ...base.artistAliases] : [])]),
artistIds: base?.artistIds ?? [],
lyrics: base?.lyrics ?? null,
hints: JSON.parse(it.hints) as string[],
};
}