Create a school rating system (v1) based on completed fields and user‑generated content.
The score will be used to compute a school’s ranking within its city, state, and country, and these values must be returned in the school details endpoint.
Scoring Rules
1. Facilities Score (Maximum 400 Points)
Schools receive points based on available facilities:
- Laboratory – 40 points
- Library – 40 points
- Sports Hall / Gym – 40 points
- Quality of Restrooms – 40 points
- Study Hall – 40 points
- Smart Classrooms – 40 points
- Cafeteria (or Buffet) – 40 points
- Computer Lab – 40 points
- Transportation Service (or Dormitory) – 40 points
2. School Information Score (Maximum 100 Points)
- Location – 10 points
- School Images – 50 points
- Phone Number – 5 points
- Website – 25 points
- Email – 5 points
- Physical Address – 10 points
Requirements
1. Score Calculation
- Implement a function to calculate a school’s score based on the rule sets above.
- Ensure total scores respect their maximum caps.
2. Ranking System
Using the computed total score:
- Rank schools within their city
- Rank schools within their state
- Rank schools within their country
3. Ranking Recalculation Strategy
Rankings can be recalculated in two ways:
Scheduled Job (Recommended)
- Runs daily or weekly
- Recalculates:
- All school scores
- City / state / country rankings
- Stores ranking results in cache or database
Event-based (Optional)
- Trigger recalculation whenever score-affecting data changes
4. School Details Endpoint
Extend the school details endpoint to include:
score
city_rank
state_rank
country_rank
5. Recalculation Triggers
Score and ranking should be recalculated when:
- School information is updated
- Comments are added or removed
- Facilities are added or removed
- Images are uploaded
- Contact information changes (phone, email, location, address)
Acceptance Criteria
- School score is calculated correctly and respects maximum limits
- Schools receive accurate rankings in:
- Rankings are recalculated through scheduled jobs or change events
- The school details endpoint returns score and ranking fields
Create a school rating system (v1) based on completed fields and user‑generated content.
The score will be used to compute a school’s ranking within its city, state, and country, and these values must be returned in the school details endpoint.
Scoring Rules
1. Facilities Score (Maximum 400 Points)
Schools receive points based on available facilities:
2. School Information Score (Maximum 100 Points)
Requirements
1. Score Calculation
2. Ranking System
Using the computed total score:
3. Ranking Recalculation Strategy
Rankings can be recalculated in two ways:
Scheduled Job (Recommended)
Event-based (Optional)
4. School Details Endpoint
Extend the school details endpoint to include:
scorecity_rankstate_rankcountry_rank5. Recalculation Triggers
Score and ranking should be recalculated when:
Acceptance Criteria