# Exam Platform Implementation Plan — Country-wise Jobs & Open Exams

**Version:** 1.0 (17-Aug-2026)
**Goal:** 260,000+ verified MCQs (growing) ko har country ke saare job tests / university entrances / armed forces tests / open subject exams ke liye organize karna, aur frontend ko Country → Sector → Organization → Job → Exam flow ke saath totally redesign karna.

---

## 1. Vision

Ek MCQ bank se **har country ke har exam** ka dedicated preparation center:

```
Country (Pakistan 🇵🇰, India 🇮🇳, Bangladesh 🇧🇩, UK 🇬🇧, USA 🇺🇸, UAE...) 
  → Sector (Armed Forces, Civil Services, Law Enforcement, Banking, Medical, Engineering, Education...)
    → Organization (FPSC, PPSC, NTS, Army, Navy, PAF, SBP, NBP, FIA, ASF, UHS...)
      → Service / Department (Police Service, PAS, Inland Revenue, Railways, ASF...)
        → Job Role (Constable, ASI, UDC, LDC, Assistant, Lecturer, SI, Inspector, Pilot Cadet, OG-2...)
          → Test / Exam (Initial Test, Written MCQ Paper, MPT, Subject Paper...)
            → Sections (English, GK, Math, IQ, Islamiat, Subject...) with weightage
              → MCQs (questionbank subjects/topics se pull)
```

**Open Exams** (country-independent): Java, C++, Python, DSA, DBMS, Physics, Biology, Chemistry, Maths, GK, English — har user har country me de sakta hai.

---

## 2. Research — Pakistan Exam Landscape (Deep Research Summary)

### 2.1 Civil Services & Public Service Commissions
| Body | Tests | Key facts |
|---|---|---|
| **FPSC** | CSS (MPT 200 MCQs, 6 compulsory + 12 optional papers), Inspector IR, Assistant Directors, FIA posts, Customs, Railways | BPS-17+ federal posts; CSS MPT = 200 MCQ, 33% pass; Written: 40% compulsory / 33% optional / 50% aggregate |
| **PPSC** (Punjab) | PMS, Assistant Commissioner, Naib Tehsildar, Lecturer, Subject Specialist, Junior Clerk, Stenotypist, Data Analyst | Provincial; MCQ 100-200 papers; subject+job based |
| **KPPSC / SPSC / BPSC / GPSC / AJKPSC** | Provincial equivalents (KP, Sindh, Balochistan, GB, AJK) | Same pattern per province |
| **PMS** | Provincial Management Service (each province) | Officer cadre |

### 2.2 National Testing Agencies
| Agency | Tests |
|---|---|
| **NTS** | NAT-IE (engineering), NAT-ICS (computing), NAT-I (general), GAT-General, GAT-Subject, university & bank hiring tests (COMSATS, IST, IIUI...) |
| **ETEA** (KP) | UET-Peshawar entry test, KP medical/dental, KP dept tests |
| **PTS / OTS / STS** | Police, dept and semi-govt hiring |

### 2.3 University & Medical Entrances
| Test | Body | Pattern |
|---|---|---|
| **MDCAT** | PMDC / UHS / DUHS / KMU (per province) | Bio+Chem+Phy+English; ~200 MCQs |
| **NUMS MDCAT** | NUMS | Medical (army-affiliated colleges) |
| **ECAT** | UET Lahore | Math 30 + Phy 30 + Chem 30 + Eng 10 = 100 MCQs, 4 marks + (-1) |
| **NUST NET** | NUST | 200 MCQs / 180 min, 4 series, no negative |
| **FAST NU, PIEAS, GIKI, LUMS LCAT, AUAT, COMSATS NAT** | Per-university | Subject-based (math/phy/chem/english/reasoning) |
| **University-specific** | QAU, PU, NED, DUET, UVAS | Own tests |

### 2.4 Armed Forces (Army / Navy / PAF) — Initial Tests (E-Testing)
| Entry | Sections | Approx MCQs |
|---|---|---|
| **Army (all entries)** | Verbal IQ 80-90 + Non-verbal 60-70 + Academic (Math/Eng/Pak Studies/Islamiat) 40 | ~180-200 |
| **Navy PN Cadet** | Verbal+Non-verbal 40 (18 min) + Academic 40 (18 min: Phy/Math/Eng/GK) | ~80 |
| **Navy SSC** | Intelligence + degree-subject | varies |
| **Navy Sailor/M-Cadet/FMT** | Intelligence + Matric-level science + Eng/Math/GK | varies |
| **PAF GDP/CAE** | Verbal+Nonverbal 140 + Phy 50 + Math 50 + Eng 75 | ~225 |
| **PAF AD** | Verbal+Nonverbal 140 + Eng 40 | ~180 |
| **PAF Admin/Log** | Verbal+Nonverbal + Eng + GK | ~180 |
| **PAF Airmen (Aero/GC/Provost/MTD)** | Matric-level | 125-175 |
| **ISSB** | 5-day officers' selection (initial already cleared) | — |

