Architecture · Education · SaaS
Building an exam platform where an exam is data, not code.
Design notes from building Score Delta: modelling exams, sections and marking as data so a new exam needs no code release, and how scoring reads each pattern.
Key takeaways
- Hard-coding each exam into the codebase means every new exam is a code release.
- Modelling subjects, topics, sections, timing and marking as data lets an admin add an exam without a developer.
- Scoring must read the exam's pattern, not assume one rule.
- The trade-off is more upfront modelling work and a more careful admin panel.
The rule from day one
When I wrote the first scope document for Score Delta, one rule stood above the rest: an exam is data, not code. A new exam, with its subjects, topics, marking scheme, sections and plans, is set up in the admin panel and needs no code release.
It is a simple rule with large consequences, and it came from a boring observation: Himachal Pradesh has many government exams, and each differs in sections, number of questions, duration and negative marking. If every exam were special-cased in code, adding the eleventh would be as much work as adding the first, and a typo in a conditional could change another exam's scoring.
What counts as "data"
For each exam, the platform stores:
- Subjects and topics, as a tree, so tests and reports can be organised by topic.
- Pattern: the sections, how many questions each has, the duration and the order.
- Marking scheme: marks per correct answer and the negative marking per wrong one, possibly different per section.
- Languages available for the paper.
- Plans: which tests and features a purchase unlocks for that exam.
None of that appears as an if ($exam == 'patwari') in the code. The code asks the pattern what to do.
Scoring that reads the pattern
When a student submits a test, the scoring service loads the exam's pattern and applies it: it walks the sections, applies each section's marks and penalty, counts unattempted questions and produces the score, accuracy and rank. Because the rules come from data, an exam with different negative marking is correct automatically.
This also means the same engine powers full mocks, sectional tests and topic tests: only the pattern attached to the test differs.
Reports built on topics
Because every question belongs to a topic in the tree, the report after each test can group results by topic and list weak ones. That is the feature that turns a score into a plan. See how to read a mock test report for the student's side.
One backend, three front doors
Score Delta has a public website, a React student app served through Inertia, a React Native Android app and a Filament admin panel. All of them use the same backend rules, so a student's plan, attempts and progress are identical everywhere. The Android app uses an answer outbox, so a dropped connection does not lose answers.
What it cost
Data-driven design is not free:
- More modelling upfront. I spent more time on the pattern model than the first exam would have needed.
- A richer admin panel. The admin must be able to create and edit patterns safely.
- Validation matters more. A bad pattern can break scoring, so the panel validates it before it can be used for a test.
- Testing the engine, not the exam. The automated tests exercise the scoring rules with several patterns, instead of testing one exam at a time.
When not to do it
If you only ever have one exam, or the variation is tiny, a simple configuration is enough. The data-driven approach pays off when new variants arrive often, and when non-developers should be able to add them.
The honest status
Score Delta is early. It covers ten Himachal Pradesh exams, has 2,730 mock tests and more than 14,000 practice questions, and runs on Laravel 12 with a React front end. The question banks were created with scripts and are covered by automated tests, but not every question has been reviewed by a subject teacher, so a wrong answer can exist. I say that on the product page, and I would rather say it than have a student find out.
Frequently asked questions
Why not use a generic quiz plugin?
A generic quiz tool rarely models sections, timing, negative marking and topic-level reports the way a government exam needs them. Building the pattern model was the point.
Does a data-driven design make the app slower?
Not meaningfully. The pattern is small and can be cached. The cost is development complexity, not runtime speed.
Can this approach work for other kinds of products?
Yes. Wherever variants differ in rules rather than in code, such as pricing plans, form builders or workflow engines, treating the variation as data is the same idea.
Read the Score Delta build story, including the bugs found while launching.
Read the case study