Skip to content

Latest commit

 

History

History
executable file
·
91 lines (66 loc) · 1.52 KB

README.md

File metadata and controls

executable file
·
91 lines (66 loc) · 1.52 KB

cquestionnaire

Build questionnaires

Table of contents

  1. Requirements
  2. Installation
  3. Usage
  4. License

Requirements

  • Python 3.7.4
  • MySQL Community Server 5.7.12

Installation

Install from the source:

$ git clone https://github.com/cjz25/cquestionnaire.git

Create a virtual environment:

$ cd cquestionnaire/
$ python3 -m venv env

Activate the virtual environment:

$ source env/bin/activate

Note: For Windows

> .\env\Scripts\activate

Install requirements:

$ pip3 install -r requirements.txt

Usage

Set up your configuration file: my.cnf

Note: Please make sure you have created a database.

Migrate

$ python3 manage.py migrate

Run the server

$ python3 manage.py runserver

You have the following APIs:

For questionnaires:

GET: /api/questionnaires/list?size=5&page=1
POST: /api/questionnaires/
GET: /api/questionnaires/<pk>/
PUT: /api/questionnaires/<pk>/
DELETE: /api/questionnaires/<pk>/

For questions with choices:

GET: /api/questionnaires/<questionnaire_pk>/questions/
POST: /api/questionnaires/<questionnaire_pk>/questions/
GET: /api/questionnaires/<questionnaire_pk>/questions/<pk>/
PUT: /api/questionnaires/<questionnaire_pk>/questions/<pk>/
DELETE: /api/questionnaires/<questionnaire_pk>/questions/<pk>/

For modifying the sequence of a question:

PUT: /api/questionnaires/<questionnaire_pk>/questions/<pk>/sequence/

License

MIT License