---
name: alevel-business-sim
description: Builds interactive HTML exam-skills simulations ("games") for A-level Business (Eduqas specification) on a single named topic, in the exact style of the bundled reference template — a scored, multi-stage quiz/game with scenarios, an AO-chain builder, an "exam examiner" AO-spotting task, and a final context-judgement challenge. Use this skill whenever the user asks for an exam simulation, revision game, interactive quiz, or "sim" for an A-level Business topic (e.g. motivation theories, leadership styles, HR, marketing mix, cash flow, decision-making), or asks to reskin/regenerate the existing business simulation with a new topic, company, or colour scheme. Always trigger this for requests like "build me a sim for [topic]", "make an exam practice game like the other one but for X", or "same simulation, different topic/colours/company".
---

# A-level Business Exam Simulation Builder (Eduqas)

## What this skill produces

A **single self-contained HTML file** — no build step, no external backend — that is a scored, multi-stage interactive revision game for one A-level Business topic (Eduqas spec). It reuses the exact game engine, visual language, and pedagogical structure of the bundled reference template (`assets/template.html`, the "Summit Cycles" motivation simulation), but with:

- a **new fictional company name and industry** fitting the new topic
- a **new colour palette** (never default to blue/slate every time — vary it, see below)
- **entirely new scenarios, questions, distractors, and explanations** written for the new topic

The mechanics, state machine, scoring, lives system, and view structure are **not reinvented** — they are copied from the template and only the content (the `DB` object) and styling tokens are changed. This consistency is the point: students get a familiar interface, but fresh exam content.

## Step 0: Always read the template first

Before writing anything, `view` `assets/template.html` in full. Do not rely on memory of its structure — re-read it every time you use this skill, since exact function names, state fields, and CSS classes must be copied precisely or the game will break.

## Step 1: Understand the requested topic

This skill is bundled with the actual **WJEC Eduqas GCE A Level Business specification**
(teaching from 2015, v2 Jan 2019, entry code A510QS):

- `references/spec_map.md` — a condensed map of all three components' content areas,
  plus the exact AO1–AO4 definitions and weightings. **Read this first, every time** —
  don't rely on memory of the spec, and don't rely on memory of this file's contents
  either, since exact wording matters for calibrating question difficulty correctly.
- `references/eduqas-spec.pdf` — the full original spec, for the rare case where you
  need the precise "amplification" wording for a niche content point not fully captured
  in the map.

The user will typically just name a topic (e.g. "Herzberg", "break-even analysis", "types of growth", "cash flow forecasting", "influences on HR decisions"). You should:

- Match it against `spec_map.md` to identify which Component (1, 2, or 3) it sits in and which named theories/models/sub-points are relevant. If a topic genuinely isn't in the spec or spans multiple components, make a reasonable judgement call and proceed — don't block on asking, per the user's stated preference to just receive output.
- Decide the underlying **models/concepts** to test (e.g. for motivation: Taylor, Herzberg, Mayo, Maslow; for leadership: autocratic/democratic/laissez-faire; for finance: contribution, margin of safety, break-even formula). Pick enough distinct sub-concepts to fill the scenario count you choose in Step 2. Where the spec lists a named set of theories/methods (motivation theories, leadership styles, growth methods, investment appraisal methods), lean toward one scenario per theory/method — this is exactly the template's pattern.
- Note which Component the topic sits in, since Component 3 (Business in a Changing World) is the synoptic/evaluation-heavy paper — see `spec_map.md` for how this should shift the depth of your AO3/AO4 content.

## Step 2: Decide scale (don't just copy 3/2/2/1 blindly)

The reference template uses 3 quiz scenarios, 2 chain-builder tasks, 2 exam-spotting tasks, 1 context challenge. Treat this as a reasonable **default**, not a fixed rule:

- **Narrow topic** (e.g. "the elasticity of demand formula") → fewer scenarios (2), maybe skip the chain-builder stage entirely if there's no clear cause→effect→impact argument to build.
- **Broad topic** (e.g. "motivational theories" or "methods of growth") → 3–4 quiz scenarios, 2 chains, 2 exam tasks.
- **Quantitative topics** (break-even, ratios, investment appraisal) → keep the quiz stage but consider replacing the "logic chain" stage with a calculation-check stage instead if a chain doesn't fit naturally (see Step 5, Adapting Stages).
- Always keep: login → intro → quiz stage(s) → results/gameover. The chain, exam-spotter, and context stages are optional per topic — include the ones that make pedagogical sense.

