update
This commit is contained in:
@@ -3,7 +3,7 @@ import { useNavigate } from '@tanstack/react-router'
|
||||
import { CircularProgress } from '@/components/CircularProgress'
|
||||
import { useTestStore } from '@/store/test-store'
|
||||
import { TOEIC_PARTS } from '@/temp/local-data'
|
||||
import { fetchQuestions } from '@/hooks/use-questions'
|
||||
import { fetchQuestionsForTest } from '@/hooks/use-questions'
|
||||
import { useRequireAuth } from '@/hooks/use-require-auth'
|
||||
|
||||
export function ToeicPractice() {
|
||||
@@ -16,8 +16,9 @@ export function ToeicPractice() {
|
||||
if (!requireAuth()) return
|
||||
setLoadingPartId(partId)
|
||||
try {
|
||||
const questions = await fetchQuestions(partId, 10)
|
||||
startExam(partId, partName, questions)
|
||||
// TODO: replace hardcoded testId=1 with real test selection
|
||||
const parts = await fetchQuestionsForTest(1, [partId])
|
||||
startExam({ testId: 1, testName: partName, parts, totalSeconds: 0 })
|
||||
navigate({ to: '/toeic/session' })
|
||||
} catch (err) {
|
||||
console.error('Failed to load questions:', err)
|
||||
|
||||
Reference in New Issue
Block a user