Back to Blog

Exam API with answers and explanations

An exam API with answers and explanations is different from a basic question bank.

A basic API can tell your application:

The correct answer is B.

A learning-focused API should also help your application answer:

Why is B correct, and what should the student understand from this question?

That difference matters if you're building a revision app, CBT platform, AI tutor or exam-preparation product where students are expected to learn from mistakes rather than simply collect scores.

SdashAPI currently provides structured questions, answers and solutions for UTME, WASSCE, NECO and Post-UTME, with richer educational data available through its higher API versions. SdashAPI

Answer and explanation are not the same thing

Consider a Mathematics question.

A basic question API might return:

{
  "answer": "b"
}

That's enough for automatic marking.

But after the student gets it wrong, displaying:

Correct answer: B

doesn't teach much.

A more useful response includes a solution:

{
  "answer": "b",
  "solution": "Subtract 5 from both sides to get 2x = 10, then divide by 2 to get x = 5."
}

SdashAPI V1 includes both answer and solution in its documented question schema. The answer corresponds to the key inside the option object. SdashAPI

A real SdashAPI request

The current V1 question endpoint is:

GET https://sdashapi.com/api/v1/q

For example:

curl -X GET \
  "https://sdashapi.com/api/v1/q?subject=chemistry&type=utme&year=2022" \
  -H "AccessToken: YOUR_ACCESS_TOKEN"

A successful response can contain:

{
  "status": 200,
  "data": {
    "id": 4821,
    "question": "Which of the following is the chemical formula for table salt?",
    "option": {
      "a": "NaCl",
      "b": "KCl",
      "c": "CaCO3",
      "d": "NaOH"
    },
    "answer": "a",
    "solution": "NaCl is sodium chloride.",
    "image": null,
    "examtype": "UTME",
    "examyear": "2022"
  }
}

This structure is documented by SdashAPI and gives a normal CBT application enough information to display the question, mark it and show a solution afterwards. SdashAPI

When a simple solution isn't enough

Suppose a student answers a Biology question incorrectly.

Showing this:

Wrong.
Correct answer: C.

is useful for marking.

Showing this is more useful for learning:

Your answer: A
Correct answer: C

Why C is correct:
...

Why A is wrong:
...

Key idea:
...

This is where richer explanation data becomes valuable.

According to the current SdashAPI API reference, its V3 explanation structure can include:

{
  "explanation": {
    "summary": "Quick summary of the answer.",
    "detailed": "Detailed step-by-step reasoning...",
    "steps": [
      "Step 1...",
      "Step 2..."
    ],
    "why_correct": "Option B is correct because...",
    "why_others_wrong": {
      "a": "Incorrect because...",
      "c": "Incorrect because..."
    }
  }
}
``` :chatgpt-content-reference{index="3"}


That allows developers to build a much richer review screen without trying to generate an explanation from scratch after every attempt.

## One API can support two very different modes

This is particularly useful when your app has both **Exam Mode** and **Practice Mode**.

### Exam Mode

During a timed mock:

```text
Question
   ↓
Choose Answer
   ↓
Next Question
   ↓
Submit Exam
   ↓
Score

You probably don't want to show the answer or explanation immediately.

Practice Mode

During revision:

Question
   ↓
Choose Answer
   ↓
Check Answer
   ↓
Correct / Incorrect
   ↓
Read Explanation
   ↓
Continue

Same question data.

Different learning experience.

SdashAPI's documentation says the correct answer and solution are included directly with question data rather than requiring a separate answer-checking API request. SdashAPI

Why include the answer in the response?

At first, it may sound safer to have another endpoint:

POST /check-answer

for every response.

But for many practice applications, that creates unnecessary requests.

If your backend already has:

const correctAnswer = question.answer;

and the student submits:

const selectedAnswer = "b";

checking it is simply:

const correct = selectedAnswer === correctAnswer;

The current SdashAPI answer guide specifically recommends comparing the selected option key with the returned answer value. SdashAPI

For strict mock exams, your own backend can still remove answer, solution and explanation information before sending active questions to the student's device.

Explanations change what you can build

Once explanations are structured rather than being one large paragraph, you can create different learning experiences.

For example:

