Skip to content
Permalink
bab8bf4efb
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
30 lines (20 sloc) 721 Bytes
# Functions
### getQuestion
-Input (category, difficulty, nrQuestions = 1)
To get a random category or difficulty ("" or "Any" or "Random")
-Output (questionsSet)
A dictionary if one question, a list of dictionaries if more than one
### getCategories
-Input (onlyCategories = False, , nrCat = 0)
True returns categories without ID numbers
nrCat returns a set number of random categories
-Output (categories)
#### Error Codes
0 - There was an error opening the URL
1 - Error reading JSON data
2 - The number of questions requested not valid
3 - Category not valid
4 - Difficulty not valid
5 - No results were found
6 - Invalid parameter
7 - Token not found or all available question were used