https://github.com/navdevl/questiongenerator
https://github.com/navdevl/questiongenerator
Last synced: 11 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/navdevl/questiongenerator
- Owner: Navdevl
- Created: 2019-03-13T16:38:52.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-03-13T20:37:40.000Z (over 7 years ago)
- Last Synced: 2025-06-09T17:42:58.972Z (about 1 year ago)
- Language: Ruby
- Size: 32.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Question Generator
This is a Rails application that can perform the following operation.
1. Given the required parameters, this application can generate a set of questions that satisfies the passed condition.
2. This is completely API only application.
## Instruction
The application is hosted https://questions-generator.herokuapp.com and has two endpoints.
1. The root endpoint https://questions-generator.herokuapp.com/questions that shows the loaded questions. Given the restriction to DB, the application loads a set of question from an YAML file located in https://github.com/Navdevl/questionGenerator/blob/master/lib/data/questions.yml
2. POST call to https://questions-generator.herokuapp.com/questions/generate with a payload like the one given below can generate appropriate results.
`{"total": 100, "percentages": { "easy": 50, "medium": 25, "hard": 25 }}`
3. The total percentages should equal to 100% else there will be an error.
4. If the requirement can't be satisfied, it will also thrown an error.
## Logic
You can find the whole logic in the `lib/question_set.rb` file.
## Production
This is already hosted in https://questions-generator.herokuapp.com and also there is a postman documentation that you can make use of. https://documenter.getpostman.com/view/2476650/S17kyqbM