Quick Review

Show only:

Correct Answer: B

Quick explanation:
...

Deep Review

Show:

Why B is correct
...

Step-by-step solution
1. ...
2. ...
3. ...

Why A is wrong
...

Why C is wrong
...

Why D is wrong
...

Mistake Practice

Store incorrectly answered question IDs:

Questions You Got Wrong
17 questions

and let the student revisit them later.

Because SdashAPI assigns a unique id to questions, applications can use IDs for bookmarks, attempt history and error reporting. SdashAPI

Different API versions serve different products

Not every application needs the largest possible response.

SdashAPI currently separates its question infrastructure into multiple versions.

According to its current API reference, V1 focuses on core question data, V2 adds metadata and taxonomy, V3 adds richer explanation information, while V4 provides additional intelligence capabilities. SdashAPI

That distinction is useful.

A timed CBT simulator may primarily care about:

Question
Options
Answer

A revision platform may care about:

Question
Options
Answer
Solution
Topic
Difficulty
Explanation

And an adaptive tutor may want even richer contextual information.

You don't necessarily need to request the most advanced data for every screen.

Explanations can improve analytics too

Imagine a student completes 100 Physics questions.

Your app discovers:

Mechanics          82%
Waves              71%
Electricity        43%
Optics             68%

Simply saying:

Electricity: 43%

identifies the problem.

It doesn't solve it.

A stronger product can take incorrectly answered questions from that area and combine them with explanations:

Electricity needs attention.

You missed 8 of 14 questions.

Review mistakes
        ↓
Read explanations
        ↓
Try related questions

Now analytics leads directly back into learning.

SdashAPI's richer API layers include metadata such as topics, subtopics, difficulty, skills and tags where available, which can support these kinds of experiences. SdashAPI

Explanations are also useful for AI tutors

There is another interesting use case.

Instead of asking an AI model:

Generate a random JAMB Physics question and explain it.

you can begin with an existing structured examination question.

Your system becomes:

Exam Question
      ↓
Correct Answer
      ↓
Existing Explanation
      ↓
AI Tutor
      ↓
Student asks follow-up questions

That gives the AI something concrete to work from.

For example, the student could ask:

I understand why B is correct, but why can't it be D?

Your tutoring layer already has the question, answer and explanation context.

This is a more grounded architecture than asking a language model to invent the entire examination experience from nothing.

Handle missing explanations properly

There's an important practical point: don't assume every historical question has every optional field.

SdashAPI's developer terms explicitly note that optional fields such as solutions or explanations may not be available for every question. SdashAPI

So don't write:

return question.explanation.detailed;

without checking whether it exists.

Your interface could instead do:

if (question.explanation?.detailed) {
  showDetailedExplanation();
} else if (question.solution) {
  showSolution();
} else {
  showAnswerOnly();
}

The student still gets a usable experience even when richer explanation data isn't available.

Let students report questionable explanations

This is another feature worth adding.

SdashAPI currently provides:

POST https://sdashapi.com/api/v1/report

and documented report types include:

wrong_answer
typo
missing_image
incorrect_explanation
duplicate_question
formatting_issue
incorrect_metadata
missing_passage
unclear
other
``` :chatgpt-content-reference{index="10"}


So your review screen could quietly include:

```text
Was something wrong with this question?

[ Report Question ]

If a student believes the explanation is incorrect, you can submit the question ID and issue type instead of losing the feedback.

Answers make a CBT app work. Explanations make it teach.

That's probably the simplest distinction.

If you're building only a mock-examination simulator, questions plus correct answers may be enough.

If you're building a product students are expected to use repeatedly to improve their performance, explanations become much more important.

A useful learning loop looks like:

Attempt Question
       ↓
Check Answer
       ↓
Understand Mistake
       ↓
Review Explanation
       ↓
Try Again
       ↓
Improve

SdashAPI provides the structured exam-data layer for that workflow, covering UTME, WASSCE, NECO and Post-UTME. Developers can use the SdashAPI documentation to compare the available API versions and choose the amount of question, answer, metadata and explanation data their application actually needs. SdashAPI

Avatar

How can we help?

We reply immediately

Hello! 👋 How can we help you today?