travel_quiz#

Interactive quiz matching users to Cape Town neighbourhoods based on lifestyle preferences, travel style, and priorities.

Models#

Model

Description

Area

Geographic area grouping (Atlantic Seaboard, City Bowl, etc.)

Neighbourhood

Quiz-specific neighbourhood with 18 scoring attributes

Quiz

Quiz definition with title, intro, and active flag

Question

Quiz question with score attribute mappings

QuestionChoice

Choice option for a question with attribute boost

QuizResult

Saved result with top 3 recommendations and scores

Scoring System#

Each Neighbourhood has 18 score_* attributes (ocean, mountain, walkable, luxury, budget, social, quiet, wind_sensitive, no_car, has_car, views, nightlife, local_feel, surf, solo, couple, family, friends). Quiz answers map to these attributes via Question.score_attribute_high/low and QuestionChoice.score_attribute.

flowchart LR Q[Question] -->|high answer| ATTR_H[score_attribute_high] Q -->|low answer| ATTR_L[score_attribute_low] QC[QuestionChoice] -->|selected| ATTR_C[score_attribute] ATTR_H --> MATCH[Matching Algorithm] ATTR_L --> MATCH ATTR_C --> MATCH MATCH --> TOP3[Top 3 Neighbourhoods] TOP3 --> RESULT[QuizResult]

Key Design Decisions#

  • Separate Neighbourhood model from housing.Neighbourhood — the quiz neighbourhood has scoring attributes and simplified fields, while the housing model has full market data. They share name/slug for cross-referencing.

  • Flexible question types: scale (slider) and choice (radio buttons) with configurable attribute boosting.

  • Session-based results: session_key allows anonymous users to retrieve results without authentication.