/MCQ

Primary LanguagePython

About The Project

MCQ is an API by which admin can create, edit and delete topics, question related and choices for every question, he can also view the scores of every student or topic and average/max scores as well. Students can enroll in any topic and submit their answers.

Built With

  • Django (3.2.13)
  • Django Rest framework (3.13.1)
  • MySQL (5.7.X)
  • Kafka (2.13-2.6.1)
  • Zookeeper (3.5.8)

Getting Started

This is an example of how you may give instructions on setting up your project locally. To get a local copy up and running follow these simple example steps.

Prerequisites

  • Homebrew
    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  • MySQL
    brew install mysql
  • kafka
    brew install kafka

Installation

  1. Contact a developer to get envirnoment variables

  2. Create a virtual envirnoment

    python -m venv env
  3. Install packages

    pip install -r requirements.txt
    
  4. change the user and password of the DB in settings file to your local ones

  5. Create a Mysql database named "mcq" and run:

    python manage.py migrate
  6. run the server using python manage.py runserver

  7. add Kafka topic to you local kafka environment using kafka-topics --bootstrap-server localhost:9092 --topic mcq --create

  8. run Kafka consumer using python scoring/consumer.py

  9. Go to Swagger Docs to view all endpoints and try them as well.