Git Product home page Git Product logo

quiz-api's Introduction

Quiz-API

API Endpoints:

  • POST /quizzes - to create a new quiz

example: (body) {

"question" : "What is the capital of India?",
"option" : ["New Delhi", "Rajasthan", "Uttarakhand", "Goa"],
"right_answer" : 0,
"start_date" : "29/5/2023 18:56:33",
"end_date" : "30/5/2023 00:40:33"

}

  • GET /quizzes/active - to retrieve the active quiz (the quiz that is currently within its start and end time)
  • GET /quizzes/:id/result - to retrieve the result of a quiz by its ID
  • GET /quizzes/all - to retrieve the all quizes

Functionalities:

* status is changed using cron job every minute

* rate-limiting to prevent abuse of the API is done using throttling (2 or 3 requests per minute)

* filesystem caching is done (every 5 minutes) to reduce the response time of frequently accessed data

Create a Quiz: Users is able to create a quiz by sending a POST request to the API with the following fields:

  • question: the text of the question
  • options: an array of the answer options for the question
  • rightAnswer: the index of the correct answer in the options array
  • startDate: the date and time when the quiz should start
  • endDate: the date and time when the quiz should end

Get Active Quiz: Users is able to retrieve the active quiz (the quiz that is currently within its start and end time).

Get Quiz Result: After the 5 minute of end time of a quiz, users is able to retrieve the result of the quiz. The result is basically the right answer

quiz-api's People

Contributors

nazim9873 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.