State your chosen structure briefly to yourself (or the user) before generating, e.g. "3 scenarios covering Maslow/Herzberg/Mayo, 1 chain task, 1 exam-spotter task, no context challenge since it doesn't add much here" — then build it.

## Step 3: Assessment-objective structure (Eduqas)

See `references/spec_map.md` for the exact AO1–AO4 wording and weightings — read it
before writing content, don't paraphrase from memory. In brief, the template's stages
map onto the AOs like this:

- **AO1** → Quiz stage's first MCQ: recall/identify a term, theory, or classification correctly.
- **AO2** → embedded into the scenario text itself, and directly tested as one of the four sentence types in the "exam examiner" stage — not usually a separate MCQ.
- **AO3** → Quiz stage's second MCQ / the chain-builder: a chain of reasoning — "This happens → which causes → which leads to [specific consequence for this business]." Must be specific to the scenario's numbers/context, not generic theory-restating.
- **AO4** → Quiz stage's third MCQ / the context challenge: a judgement — "Overall this will/won't work because..., UNLESS/DEPENDING ON [X]." Must weigh both sides or state a condition, not just assert an opinion.

Each quiz question needs one correct answer plus 2–3 distractors. Distractors must be **plausible A-level-student misconceptions** — wrong reasoning that sounds tempting, not silly or obviously absurd (see the template's own distractors for the calibration you're matching, e.g. "Motivators" vs "Hygiene Factors" confusion, or evaluation distractors that "sound evaluative" but reach the wrong conclusion). Write a 1–2 sentence explanation for the correct answer that a student could revise from.

**Critical: match word count between the correct answer and every distractor, especially for AO3/AO4.** A student can trivially win by always picking the longest option if the correct answer is written as a full reasoned paragraph while distractors are short one-liners. Before finalizing each question, count words in the correct answer and each distractor — they must all fall within roughly the same range (no more than ~15% longer than the average distractor length). If the correct answer needs more room to complete its chain of reasoning, pad the distractors with equally elaborate (but logically flawed) reasoning of the same length — don't shorten the correct answer at the expense of clarity, and don't leave distractors thin. This applies to every question in every scenario, not just a sample.

## Step 4: Company, industry and colour theme — invent, don't ask

For every new simulation:

