Offline CBT question database
An offline CBT question database allows a CBT or exam-preparation application to continue serving questions even when the user has poor internet access or no active connection.
This can be useful for school CBT systems, mobile exam-preparation apps and areas where internet connectivity is unreliable.
There are two main ways to build this: cache permitted API data for temporary offline use, or obtain a licensed bulk question dataset that can be stored in your own database.
For developers working with UTME, WASSCE, NECO and Post-UTME questions, SdashAPI supports API access and also advertises bulk dataset licensing for teams that need their own offline dataset. SdashAPI
How an offline CBT app can work
A common architecture is:
Internet Available
↓
Fetch Questions
↓
Store Locally
↓
Student Goes Offline
↓
Take CBT
↓
Save Answers + Results Locally
↓
Internet Returns
↓
Synchronise Progress
For a mobile application, temporary local storage might use SQLite or another device database.
For a school computer lab, you could instead run a database on a local server accessible through the school's LAN.
Using the real SdashAPI endpoint
For API-based applications, don't guess the endpoint structure.
According to the current SdashAPI documentation, the V1 question endpoint is:
GET /api/v1/q
Authentication uses the AccessToken request header. SdashAPI
For example, this is a real documented request for UTME Chemistry questions from 2022:
curl -X GET "https://sdashapi.com/api/v1/q?subject=chemistry&type=utme&year=2022" \
-H "AccessToken: YOUR_ACCESS_TOKEN"
The documented response structure includes fields such as id, question, section, option, answer, solution, image, examtype and examyear. SdashAPI
That makes the data much easier to save locally than trying to convert a PDF into database records.
Fetching a batch for a CBT session
For an offline-friendly CBT session, you normally don't want to request one question every time the student presses Next.
SdashAPI supports the limit parameter.
For example, the documentation gives this pattern for requesting 40 UTME Physics questions from 2019:
GET https://sdashapi.com/api/v1/q?subject=physics&type=utme&year=2019&limit=40
AccessToken: YOUR_ACCESS_TOKEN
``` :chatgpt-content-reference{index="3"}
You could fetch the questions while the student has internet, prepare the session, and then allow navigation through the already-loaded questions.
The documentation currently states that a question request can return up to **50 questions per call**. When `limit` is greater than 1, the `data` field becomes an array rather than a single question object. :chatgpt-content-reference{index="4"}
That distinction matters when writing your application:
```javascript
const response = await fetch(
"https://sdashapi.com/api/v1/q?subject=biology&type=utme&year=2024&limit=40",
{
headers: {
AccessToken: process.env.SDASH_API_KEY
}
}
);
const result = await response.json();
result.data.forEach(question => {
// Store permitted session data locally
});
The request pattern and AccessToken authentication above follow the current SdashAPI documentation. SdashAPI
Store the session locally
For a mobile CBT app, you could maintain local records containing information such as:
question_id
question
options
image
selected_answer
answered
flagged_for_review
Your application can then move between questions without another network request.
For example:
40 questions downloaded
↓
CBT begins
↓
Internet disappears
↓
Questions remain available
↓
Student completes test
↓
Result saved locally
This is different from downloading and permanently redistributing an entire API question bank. Your implementation needs to follow the storage and licensing rights that apply to your SdashAPI arrangement.
Don't hard-code examination years
Another useful feature in the current SdashAPI documentation is the years endpoint:
GET https://sdashapi.com/api/v1/years
It returns available examination years for building selectors rather than requiring you to guess them. The documentation also provides /api/v1/exams for retrieving examination types. SdashAPI
So your app can do:
Load supported years
↓
Student selects 2023
↓
Download selected CBT session
↓
Begin practice
This is cleaner than hard-coding a long list of years into the app.
Full offline database is different
Suppose your requirement is:
I want all the questions inside my own database so my app can work completely offline.
That's different from fetching an individual CBT session from an API.
Your architecture becomes:
Licensed Dataset
↓
Your Database
↓
Your CBT Backend
↓
Mobile App / School Computers
SdashAPI's current coverage page specifically advertises bulk dataset licensing in formats including JSON, CSV and SQL for teams that need the full dataset offline. SdashAPI
For this type of project, discuss the licensing and permitted storage arrangement through SdashAPI Contact rather than assuming normal API access grants permanent bulk-storage rights.
Local database structure
A simple offline database could contain tables or collections such as:
exams
subjects
questions
passages
question_images
attempts
student_answers
results
A question record could reference:
ID
Exam
Subject
Year
Question
Options
Answer
Solution
Image
Passage
Then your CBT engine queries the local database rather than requiring an internet request during every examination.
Save student progress offline too
Questions aren't the only data that should survive a lost connection.
Save:
Selected answers
Current question
Remaining session state
Flagged questions
Completed attempts
Results awaiting synchronisation
When internet access returns, the app can synchronise the necessary user data with your server.
This creates a much better experience than forcing the student to restart an examination.
Test with real SdashAPI data first
Before designing a large offline system, you can use SdashAPI's development access to test your question-loading and CBT logic.
A practical flow is:
Create SdashAPI account
↓
Use development credits
↓
Call /api/v1/q
↓
Fetch a batch of questions
↓
Build local session storage
↓
Disconnect internet
↓
Complete CBT
↓
Reconnect and sync
The official documentation includes tutorials for fetching questions, filtering by examination and year, CBT year selection and offline caching. SdashAPI
For a fully offline CBT question database, consider a properly licensed bulk dataset rather than trying to turn normal API requests into an unofficial permanent database. For ordinary CBT sessions, fetching and preparing the required questions before the examination can already make the experience much more resilient to unstable internet connections.