feat: multi-exam platform upgrade for Questionless#1
Conversation
Phase 1 - Data Architecture: - Add exam column to DB schema (questions, mockExams tables) - Centralize exam/topic config in exams.ts (ExamConfig interface) - Support Life in the UK + UK Driving Theory exams Phase 2 - Homepage Redesign: - Multi-exam hero with dual CTAs - Exam cards section (2 active + 2 coming soon) - How It Works, FAQ, comparison table, enhanced footer - SEO metadata and FAQ schema markup Phase 3 - Content Expansion: - Expand Life in UK: 499 → 1039 questions - Generate UK Driving Theory: 478 questions (10 topics) - Total: 1,517 questions across 2 exams Phase 3.5 - Multi-exam Routing: - /exams directory page - /exams/[exam] detail pages - /exams/[exam]/practice/[topic] practice routes - Dynamic sitemap with all exam pages Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 89753cd549
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| // Fetch questions from API | ||
| async function fetchQuestions(topic: string): Promise<QuestionData[]> { | ||
| const baseUrl = process.env.NEXT_PUBLIC_APP_URL || 'http://localhost:3000'; |
There was a problem hiding this comment.
Remove localhost fallback for server-side question fetches
In fetchQuestions, building API URLs with process.env.NEXT_PUBLIC_APP_URL || 'http://localhost:3000' will break deployed practice pages whenever NEXT_PUBLIC_APP_URL is unset, because edge/server runtime fetches localhost instead of the app origin and silently returns empty question lists; this affects both topic practice flows that use this pattern. Use relative URLs (or derive origin from request headers) so production does not depend on a manually injected public env var.
Useful? React with 👍 / 👎.
| function ExamCard({ exam }: { exam: ExamConfig }) { | ||
| const Icon = exam.icon; | ||
| return ( | ||
| <Link href="/practice" className="block group"> |
There was a problem hiding this comment.
Route exam cards to the selected exam slug
The exam card link hard-codes /practice, so choosing an active non-default exam (for example driving theory) sends users into the Life-in-the-UK practice flow instead of the selected exam route, which effectively bypasses the exam-specific pages this commit introduced. The card should link to /exams/${exam.slug} (or the exam-specific practice path) to preserve the user's exam selection.
Useful? React with 👍 / 👎.
| const randomQuestions = await db | ||
| .select() | ||
| .from(questions) | ||
| .where(eq(questions.verified, true)) |
There was a problem hiding this comment.
Restrict mock-exam question selection to one exam
This query only filters on verified, so once multiple exam datasets are present the mock exam can mix questions from different exams; in this commit, driving-theory questions are inserted as verified, while the mock exam UX and scoring are explicitly Life-in-the-UK specific (24 questions, 75% pass). That produces invalid mock exams and misleading scores unless the selection is additionally scoped by exam.
Useful? React with 👍 / 👎.
| const result = await db | ||
| .select() | ||
| .from(questions) | ||
| .where(eq(questions.verified, true)) |
There was a problem hiding this comment.
Scope random-practice API results by exam
The random questions endpoint now pulls from all verified rows without an exam constraint, so /practice/random can return cross-exam content after this multi-exam migration (e.g., driving questions in the default Life-in-the-UK flow). That makes topic-agnostic practice sessions inconsistent with the selected product track and can pollute user progress data for the wrong exam.
Useful? React with 👍 / 👎.
Summary
examcolumn to DB schema, centralized exam/topic config inexams.tswithExamConfiginterface supporting Life in the UK + UK Driving Theory/examsdirectory,/exams/[exam]detail pages,/exams/[exam]/practice/[topic]practice routes, dynamic sitemap (21 URLs)Test Plan
/examspage shows 2 active + 2 coming soon exam cards/exams/driving-theoryshows all 10 topics with practice links🤖 Generated with Claude Code