Skip to content

feat: multi-exam platform upgrade for Questionless#1

Open
888wing wants to merge 1 commit intomainfrom
claude/suspicious-murdock
Open

feat: multi-exam platform upgrade for Questionless#1
888wing wants to merge 1 commit intomainfrom
claude/suspicious-murdock

Conversation

@888wing
Copy link
Owner

@888wing 888wing commented Feb 23, 2026

Summary

  • Data Architecture: Added exam column to DB schema, centralized exam/topic config in exams.ts with ExamConfig interface supporting Life in the UK + UK Driving Theory
  • Homepage Redesign: Multi-exam hero with dual CTAs, exam cards (2 active + 2 coming soon), How It Works, FAQ with schema markup, comparison table, enhanced footer
  • Content Expansion: Expanded Life in UK from 499→1039 questions, generated 478 Driving Theory questions across 10 topics (1,517 total)
  • Multi-exam Routing: /exams directory, /exams/[exam] detail pages, /exams/[exam]/practice/[topic] practice routes, dynamic sitemap (21 URLs)
  • Infrastructure: Applied D1 migrations (0004-0006) to remote, deployed to Cloudflare Pages, fixed sitemap.xml middleware interception

Test Plan

  • ESLint passes with zero warnings/errors
  • Homepage renders: hero, exam cards, How It Works, FAQ, comparison, footer
  • /exams page shows 2 active + 2 coming soon exam cards
  • /exams/driving-theory shows all 10 topics with practice links
  • Sitemap returns valid XML with 21 URLs
  • D1 database: 1,039 life-in-uk + 478 driving-theory = 1,517 questions
  • Cloudflare Pages build succeeds (31 edge functions)

🤖 Generated with Claude Code

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>
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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">

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant