solution
zip25 files50 kBSolution of Mock exam: React
src/4
components/6
.gitkeep1 kBEditEventForm.jsx8 kBEventCard.jsx2 kBFilterPanel.jsx4 kBRegistrationForm.jsx2 kBStatsDashboard.jsx2 kBTEMPLATES/6
COMPONENT_TEMPLATES.md26 kBCSS_QUICK_REFERENCE.md7 kBINSTRUCTOR_GUIDE.md10 kBQUICK_START.md6 kBREADME.md5 kBTEMPLATE_SYSTEM_OVERVIEW.md8 kBREADME.md
React Exam Template - Event Management System
๐ Overview
This is the template project for the React Advanced Exam. It includes:
- โ Pre-configured Vite + React setup
- โ Complete CSS styling (no CSS work required!)
- โ Component templates with TODO comments
- โ Sample data structure
- โ Instructions and quick start guide
Your focus: Implement React logic (state, handlers, validation, conditional rendering)
๐ Quick Start
1. Install Dependencies
npm install2. Start Development Server
npm run dev3. Read the Instructions
Open the exam instructions file (provided separately) and read it carefully.
4. Follow the Templates
Navigate to the TEMPLATES/ folder:
- QUICK_START.md - Quick setup guide
- COMPONENT_TEMPLATES.md - Complete code templates for all components
5. Create Your Components
Create component files in src/components/ and copy the template code from COMPONENT_TEMPLATES.md
๐ Project Structure
react-part/
โโโ TEMPLATES/
โ โโโ QUICK_START.md โ Start here for setup
โ โโโ COMPONENT_TEMPLATES.md โ Copy component code from here
โโโ src/
โ โโโ components/ โ Create your components here
โ โโโ App.jsx โ Main component (template provided)
โ โโโ index.css โ Pre-written styles (DO NOT MODIFY)
โ โโโ main.jsx โ Entry point (DO NOT MODIFY)
โโโ package.json
โโโ README.md โ You are here
๐ฏ What You Need to Do
Question 1: Event Dashboard & Filtering (35 points)
- Set up state in
App.jsx - Implement filtering logic (derived state)
- Create
EventCard.jsxwith conditional rendering
Question 2: Filter Panel (20 points)
- Create
FilterPanel.jsx - Implement controlled form inputs
- Add filter summary and reset functionality
Question 3: Edit Event Form (30 points)
- Create
EditEventForm.jsx - Implement form validation
- Add conditional fields based on event type
Question 4: Statistics Dashboard (15 points)
- Create
StatsDashboard.jsx - Calculate statistics from filtered events
- Add conditional alert for high occupancy
Bonus: Registration System (10 points)
- Optional extra credit
- Create simple registration form
- Track registrations per event
๐จ CSS Is Already Done!
All styling is complete in src/index.css. Just use the provided CSS classes:
Common Classes
- Layout:
container,card,grid grid-2 - Buttons:
btn btn-primary,btn btn-secondary - Form:
form-group,form-label,form-input,form-error - Badges:
badge badge-workshop,badge badge-available - Alerts:
alert alert-warning,alert alert-success
No CSS knowledge required - just use the classes as shown in templates!
๐ Before You Start
- โ Read the exam instructions thoroughly
- โ
Review
TEMPLATES/QUICK_START.mdfor setup - โ
Open
TEMPLATES/COMPONENT_TEMPLATES.md- this has all the code you need - โ
Create component files in
src/components/ - โ Copy template code and implement the TODOs
โ ๏ธ Important Rules
โ DO:
- Use the provided CSS classes
- Follow the template structure
- Implement all TODOs
- Test frequently with
npm run dev - Focus on React logic
โ DON'T:
- Modify
index.css(styling is complete) - Use
useEffectfor filtering (use derived state) - Store calculated values in state (calculate during render)
- Forget to make form inputs controlled
- Skip validation
๐งช Testing Checklist
Before submitting, test:
- Filters work individually and combined
- Event cards show correct badges
- Edit form validates all fields
- Conditional fields appear/disappear correctly
- Statistics update when filters change
- No console errors
- App runs with
npm run dev
๐ฆ Submission
- Test everything thoroughly
- Add your info to
App.jsx(Student ID, Full Name, Date) - Compress the folder (exclude
node_modules) - Name:
StudentID_ReactExam.zip - Upload to designated platform
๐ Need Help?
Components Not Showing?
- Check browser console for errors
- Verify imports in
App.jsx - Make sure component is exported (
export default)
Styles Not Working?
- Class names are case-sensitive
- Check spelling matches template exactly
- Verify
index.cssis imported inmain.jsx
State Not Updating?
- Are inputs controlled? (
value={...}) - Are you using setState functions?
- Check event handler is called correctly
๐ Resources Provided
- TEMPLATES/QUICK_START.md - Setup and tips
- TEMPLATES/COMPONENT_TEMPLATES.md - All component code
- src/index.css - Complete styling
- Exam Instructions - Question details and grading
๐ Good Luck!
Remember:
- Read the templates carefully
- Test frequently
- Focus on React logic, not CSS
- Follow the TODO comments
- Ask if something is unclear
You've got this! ๐