### 2.5 Law Enforcement
| Force | Posts | Pattern |
|---|---|---|
| **FIA** | SI, ASI, Constable, UDC, LDC, Assistant, Driver | 100 MCQs/90-120 min: GK 40%, English 30%, Math 10%, Pak 10%, Islamiat 10% (uniformed); FIA Act 1974 section for some posts |
| **ASF** | ASI, Corporal, Clerks | 50-100 MCQs: Eng/GK/Pak Affairs/Math/Islamiat |
| **Police (Punjab/Sindh/KP/Balochistan)** | Constable, ASI, SI, Inspector | GK+IQ+English+Urdu+Math |
| **ANF, CAA, NADRA, WAPDA** | Various | NTS-based |

### 2.6 Banking & Finance
| Bank | Test | Sections |
|---|---|---|
| **SBP** | OG-2 (SBOTS), MTO/BSC | English, Math/Quant, IQ, GK/Current Affairs, Bank concepts |
| **NBP** | CBM, MTO, OG-1/2/3 | NTS pattern |
| **HBL / UBL / MCB / BOP / ZTBL / NIFT** | Probationary Officer, Teller, MTO | English+Quant+IQ+GK |
| **JAIB / NIBM** | Banking certifications | Full banking syllabus |

### 2.7 Teaching & Education
| Test | Body |
|---|---|
| **PST/CT/EST** | NTS (Punjab DPE) — Eng/Urdu/Math/Islamiat/GK/Pedagogy |
| **SESE/SSE/SST** | Provincial education depts |
| **Lecturer (BPS-17)** | FPSC/PPSC — subject + English |
| **Headmaster/Principal** | PPSC/provincial |

### 2.8 Other Sectors (Post Office, Railways, Energy, Airlines, Corporates)
Railways (ASM/TC/constable/PO clerks), Post Office (GDS/PA), WAPDA/PESCO/LESCO, OGDCL/SNGPL/SSGC, PIA/PTCL/POF, HEC, Pakistan Customs, Inland Revenue — sab ka common core: **English + GK + Math + IQ + Islamiat/Pak Studies + job-specific subject**.

> **Key insight:** 90%+ in-role tests share the same 5-6 core sections with different weightage. Platform ko `Test Pattern = sections × weightage` model ke saath build karo — phir literally **hazaron job roles** cover ho jate hain sirf patterns add karke, naye MCQs ki zaroorat nahi (questionbank already has 260k+ MCQs in these exact subjects).

---

## 3. Information Architecture (URL Design)

```
/home
├── /exams (country hub)
│   ├── /exams/pakistan            → sector grid
│   │   ├── /exams/pakistan/armed-forces        → org cards (Army/Navy/PAF/ISSB)
│   │   │   ├── /exams/pakistan/armed-forces/pakistan-army
│   │   │   │   ├── /.../pakistan-army/jobs          → role list (Soldier, JCO, ...)
│   │   │   │   └── /.../pakistan-army/exams        → tests (Initial Test, ...)
│   │   ├── /exams/pakistan/civil-services          → FPSC/CSS, PPSC/PMS, provincial
│   │   ├── /exams/pakistan/law-enforcement         → FIA, ASF, Police, ANF
│   │   ├── /exams/pakistan/banking                 → SBP, NBP, HBL, ...
│   │   ├── /exams/pakistan/medical                 → MDCAT, NUMS, PMDC
│   │   ├── /exams/pakistan/engineering             → ECAT, NET, FAST, GIKI, PIEAS
│   │   ├── /exams/pakistan/education               → PST, SSE, Lecturer
│   │   └── /exams/pakistan/... (energy, railways, aviation, corporate)
│   ├── /exams/india, /exams/bangladesh, ...   (Phase 2+)
│   └── /exams/open                              (Java, C++, Physics, GK... — country-free)
├── /exam/{slug}       → test detail (pattern, sections, MCQs count, start)
└── /take-exam/{slug}  → existing exam engine
```

---

## 4. Data Model (New Tables — Laravel Migrations)

