Shift from querying individual database rows to generating complete, psychometrically balanced examination papers in a single API call.
Building a real exam or mock test requires more than picking random questions. Real examination bodies (JAMB, WAEC) curate papers with calibrated difficulty distributions, multi-topic syllabus balancing, and cheat-resistant distractor ordering.
The ALOC Assessment Construction Engine handles this entire psychometric assembly server-side. By default, every paper and session is assembled exclusively from authentic historical past questions (contentSource: "historical"). If you want to explicitly include AI-generated questions, pass contentSource: "synthetic" or contentSource: "all" in the request body.
Use standard presets to immediately generate official examination structures without manual question counting:
| Preset Code | Question Count | Psychometric Split (E / M / H) | Target Exam Body |
|---|---|---|---|
| jamb_utme_180 | 180 Questions (60 Eng + 40×3) · 20 cr | 30% Easy · 50% Med · 20% Hard | JAMB Full 4-Subject UTME |
| jamb_english_60 | 60 Questions · 5 cr | 30% Easy · 50% Med · 20% Hard | JAMB Use of English |
| jamb_standard_40 | 40 Questions · 5 cr | 30% Easy · 50% Med · 20% Hard | JAMB Single Elective |
| waec_standard_50 | 50 Questions | 25% Easy · 55% Med · 20% Hard | WAEC / WASSCE |
| micro_test_10 | 10 Questions | 30% Easy · 50% Med · 20% Hard | Quick Diagnostic |
curl -X POST https://dev.aloc.com.ng/api/v1/assessments/generate \
-H "X-API-Key: aloc_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"subject": "mathematics",
"examType": "jamb",
"preset": "jamb_standard_40",
"shuffleOptions": true,
"seed": "lagos_state_mock_batch_1"
}'{
"data": {
"id": "7f8b91a2-58cc-4372-a567-0e02b2c3d479",
"subject": "mathematics",
"examType": "jamb",
"preset": "jamb_standard_40",
"seed": "lagos_state_mock_batch_1",
"totalQuestions": 40,
"difficultyBreakdown": {
"easy": 12,
"medium": 20,
"hard": 8
},
"topicsCovered": [
"algebra",
"calculus",
"trigonometry",
"geometry"
],
"questions": [
{
"id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"text": "Evaluate log_2(32) + log_3(81)",
"options": {
"a": "8",
"b": "9",
"c": "10",
"d": "12"
},
"correctAnswer": "b",
"subject": "mathematics",
"examType": "jamb",
"year": 2019,
"metadata": {
"topic": "algebra",
"subtopic": "indices-logarithms",
"difficultyScore": 3,
"estimatedTime": 90
}
}
]
}
}Passing a deterministic string to seed guarantees that every candidate or test-taker receives the exact same set of questions and difficulty calibration.
For live test environments, computer-based testing (CBT) engines, and exam apps, you can provision scoped, time-bound session tokens. This ensures each student receives a dedicated, reproducible question set with an automatic 2-hour lifecycle:
Call POST /api/v1/assessments/sessions when the student starts an exam (consumes 5 credits). ALOC creates a dedicated assessment instance locked to your parameters with a 2-hour TTL.
curl -X POST https://dev.aloc.com.ng/api/v1/assessments/sessions \
-H "X-API-Key: aloc_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"subject": "mathematics",
"examType": "jamb",
"preset": "jamb_standard_40",
"seed": "student_candidate_98214"
}'{
"data": {
"sessionId": "sess_01j7b8q9x0e8d9a7c6f5e4d3c2",
"totalQuestions": 40,
"preset": "jamb_standard_40",
"seed": "student_candidate_98214",
"expiresAt": "2026-08-30T23:15:00+01:00"
}
}Fetch the questions allocated to that candidate's active sitting using their sessionId. Reconnecting or re-fetching within the active 2-hour session window consumes 0 credits.
curl https://dev.aloc.com.ng/api/v1/assessments/sessions/sess_01j7b8q9x0e8d9a7c6f5e4d3c2/questions \ -H "X-API-Key: aloc_live_YOUR_KEY"
{
"data": [
{
"id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"subject": "mathematics",
"examType": "jamb",
"year": 2019,
"questionNumber": 1,
"text": "Evaluate log_2(32) + log_3(81)",
"options": {
"a": "8",
"b": "9",
"c": "10",
"d": "12"
},
"correctAnswer": "b",
"metadata": {
"topic": "algebra",
"subtopic": "indices-logarithms",
"difficultyScore": 3,
"estimatedTime": 90
}
}
]
}