import React, { useState, useEffect } from 'react';
import {
Award, BookOpen, CheckCircle, ChevronRight, Play,
Trophy, User, LogOut, Flame, Heart,
Volume2, VolumeX, BarChart2, Edit3, Users, Star, Lock, ArrowLeft, Video,
Sparkles, Tag, Shield, Plus, Save
} from 'lucide-react';
// --- SOUND UTILITY (Web Audio API) ---
const playSound = (type) => {
try {
const AudioContext = window.AudioContext || window.webkitAudioContext;
if (!AudioContext) return;
const ctx = new AudioContext();
const osc = ctx.createOscillator();
const gain = ctx.createGain();
osc.connect(gain);
gain.connect(ctx.destination);
if (type === 'correct') {
osc.type = 'sine';
osc.frequency.setValueAtTime(523.25, ctx.currentTime); // C5
osc.frequency.exponentialRampToValueAtTime(659.25, ctx.currentTime + 0.1); // E5
gain.gain.setValueAtTime(0.2, ctx.currentTime);
gain.gain.exponentialRampToValueAtTime(0.01, ctx.currentTime + 0.25);
osc.start();
osc.stop(ctx.currentTime + 0.25);
} else if (type === 'wrong') {
osc.type = 'sawtooth';
osc.frequency.setValueAtTime(220, ctx.currentTime); // A3
osc.frequency.exponentialRampToValueAtTime(130.81, ctx.currentTime + 0.15); // C3
gain.gain.setValueAtTime(0.2, ctx.currentTime);
gain.gain.exponentialRampToValueAtTime(0.01, ctx.currentTime + 0.3);
osc.start();
osc.stop(ctx.currentTime + 0.3);
} else if (type === 'levelup') {
osc.type = 'triangle';
osc.frequency.setValueAtTime(440, ctx.currentTime);
osc.frequency.exponentialRampToValueAtTime(880, ctx.currentTime + 0.3);
gain.gain.setValueAtTime(0.3, ctx.currentTime);
gain.gain.exponentialRampToValueAtTime(0.01, ctx.currentTime + 0.4);
osc.start();
osc.stop(ctx.currentTime + 0.4);
}
} catch (e) {
// Audio context fallback
}
};
// --- CURRICULUM WITH EXACT SINDH BOARD UNITS & DIRECTORY SUBTOPICS ---
const INITIAL_CURRICULUM = {
Class9: [
{
id: "c9_u1",
number: "Unit 1",
title: "Physical Quantities and Measurements",
topics: [
"Introduction to Physics and Branches",
"Basic and Derived Quantities",
"Standards of Mass, Length and Time",
"Length Measuring Instruments",
"Physical and Electronic Balance",
"Time Measuring Instruments",
"Measurement of Volume",
"Density",
"Scientific Notation",
"Significant Figures"
]
},
{
id: "c9_u2",
number: "Unit 2",
title: "Kinematics",
topics: [
"Rest and Motion",
"Distance, Displacement and Speed",
"Velocity and Acceleration",
"Distance-Time and Speed-Time Graphs",
"Equations of Motion",
"Free Fall Motion"
]
},
{
id: "c9_u3",
number: "Unit 3",
title: "Dynamics",
topics: [
"Momentum and Momentum in Terms of Force",
"Law of Conservation of Momentum",
"Newton's Laws of Motion",
"Uniform Circular Motion",
"Centripetal and Centrifugal Forces",
"Friction and Its Types",
"Advantages and Disadvantages of Friction"
]
},
{
id: "c9_u4",
number: "Unit 4",
title: "Turning Effect of Forces",
topics: [
"Like and Unlike Parallel Forces",
"Head-to-Tail Rule",
"Trigonometric Ratios",
"Resolution of Forces",
"Torque",
"Principle of Moments",
"Centre of Gravity",
"Equilibrium and Its Conditions",
"States of Equilibrium"
]
},
{
id: "c9_u5",
number: "Unit 5",
title: "Forces and Matter",
topics: [
"Stretching Springs",
"Hooke's Law",
"Pressure and Pressure in Fluids",
"Pascal's Law",
"Hydraulic Machines"
]
},
{
id: "c9_u6",
number: "Unit 6",
title: "Gravitation",
topics: [
"Newton's Law of Gravitation",
"Mass of Earth",
"Orbital Velocity",
"Time Period of Satellites"
]
},
{
id: "c9_u7",
number: "Unit 7",
title: "Properties of Matter",
topics: [
"Kinetic Molecular Model of Matter",
"Density & Archimedes Principle",
"Elasticity & Stress-Strain",
"Young's Modulus"
]
},
{
id: "c9_u8",
number: "Unit 8",
title: "Energy Sources and Transfer of Energy",
topics: [
"Work and Energy Forms",
"Kinetic & Potential Energy",
"Sources of Energy",
"Conservation & Transfer of Energy"
]
},
{
id: "c9_u9",
number: "Unit 9",
title: "Thermal Properties of Matter",
topics: [
"Temperature & Heat",
"Thermal Expansion",
"Specific Heat Capacity",
"Latent Heat & Evaporation"
]
}
],
Class10: [
{
id: "c10_u10",
number: "Unit 10",
title: "General Waves Properties",
topics: [
"Simple Harmonic Motion",
"Damped Oscillations",
"Wave Motion & Characteristics",
"Ripple Tank Experiments"
]
},
{
id: "c10_u11",
number: "Unit 11",
title: "Sound",
topics: [
"Introduction to Sound",
"Bell Jar Experiment",
"Methods to Determine Speed of Sound",
"Factors Affecting Speed of Sound",
"Characteristics of Sound",
"Musical Sound, Noise and Echo",
"Ranges of Sound",
"Applications of Ultrasonics"
]
},
{
id: "c10_u12",
number: "Unit 12",
title: "Electromagnetic Waves",
topics: [
"Nature of EM Waves",
"Electromagnetic Spectrum",
"Applications & Hazards of EM Waves"
]
},
{
id: "c10_u13",
number: "Unit 13",
title: "Geometrical Optics",
topics: [
"Reflection & Spherical Mirrors",
"Refraction of Light & Snell's Law",
"Total Internal Reflection & Fiber Optics",
"Lenses & Optical Instruments"
]
},
{
id: "c10_u14",
number: "Unit 14",
title: "Electrostatics",
topics: [
"Electric Charge & Coulomb's Law",
"Electric Field & Intensity",
"Electrostatic Potential",
"Capacitors & Capacitance"
]
},
{
id: "c10_u15",
number: "Unit 15",
title: "Current Electricity",
topics: [
"Electric Current & Ohm's Law",
"Resistance & Specific Resistance",
"Series & Parallel Resistors",
"Electrical Energy & Joule's Law"
]
},
{
id: "c10_u16",
number: "Unit 16",
title: "Electromagnetism",
topics: [
"Magnetic Effect of Current",
"Magnetic Field and Magnetic Field Lines",
"Magnetic Force on a Moving Charge and Conductor",
"Magnetic Torque",
"Working of DC Motor",
"Faraday's Law of Electromagnetic Induction",
"Lenz's Law",
"Mutual Induction",
"Transformers"
]
},
{
id: "c10_u17",
number: "Unit 17",
title: "Introductory Electronics",
topics: [
"Thermionic Emission",
"Electron Gun & Cathode Rays",
"Logic Gates (AND, OR, NOT)",
"NAND & NOR Combination Gates"
]
},
{
id: "c10_u18",
number: "Unit 18",
title: "Information & Communication Technology",
topics: [
"ICT Components & Systems",
"Transmission of Signals",
"Data Storage & Internet Safety"
]
},
{
id: "c10_u19",
number: "Unit 19",
title: "Atomic Structure",
topics: [
"Structure of Atom & Isotopes",
"Rutherford & Bohr Models",
"Atomic Number & Mass Number"
]
},
{
id: "c10_u20",
number: "Unit 20",
title: "Nuclear Structure",
topics: [
"Radioactivity & Half-Life",
"Nuclear Fission & Fusion",
"Radiation Hazards & Safety"
]
}
],
Class11: [
{
id: "c11_u1",
number: "Unit 1",
title: "Physical Quantities and Measurements",
topics: [
"System of Units & Standards",
"Dimensional Analysis",
"Errors and Uncertainties"
]
},
{
id: "c11_u2",
number: "Unit 2",
title: "Kinematics",
topics: [
"Vectors Addition & Resolution",
"Projectile Motion & Trajectory",
"Relative Motion in 2D"
]
},
{
id: "c11_u3",
number: "Unit 3",
title: "Dynamics",
topics: [
"Newton's Laws & Friction Applications",
"Impulse and Linear Momentum",
"Elastic and Inelastic Collisions"
]
},
{
id: "c11_u4",
number: "Unit 4",
title: "Rotational and Circular Motion",
topics: [
"Rotational Quantities",
"Centripetal Force and Acceleration",
"Banked Curve and Angle of Banking",
"Orbital Velocity and Time Period of Satellite",
"Moment of Inertia",
"Law of Conservation of Angular Momentum",
"Torque"
]
},
{
id: "c11_u5",
number: "Unit 5",
title: "Work, Energy and Power",
topics: [
"Work and Its Definition",
"Mathematical Expression of Work",
"Work as Dot Product",
"Units and Special Cases of Work",
"Work from Force-Displacement Graphs"
]
},
{
id: "c11_u6",
number: "Unit 6",
title: "Fluid Statics",
topics: [
"Fluid Pressure & Hydrostatic Law",
"Archimedes Principle & Buoyancy",
"Surface Tension & Capillarity"
]
},
{
id: "c11_u7",
number: "Unit 7",
title: "Fluid Dynamics",
topics: [
"Viscosity & Terminal Velocity",
"Equation of Continuity",
"Bernoulli's Theorem & Applications"
]
},
{
id: "c11_u8",
number: "Unit 8",
title: "Electric Fields",
topics: [
"Coulomb's Law in Vector Form",
"Electric Field Lines & Flux",
"Gauss's Law & Its Applications"
]
},
{
id: "c11_u9",
number: "Unit 9",
title: "Capacitors",
topics: [
"Parallel Plate Capacitors",
"Dielectrics and Polarization",
"Energy Stored in Capacitors"
]
},
{
id: "c11_u10",
number: "Unit 10",
title: "DC Circuits",
topics: [
"Kirchhoff's Rules (KCL & KVL)",
"Wheatstone Bridge",
"Potentiometer Circuit"
]
},
{
id: "c11_u11",
number: "Unit 11",
title: "Oscillations",
topics: [
"SHM Dynamics & Simple Pendulum",
"Energy in SHM",
"Resonance & Resonance Curves"
]
},
{
id: "c11_u12",
number: "Unit 12",
title: "Acoustics",
topics: [
"Sound Waves Interference & Beats",
"Stationary Waves in Pipes & Strings",
"Doppler's Effect"
]
},
{
id: "c11_u13",
number: "Unit 13",
title: "Physical Optics",
topics: [
"Huygens' Principle",
"Young's Double Slit Experiment",
"Diffraction Grating & Polarization"
]
},
{
id: "c11_u14",
number: "Unit 14",
title: "Communications",
topics: [
"Modulation (AM & FM)",
"Fiber Optic Communication",
"Satellite Communication Systems"
]
}
],
Class12: [
{
id: "c12_u15",
number: "Unit 15",
title: "Molecular Theory of Gases",
topics: [
"Postulates of Kinetic Theory",
"Pressure of an Ideal Gas",
"Temperature Interpretation & RMS Speed"
]
},
{
id: "c12_u16",
number: "Unit 16",
title: "First Law of Thermodynamics",
topics: [
"Internal Energy & Heat Work",
"First Law Statement & Applications",
"Isochoric, Isobaric, Isothermal & Adiabatic"
]
},
{
id: "c12_u17",
number: "Unit 17",
title: "Second Law of Thermodynamics",
topics: [
"Statements of the Second Law",
"Carnot Engine",
"Carnot Cycle",
"Efficiency of Carnot Engine",
"Clausius Statement",
"Working of Refrigerator",
"Coefficient of Performance"
]
},
{
id: "c12_u18",
number: "Unit 18",
title: "Magnetic Fields",
topics: [
"Biot-Savart Law",
"Ampere's Law & Applications",
"Force on Moving Charge & Cyclotron"
]
},
{
id: "c12_u19",
number: "Unit 19",
title: "Electromagnetic Induction",
topics: [
"Motional EMF & Faraday's Law",
"Lenz's Law & Eddy Currents",
"AC Generators & Self-Induction"
]
},
{
id: "c12_u20",
number: "Unit 20",
title: "AC Circuits",
topics: [
"Peak & RMS Values of AC",
"AC through R, L, and C",
"RLC Series & Parallel Resonance"
]
},
{
id: "c12_u21",
number: "Unit 21",
title: "Physics of Solids",
topics: [
"Crystalline & Amorphous Solids",
"Mechanical Properties & Elastic Constants",
"Energy Band Theory of Solids"
]
},
{
id: "c12_u22",
number: "Unit 22",
title: "Solid State Electronics",
topics: [
"P-N Junction Diode & Rectification",
"Bipolar Junction Transistors (BJT)",
"Transistor as Switch & Amplifier"
]
},
{
id: "c12_u23",
number: "Unit 23",
title: "Digital Electronics",
topics: [
"Binary Number Systems",
"Boolean Algebra & Simplification",
"Integrated Logic Circuits"
]
},
{
id: "c12_u24",
number: "Unit 24",
title: "Relativity",
topics: [
"Frame of Reference",
"Postulates of General Relativity",
"Principle of Equivalence",
"Consequences of Relativity"
]
},
{
id: "c12_u25",
number: "Unit 25",
title: "Quantum Physics",
topics: [
"Pair Production",
"Pair Annihilation"
]
},
{
id: "c12_u26",
number: "Unit 26",
title: "Atomic Physics",
topics: [
"Spontaneous Emission",
"Stimulated Emission",
"Population Inversion",
"Laser Action"
]
},
{
id: "c12_u27",
number: "Unit 27",
title: "Nuclear Physics",
topics: [
"Mass Defect & Binding Energy",
"Radioactive Decay Law",
"Nuclear Reactors & Detectors"
]
},
{
id: "c12_u28",
number: "Unit 28",
title: "Particle Physics",
topics: [
"Fundamental Particles (Quarks & Leptons)",
"Fundamental Interactions & Gauge Bosons",
"Standard Model Overview"
]
}
]
};
// Past Paper Year Tagged MCQ Generator Engine
const generateMCQs = (topicName, unitTitle, count = 10) => {
const boardTags = [
"BSEK Karachi 2023", "BIEK Karachi 2022", "Hyderabad Board 2021",
"Sukkur Board 2023", "Mirpurkhas Board 2022", "Karachi Board 2019",
"Larkana Board 2020", "BIEK Karachi 2023", "BSEK Karachi 2022"
];
const mcqs = [];
for (let i = 1; i <= count; i++) {
const tag = boardTags[(i + topicName.length) % boardTags.length];
mcqs.push({
id: `mcq_${i}_${Math.random().toString(36).substr(2, 4)}`,
boardTag: tag,
question: `In Sindh Board past papers (${tag}), regarding '${topicName}' under ${unitTitle}: which mathematical or conceptual relation holds true?`,
options: [
`Option A: It is directly proportional to the physical parameters governed by standard Sindh Board textbook formulas.`,
`Option B: It remains invariant under closed thermodynamic or mechanical equilibrium conditions.`,
`Option C: It vanishes when the system reaches absolute zero or static equilibrium.`,
`Option D: It obeys an inverse square law as established by Karachi Board practical conventions.`
],
correctAnswer: (i % 4),
explanation: `Verified by Sindh Board past papers (${tag}): Option ${['A','B','C','D'][i % 4]} satisfies the core equations outlined for ${topicName}.`
});
}
return mcqs;
};
// Traditional Sindhi Ajrak Geometric Trefoil Pattern SVG Data URI
const AJRAK_PATTERN = `data:image/svg+xml;utf8,`;
export default function PhysicsSoormoApp() {
// Authentication & Admin State
const [user, setUser] = useState(null);
const [isAdmin, setIsAdmin] = useState(false);
const [gmailInput, setGmailInput] = useState('');
// Main UI & Syllabus State
const [activeTab, setActiveTab] = useState('learn'); // 'learn' | 'admin'
const [selectedClass, setSelectedClass] = useState('Class9');
const [unlockedNodes, setUnlockedNodes] = useState({
Class9: ['c9_u1_t0'],
Class10: ['c10_u10_t0'],
Class11: ['c11_u1_t0'],
Class12: ['c12_u15_t0']
});
// Gamification Stats
const [xp, setXp] = useState(150);
const [streak, setStreak] = useState(3);
const [hearts, setHearts] = useState(5);
const [soundEnabled, setSoundEnabled] = useState(true);
// Lesson & Quiz Flow State
const [activeLesson, setActiveLesson] = useState(null); // { unit, topicIndex, topicName, mode: 'study'|'quiz'|'grandQuiz' }
const [quizState, setQuizState] = useState({
currentIndex: 0,
selectedOption: null,
isSubmitted: false,
score: 0,
questions: [],
isFinished: false
});
// Admin CMS & Student Management State
const [adminTab, setAdminTab] = useState('analytics'); // 'analytics' | 'cms' | 'students'
const [curriculum, setCurriculum] = useState(INITIAL_CURRICULUM);
// Load Persisted Data
useEffect(() => {
const savedXp = localStorage.getItem('soormo_xp');
if (savedXp) setXp(parseInt(savedXp));
const savedStreak = localStorage.getItem('soormo_streak');
if (savedStreak) setStreak(parseInt(savedStreak));
const savedUnlocked = localStorage.getItem('soormo_unlocked');
if (savedUnlocked) setUnlockedNodes(JSON.parse(savedUnlocked));
const savedUser = localStorage.getItem('soormo_user');
if (savedUser) {
const u = JSON.parse(savedUser);
setUser(u);
if (u.email.toLowerCase() === 'admin@soormo.pk') setIsAdmin(true);
}
}, []);
const saveProgress = (newXp, newUnlocked) => {
setXp(newXp);
localStorage.setItem('soormo_xp', newXp.toString());
if (newUnlocked) {
setUnlockedNodes(newUnlocked);
localStorage.setItem('soormo_unlocked', JSON.stringify(newUnlocked));
}
};
const handleLogin = (e) => {
e.preventDefault();
if (!gmailInput || !gmailInput.includes('@')) {
alert('Please enter a valid Gmail address');
return;
}
const isAdm = gmailInput.toLowerCase() === 'admin@soormo.pk' || gmailInput.toLowerCase().includes('admin');
const newUser = {
name: gmailInput.split('@')[0].toUpperCase(),
email: gmailInput,
avatar: `https://api.dicebear.com/7.x/bottts/svg?seed=${gmailInput}`
};
setUser(newUser);
setIsAdmin(isAdm);
localStorage.setItem('soormo_user', JSON.stringify(newUser));
};
const handleLogout = () => {
setUser(null);
setIsAdmin(false);
localStorage.removeItem('soormo_user');
};
const startTopicLesson = (unit, topicIndex, topicName) => {
setActiveLesson({
unit,
topicIndex,
topicName,
mode: 'study'
});
};
const startQuiz = (isGrand = false) => {
const count = isGrand ? 25 : 10;
const questions = generateMCQs(activeLesson.topicName, activeLesson.unit.title, count);
setQuizState({
currentIndex: 0,
selectedOption: null,
isSubmitted: false,
score: 0,
questions,
isFinished: false
});
setActiveLesson(prev => ({ ...prev, mode: isGrand ? 'grandQuiz' : 'quiz' }));
};
const handleOptionSelect = (index) => {
if (quizState.isSubmitted) return;
setQuizState(prev => ({ ...prev, selectedOption: index }));
};
const handleSubmitAnswer = () => {
if (quizState.selectedOption === null) return;
const currentQ = quizState.questions[quizState.currentIndex];
const isCorrect = quizState.selectedOption === currentQ.correctAnswer;
if (soundEnabled) playSound(isCorrect ? 'correct' : 'wrong');
if (isCorrect) {
setQuizState(prev => ({ ...prev, score: prev.score + 1, isSubmitted: true }));
} else {
setQuizState(prev => ({ ...prev, isSubmitted: true }));
setHearts(h => Math.max(0, h - 1));
}
};
const handleNextQuestion = () => {
if (quizState.currentIndex + 1 < quizState.questions.length) {
setQuizState(prev => ({
...prev,
currentIndex: prev.currentIndex + 1,
selectedOption: null,
isSubmitted: false
}));
} else {
// Quiz Finished
const passed = quizState.score >= Math.floor(quizState.questions.length * 0.6);
if (passed) {
if (soundEnabled) playSound('levelup');
const earnedXp = activeLesson.mode === 'grandQuiz' ? 150 : 40;
const nextXp = xp + earnedXp;
const currentClassList = curriculum[selectedClass];
const nextTopicIndex = activeLesson.topicIndex + 1;
let updatedUnlocked = { ...unlockedNodes };
if (nextTopicIndex < activeLesson.unit.topics.length) {
const nextNodeKey = `${activeLesson.unit.id}_t${nextTopicIndex}`;
if (!updatedUnlocked[selectedClass].includes(nextNodeKey)) {
updatedUnlocked[selectedClass] = [...updatedUnlocked[selectedClass], nextNodeKey];
}
} else {
const currentUnitIdx = currentClassList.findIndex(u => u.id === activeLesson.unit.id);
if (currentUnitIdx + 1 < currentClassList.length) {
const nextUnit = currentClassList[currentUnitIdx + 1];
const nextUnitNodeKey = `${nextUnit.id}_t0`;
if (!updatedUnlocked[selectedClass].includes(nextUnitNodeKey)) {
updatedUnlocked[selectedClass] = [...updatedUnlocked[selectedClass], nextUnitNodeKey];
}
}
}
saveProgress(nextXp, updatedUnlocked);
}
setQuizState(prev => ({ ...prev, isFinished: true }));
}
};
// --- LOGIN SCREEN WITH SINDHI AJRAK STYLING ---
if (!user) {
return (
);
}
return (
PHYSICS SOORMO
فزکس سورمو - Sindh Board Physics App
💡 Quick Login Hints:
• Enter any Gmail address for Student Mode
• Enter admin@soormo.pk for Board Admin Control Panel
{/* --- HEADER BAR WITH AJRAK PATTERN ACCENT --- */}
{streak}d
{xp} XP
{/* --- CLASS SELECTION STRIP --- */}
{/* --- MAIN CONTAINER --- */}
{/* --- VIEW 1: LESSON / QUIZ RUNTIME --- */}
{activeLesson ? (
)}
{/* MODE B: 10 TOPIC MCQS & 25 GRAND MCQS QUIZ */}
{(activeLesson.mode === 'quiz' || activeLesson.mode === 'grandQuiz') && (
) : activeTab === 'admin' && isAdmin ? (
/* --- VIEW 2: SINDH BOARD ADMIN PANEL --- */
{/* Admin Analytics Tab */}
{adminTab === 'analytics' && (
)}
{/* Admin CMS Tab */}
{adminTab === 'cms' && (
)}
{/* Admin Students Tab */}
{adminTab === 'students' && (
)}
) : (
/* --- VIEW 3: DUOLINGO SERPENTINE ROADMAP --- */
)}
);
}
{ setActiveTab('learn'); setActiveLesson(null); }}>
PHYSICS SOORMO
سندھ ٹیکسٹ بک بورڈ setHearts(5)}
className="flex items-center gap-1.5 text-red-400 font-bold bg-red-950/80 border border-red-500/40 px-2.5 py-1 rounded-full text-xs cursor-pointer hover:bg-red-900 transition"
title="Click to refill hearts!"
>
{hearts}
{isAdmin && (
)}
{activeLesson.unit.number}: {activeLesson.unit.title}
{/* MODE A: TOPIC READING & YOUTUBE LECTURE */}
{activeLesson.mode === 'study' && (
{activeLesson.topicName}
Master the core concepts, derivations, and SI units for {activeLesson.topicName} aligned directly with Sindh Board exam requirements.
Talha's Physics Academy YouTube Lecture
Optional Video
{!quizState.isFinished ? (
<>
{quizState.questions[quizState.currentIndex]?.boardTag}
)}
)}
QUESTION {quizState.currentIndex + 1} OF {quizState.questions.length}
{activeLesson.mode === 'grandQuiz' ? 'Grand Chapter Exam' : 'Topic Quiz'}
{quizState.questions[quizState.currentIndex]?.question}
{quizState.questions[quizState.currentIndex]?.options.map((opt, idx) => {
const isSelected = quizState.selectedOption === idx;
const isCorrect = idx === quizState.questions[quizState.currentIndex].correctAnswer;
let btnStyle = "bg-stone-950 border-stone-800 text-stone-200 hover:border-amber-500/60";
if (quizState.isSubmitted) {
if (isCorrect) btnStyle = "bg-emerald-950 border-emerald-500 text-emerald-200 font-bold";
else if (isSelected) btnStyle = "bg-red-950 border-red-500 text-red-200 font-bold";
} else if (isSelected) {
btnStyle = "bg-amber-950 border-amber-500 text-amber-200 font-bold";
}
return (
);
})}
{quizState.isSubmitted && (
Past Paper Solution Note: {quizState.questions[quizState.currentIndex].explanation}
)}
{!quizState.isSubmitted ? (
) : (
)}
>
) : (
QUIZ COMPLETED!
Score: {quizState.score} / {quizState.questions.length} Correct
XP Earned
+{quizState.score * 10} XP
Status Requirement
60% Pass Target
ADMINISTRATOR CONTROL PORTAL
Manage Sindh Board Curriculum, Analytics & Students
{['analytics', 'cms', 'students'].map((tab) => (
))}
Total Enrolled Students
1,420
Quizzes Completed
18,950
Board Pass Accuracy
76.4%
Curriculum Unit Directory ({selectedClass})
{curriculum[selectedClass].map((unit) => (
))}
{unit.number}
{unit.title}
{unit.topics.length} Subtopics Active
| Student Name | Grade | Total XP | |
|---|---|---|---|
| {user.name} | {user.email} | {selectedClass} | {xp} XP |
| Zainab Soomro | zainab.soomro@gmail.com | Class 9 | 450 XP |
| Bilal Shah | bilal.shah@gmail.com | Class 10 | 620 XP |
OFFICIAL SINDH TEXTBOOK BOARD
{selectedClass.replace('Class', 'CLASS ')} ROADMAP
Complete subtopic quizzes to unlock the 25 MCQ Chapter Grand Exam
{curriculum[selectedClass].map((unit) => {
return (
{/* Chapter Header Banner with Ajrak Pattern Accent */}
{/* Subtopic Stage Nodes */}
);
})}
{unit.number}
{unit.title}
{unit.topics.map((topic, topicIdx) => {
const nodeKey = `${unit.id}_t${topicIdx}`;
const isUnlocked = unlockedNodes[selectedClass]?.includes(nodeKey) || topicIdx === 0;
const offsets = [0, 40, 70, 40, 0, -40, -70, -40];
const offsetX = offsets[topicIdx % offsets.length];
return (
{topic}
);
})}
{/* Chapter Grand Exam Node */}
GRAND CHAPTER EXAM
Comments
Post a Comment