```
exam_countries        (id, name, code, flag_icon, slug, sort_order, status)
exam_sectors          (id, country_id NULL=global, name, icon, color/gradient, slug, sort_order, status)
exam_organizations    (id, sector_id, country_id, name, short_name, logo, color, slug, status)
exam_services         (id, organization_id, name, slug)              -- Police Service, PAS, ASF ops...
exam_jobs             (id, organization_id, service_id, title, bps_grade, eligibility, slug)
exam_papers           (id, organization_id, job_id NULL, title, exam_type, image,
                        total_questions, total_marks, duration_minutes, negative_marking,
                        pass_percentage, attempts_allowed, is_paid, cost, slug, status)
exam_paper_sections   (id, paper_id, subject_id NULL, topic_id NULL, section_title,
                        question_count, marks, difficulty, sort_order, weightage)
exam_paper_questions  (id, paper_id, questionbank_id, section_id, marks, sort_order)
```

### MCQ linkage strategy (no new question entry)
- `exam_paper_sections.subject_id / topic_id + question_count + difficulty` = **smart pool** — har attempt me questionbank se random unique questions (existing `enable_random_questions` flow reuse).
- Ya fixed: admin `exam_paper_questions` pivot — kisi specific question set ke liye (e.g. "MDCAT Biology 2025 Solved Paper").
- Existing `quizzes` table se bridge: `exam_papers.quiz_id` NULL → matlab smart pool; set → legacy fixed quiz.

### Existing DB reuse
- `questionbank` (260k+) → source of questions (subject/topic/difficulty).
- `quizcategories` → flat categories ko mapped karke **exam_sectors / exam_organizations** me upgrade karna.
- `quizzes.image` + fallback → naya auto-cover system (below).

---

## 5. Frontend Redesign Spec

### 5.1 Exam Cards (replaces current single-style cards)
Har exam card:
```
┌─────────────────────────────┐
│ [COVER: image ya auto-cover]│  ← gradient background (sector color)
│  Sector badge (🛡 Army)      │
│  EXam Title (overlay text)  │
│  "45 MCQs • 30 min"         │
└─────────────────────────────┘
  🏛 Organization  •  🇵🇰 Pakistan
  [Start Free]  [Details]
```
- Agar `image` upload hai → image; warna **auto-cover generator**: sector-color gradient + flag + exam name + total MCQs (Server-side: Intervention Image generate JPEG, ya pure CSS card with overlay — CSS approach faster, zero storage).

### 5.2 Page-level layouts
| Page | Content |
|---|---|
| Home | Hero (country switcher), **Sector cards** (Pakistan focus), Open Exams strip, Top tests by attempts |
| Country hub | Flag + country name, sector grid (icons + gradient tiles + exam counts) |
| Sector | Org cards with logo/flag + counts, search + filter (free/paid, format) |
| Organization | Tabs: Jobs (role cards) / Exams (paper cards) / Past Papers |
| Job detail | Eligibility, BPS, linked tests with pattern table |
| Test detail | Pattern: sections table (subject, weightage, marks, time), total MCQs, start button, attempts |
| Exam engine | Existing `start-exam` flows reused as-is |

### 5.3 Filters & Search
- Country → Sector → Org breadcrumb; sidebar filters: Free/Paid, Attempts, Duration, Difficulty.
- Global search: exams, jobs, subjects ("FIA", "MDCAT", "Java").

### 5.4 Theming
- Sector colors: Armed Forces #2E7D32 (green), Civil Services #1565C0, Law Enforcement #EF6C00, Banking #6A1B9A, Medical #C62828, Engineering #00838F, Education #F9A825, Open Exams #37474F.
- Themeone layout ke styles me `pe-card` / `hp-card` upgrade.

---

## 6. Pakistan Rollout — Exam Catalog (thousands of jobs via taxonomy)

**Phase P1 (Foundation — do it first):**
1. Schema + Models + Admin CRUD (countries, sectors, orgs, jobs, papers, sections)
2. Pakistan country record + 12 sectors
3. Top-30 organizations seeded: FPSC, CSS, PPSC, PMS, KP/SP/BP/GPSC, NTS, ETEA, PTS, Army, Navy, PAF, ISSB, FIA, ASF, ANF, Punjab/KP/Sindh Police, SBP, NBP, HBL, UBL, MCB, BOP, NIFT, UHS/PMDC, NUMS, UET, NUST, FAST, GIKI, PIEAS, LUMS, COMSATS, DPE Punjab, WAPDA, Railways, PIA, Customs, IR
4. Top-50 flagship tests with **exact official patterns** (from Section 2 tables): CSS MPT, PPSC Junior Clerk, FIA ASI, ASF ASI, Army Initial, Navy PN Cadet, PAF GDP, MDCAT, NUMS, ECAT, NET, FAST, SBP OG-2, NBP MTO, PST/CT, Police Constable...
5. Each test = sections mapped to questionbank subjects (English, GK, Math, IQ, Islamiat, Pak Studies + subject) with real weightage → **auto-generated question pools**

