GithubHelp home page GithubHelp logo

vikingpathak / flask_user_assessment_mcq Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 0.0 21 KB

The Flask app built using Flask restful services consists of an assessment test with admin control. Admin can upload questions using CSV/XLSX format, update or delete questions, view results. It also supports multiple User registration, login and logout functionalities, and carrying out assessment. Code consists of only the Flask App and no frontend is implemented.

Python 100.00%

flask_user_assessment_mcq's Introduction

Setting up the environment

  1. Create a the virtual environment and install all the requirements or dependencies.
>>> python3 -m venv venv
>>> source venv/Scripts/activate
>>> pip install -r requirements.txt
  1. Create a mySQL database with the following credentials. Also, run the following scripts to initialize the database.
DATABASE CREDENTIALS

USER     =  root
PASSWORD =  password
*RUN THIS SCRIPT*
-----------------
CREATE DATABASE Assessment;


INSERT INTO 
    _admin
VALUES 
    ('admin', 'password');


INSERT INTO 
    _Options
VALUES 
    (1, 'Strongly Agree', 2), 
    (2, 'Agree', 1), 
    (3, 'Neutral', 0), 
    (4, 'Disagree', -1), 
    (5, 'Strongly Disagree', -2);
  1. Import the Assessment.postman_collection.json file in the POSTMAN app/web.
  2. Run the Flask App.
>>> python main.py

Testing using POSTMAN

Accepted JSON formats for the API.

1) Register User

    {
        "details": {
            "firstname": "Amit",
            "lastname": "Pathak",
            "email": "[email protected]",
            "username": "amit_pathak",
            "password": "qwerty123"
        }
    }

2) Login User

    {
        "username": "amit_pathak",
        "password": "qwerty123"
    }

3) Delete User

    {
        "username": "amit_pathak",
        "password": "qwerty123"
    }

4) Submit Response

    {
        "response": {
            "1": 2, "2": 3, "3":1, "4":5, "5":1, "6":1, "7":2
        }
    }

    > 1 - 'Strongly Agree'
    > 2 - 'Agree'
    > 3 - 'Neutral'
    > 4 - 'Disagree'
    > 5 - 'Strongly Disagree'

5) Admin Login

    {
        "admin": {
            "username": "admin",
            "password": "password"
        }
    }

6) Update Questions

    {
        "update_questions": {
            "10": "This is an updated 10th question",
            "9": "Updating 9th question"
        }
    }

7) Delete Question

    {
        "delete_questions": [2, 3, 10]
    }

flask_user_assessment_mcq's People

Contributors

vikingpathak avatar

Stargazers

 avatar  avatar  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.