Quran-Quiz Documentation

quran-quiz is a library for generating quizzes about the Quran. This library is designed to enhance Quranic memorization. The available APIs currently include:

Installation

Install quran-quiz using your favorite package manager.

pnpm install quran-quiz

Example

Follow the steps below to generate a quiz about the Quran.

Request

import { guessSurah } from 'quran-quiz'

const data = await guessSurah.bySurah({
  amount: 3,
  select: [111, 112, 113, 114],
})

When the options.value is set to 1, it means the answer is correct, while when the options.value is set to 0, it means the answer is incorrect.

Response

{
  "data": [
    {
      "question": " قُلْ هُوَ ٱللَّهُ أَحَدٌ",
      "options": [
        {
          "text": "Al-Masad",
          "value": 0
        },
        {
          "text": "Al-Falaq",
          "value": 0
        },
        {
          "text": "An-Nas",
          "value": 0
        },
        {
          "text": "Al-Ikhlas",
          "value": 1
        }
      ]
    },
    // ...
  ],
  "meta": {
    "type": "guessSurahBySurah",
    "select": [
      111,
      112,
      113,
      114
    ],
    "amount": 3
  }
}