1. **Invent a fictional company name and industry** that fits the topic naturally (e.g. a growth-strategy topic might suit a food/drink brand scaling up; a HR/motivation topic suits a factory, studio, or service business — vary industries across generations, don't default to bikes).
2. **Pick a colour palette different from the template's default** (slate/blue/indigo). Rotate through options such as: teal/emerald, amber/orange, rose/pink, violet/purple, cyan/sky — pick primary + accent Tailwind colour families and swap them into the same CSS custom classes and Tailwind utility classes used in the template (e.g. `bg-blue-600` → `bg-teal-600`, `border-indigo-500` → `border-amber-500`, etc.) Keep the same *shades* (600 for primary buttons, 50/100 for tints, 900 for dark text) so contrast and legibility are preserved — only the hue changes.
3. Do not ask the user to confirm the company name or colours unless they've asked you to check first — just proceed and mention what you picked in your reply.

## Step 5: Adapting stages (if scaling down/up per Step 2)

- **Skipping the chain-builder**: only skip it if the topic has no clear 3-step cause→effect→impact argument. Most Business topics do have one (delegation, division of labour, break-even improvements, cash flow management) — default to including it.
- **Skipping the exam-spotter**: keep this one by default; it's cheap to write (just 4 sentences labelled AO1–AO4) and directly builds exam skills.
- **Skipping the context challenge**: fine to drop for topics without a clear "which strategy fits which situation" angle.
- **Adding a calculation-check stage** (for quantitative topics only): reuse the exam-spotter's visual pattern (click the right item) or the quiz MCQ pattern, but base the question on a worked number (e.g. "Given these figures, what is the break-even output?") with numeric MCQ options. Don't invent a new visual style — reuse an existing view's HTML/CSS shape.

### If you add, drop, or resize any stage: fix the constants that depend on stage count

Dropping or adding a stage (or changing how many items are in `DB.questions`,
`DB.chains`, `DB.examTasks`, or `DB.contextTasks`) is not zero-touch on the shared
engine — several numbers elsewhere are derived from the *template's* stage counts and
will silently misbehave if left unchanged. Before delivering, check every one of these:

1. **`updateProgress()`'s `totalSteps` line** — it sums `DB.questions.length + DB.chains.length + DB.examTasks.length + DB.contextTasks.length`. If you dropped `contextTasks` (or renamed/removed any DB array), remove that term or the progress bar will throw trying to read `.length` on `undefined`, or silently show the wrong percentage.
2. **The `current` step calculation inside `updateProgress()`** — the four `if(state.view === ...)` lines that add up preceding stages' lengths. If a stage is dropped, delete its line; if stages are reordered, reorder these to match.
3. **Every place that navigates to the next stage** (`nextScenario()`, `checkChainAnswer()`, `handleExamNext()`, `handleContextClick()`) — each one's "last item in this stage" branch calls `window.setView()` on the *next* stage. If you drop a stage, the previous stage's "last item" branch must point past it (e.g. if you drop `context`, `handleExamNext()`'s final branch should call `window.setView('results')` instead of `window.setView('context')`).
4. **The results screen's `scorePct` denominator** (`state.score / 80` in the template) — this is the *maximum achievable score* for the template's default stage counts (3 questions × 3 AOs × 5pts + 2 chains × 10pts + 2 examTasks × 10pts + 1 contextTask × 10pts = 95, rounded to 80 as a deliberately generous scale in the template). Recalculate this for your actual stage counts and item scoring (quiz AOs = 5pts each, chains = 10pts, examTasks = 10pts, contextTasks = 10pts) so the rank thresholds (Intern/Manager/Director/CEO equivalents) stay meaningful rather than making every run look like a top score or a failure.
5. **Any view block for a stage you dropped** (e.g. the `context` render branch) can be left in place since it's unreachable dead code — but double-check nothing upstream still navigates into it (see #3).

**After making these edits, verify the file mentally (or by tracing the flow once) end
to end**: login → intro → quiz(s) → chain(s) → exam task(s) → [context task(s)] →
results, confirming every transition lands somewhere valid and the progress bar reaches
exactly 100% on the last item, not before and not never.

## Step 6: Build the file

1. Copy `assets/template.html` as your starting point (read it fully first). The template already includes a small inline `console.warn` override placed just before the Tailwind CDN `<script>` tag — this silently filters out the CDN's known noisy console messages (the "should not be used in production" notice, and the "Could not load worker" warning that fires when Tailwind's JIT worker can't spin up inside this sandboxed preview environment). Both are expected/harmless here but noisy for users inspecting the console. Keep this override intact (don't strip it out when replacing other `<script>` tags in the `<head>`).
2. Replace the `DB` object entirely with your new topic's scenarios/chains/examTasks/contextTasks, following Steps 2–3.
3. Replace the `GLOSSARY` object with 8–12 terms relevant to the new topic.
4. Update the header company name, `<title>`, intro/mission-briefing copy, and gameover/results flavour text to match the new company/industry.
5. Recolour per Step 4 — do a careful find/replace of colour utility classes and any hex values in the `<style>` block, keeping shade numbers consistent.
6. Keep all JS function names, state fields, and view-rendering logic **identical in structure** — only touch what Steps 2–5 require. Do not refactor the state machine or rename functions; that's what makes this reliable to regenerate quickly.
7. Sanity check before delivering: every `DB.questions[i].ao1/ao3/ao4` has both `correct` and `distractors`; every chain has exactly as many `parts` as slots rendered; `totalSteps` calculation in `updateProgress()` still references the right DB arrays if you renamed any of them.

## Step 7: Deliver

Before saving, if you added, dropped, or resized any stage from the template's
defaults, re-confirm you've done the five checks in Step 5 (`totalSteps`, the
`current`-step calc, every inter-stage navigation call, the `scorePct` denominator,
and an end-to-end trace of the view flow). This is the single most common way these
generated files silently break, so treat it as non-optional whenever Step 2/5 led you
to deviate from 3 questions / 2 chains / 2 examTasks / 1 contextTask.

Also re-confirm the word-count parity check from Step 3: for every AO1/AO3/AO4 question, count words in the correct answer versus each distractor and verify none of the distractors are dramatically shorter than the correct answer (a student should not be able to win by always picking the longest option). Fix any mismatches before delivering.

Save the finished file to `/mnt/user-data/outputs/<company-name-or-topic>.html` and present it with `present_files`. Briefly tell the user: the topic/theory coverage chosen, the company/industry invented, the colour theme, and which optional stages were included or skipped and why.