**Phase P2 (Mass coverage):** admin bulk-import sheet (Excel) jisme har organization ke role templates → 1,000+ job roles quickly. Each role = default pattern (core sections) + optional subject sections. Ye hi "hazaron jobs" wala lever hai.

**Phase P3 (Frontend):** country hub + sector pages + new exam cards (5.1-5.4) + auto-covers.

**Phase P4 (Past papers & extras):** MDCAT/ECAT/CSS past papers as fixed `exam_paper_questions`, explanation links, bookmarks.

**Phase P5 (Reports & monetization):** per-exam analytics, series bundles (`examseries` reuse), paid exams (razorpay/cashier existing), certificates.

---

## 7. Exam Builder Logic (how sections pull MCQs)

```
exam_paper = { title: "FIA ASI Written 2026", total: 100, duration: 90, negative: 0 }
sections:
  [English 20q, topic_ids: grammar,vocab..., difficulty: easy-medium]
  [GK 40q, subjects: World GK, Pakistan Affairs, Current Affairs]
  [Math 10q, subjects: Quant Aptitude]
  [Islamiat 10q, subject: Islamic Studies]
  [Pak Studies 10q]
Build: SELECT q FROM questionbank WHERE subject/topic IN (...) 
       AND difficulty IN (...) ORDER BY RAND() LIMIT count
Dedup across sections (questionbank.id distinct).
Caching: pool per section cached 24h; attempt time random draw (existing engine).
```

---

## 8. Open Exams (country-free)

- Sector "Open / Global": Java, C++, Python, DSA, DBMS, OS, Networks, HTML/CSS/JS, Physics, Chemistry, Biology, Maths, English, GK quizzes.
- 260k+ bank me in sab subjects ke MCQs already hain (C++ 754+, DSA 128, Python 11, DBMS 76, OS 36, Physics 3.2k, Chem 3.5k, Bio 6.2k, English 4.6k, GK 45k+).
- Homepage me "Open Exams" strip — countries se independent.

---

## 9. Roadmap — Phases & Milestones

| Phase | Deliverables | Est. |
|---|---|---|
| P1 | Schema, models, admin CRUD, seed 30 orgs + 50 flagship tests with real patterns | Week 1-2 |
| P2 | Bulk role-import (Excel) → 1,000+ job roles + default patterns | Week 2-3 |
| P3 | Frontend: country hub, sector/org/job/test pages, auto-cover cards, search/filter | Week 3-4 |
| P4 | Past papers, smart pools caching, analytics | Week 4-5 |
| P5 | Payments, certificates, series, mobile API update | Week 5-6 |
| Phase 2 (after PK) | India (SSC, UPSC, banking IBPS, JEE, NEET, police, railways, defence) | Month 2 |
| Phase 3 | Bangladesh (BCS, bank, admission tests) | Month 3 |
| Phase 4 | UK (GCSE/A-Level, UKCAT/UCAT, civil service), USA (SAT/ACT/GRE, USMLE-lite), UAE/Gulf | Month 3-4 |

---

## 10. Risks & Decisions

1. **Question reuse across tests is by design** — same MCQ in 5 tests = fine; dedup only prevents duplicate question text in one paper.
2. **Old flat categories** (`quizcategories`) → migrate mapping into new taxonomy gradually; old URLs redirect.
3. **Images**: existing 704 category images reuse; new auto-cover = CSS gradient + overlay (no storage), optional Intervention-generated PNG later.
4. **exam_course_questions** (referenced by mobile API, table missing) — fix in P5.
5. **Performance**: section pools cached; `ORDER BY RAND()` limited to pool size per section (≤500), not full table.
6. Priority: Pakistan P1-P3 pehle, phir India — dono ko same taxonomy engine.

---

## 11. Immediate Next Actions (after plan approval)
1. `php artisan make:migration create_exam_taxonomy_tables` (countries, sectors, orgs, services, jobs, papers, paper_sections, paper_questions)
2. Models + Admin controllers (reuse admin layout pattern of `bisc/`)
3. Seeder: Pakistan + 12 sectors + 30 orgs + 50 flagship test patterns (official data from Section 2)
4. Frontend routes/controllers/views (themeone) per Section 3 & 5
