diff --git a/client/about.html b/client/about.html index 6ec089ab2..04091edce 100644 --- a/client/about.html +++ b/client/about.html @@ -50,7 +50,7 @@ Database
GET qbreader.org/api/check-answer+ Judge an answer to be correct, incorrect, or prompt. Directed prompts are supported. +
+ + +answerline: string
+ required
+ <b> and <u>, if they are present.
+ givenAnswer: string
+ required
+ array of the form [directive, directedPrompt].
+ : ["accept" | "reject" | "prompt", string | null]
+ The API documentation for QB Reader.
+
+ Base URL: https://www.qbreader.org/api
+
+ The base URL for the multiplayer API is qbreader.org/api/multiplayer
+ (Note: There is only one multiplayer API endpoint.)
+
+ You can find the python wrapper module for the API here: + https://github.com/qbreader/python-module. +
++ New rooms are created on the server when a WebSocket connection is established. +
++ GET requests should always have parameters passed through the URI, + and POST requests should have parameters passed through the body. +
++ The API is rate-limited to 20 requests per second. +
+ +GET /queryPOST /random-questionGET /packetGET /packet-tossupsGET /packet-bonusesGET /num-packetsGET /set-listGET /multiplayer/room-listGET /check-answerPOST /report-questionGET /random-nameGET qbreader.org/api/room-list+ Get public rooms. +
+ + ++ This endpoint takes no parameters. +
+object with the following properties:
+ <room name>: [number, number, boolean]
+ [<number of players>, <number of active players>,
+ <if the room is permenant>].
+ GET qbreader.org/api/num-packets+ Get the number of packets in a set. +
+ + +setName: string
+ required
+ /set-list for a list of all sets.
+ number of packets in the set.
+ GET qbreader.org/api/packet-bonuses+ Get only bonuses from a packet. +
+ + +setName: string
+ required
+ /set-list for a list of all sets.
+ packetNumber: number
+ required
+ object with the following properties:
+ bonuses: Bonus[]
+ Bonuses
+ that are in the packet.
+ GET qbreader.org/api/packet-tossups+ Get only tossups from a packet. +
+ + +setName: string
+ required
+ /set-list for a list of all sets.
+ packetNumber: number
+ required
+ object with the following properties:
+ tossups: Tossup[]
+ Tossups
+ that are in the packet.
+ GET qbreader.org/api/packet+ Get a specific packet from a set. +
+ + +setName: string
+ required
+ /set-list for a list of all sets.
+ packetNumber: number
+ required
+ object with the following properties:
+ tossups: Tossup[]
+ Tossups
+ that are in the packet.
+ bonuses: Bonus[]
+ Bonuses
+ that are in the packet.
+ GET qbreader.org/api/query+ Query the QB Reader database for questions. +
+ + +questionType: "tossup" | "bonus" | "all"
+ required
+ "tossup" - only tossups"bonus" - only bonuses"all" - both tossups and bonusessearchType: "question" | "answer" | "all"
+ required
+ "question" - only search question bodies"answer" - only search answerlines"all" - search both question bodies and answerlinesqueryString: string
+ default: ""
+ ignoreDiacritics: boolean
+ default: false
+ queryString.
+ regex: boolean
+ default: false
+ queryString as a regular expression.
+ randomize: boolean
+ default: false
+ setName: string
+ default: undefined
+ undefined then all sets are searched.difficulties: number | string
+ default: undefined
+ undefined then all difficulties are allowed.string or number if there is only 1 difficulty.categories: string
+ default: undefined
+ undefined then all categories are allowed.string if there is only 1 category.subcategories: string
+ default: undefined
+ undefined then all subcategories are allowed.string if there is only 1 subcategory."History" and the "Biology"
+ and "Chemistry" subcategories will return no questions.maxReturnLength: number
+ default: 25
+ 0 or negative, then the default is 50200, the query will return no more than 200 questions.tossupPagination: number
+ default: 1
+ 4000 / maxReturnLength, rounded down.bonusPagination: number
+ default: 1
+ 4000 / maxReturnLength, rounded down.object with the following properties:
+ tossups: object
+ count: number
+ questionArray: Tossup[]
+ Tossups
+ that match the query.
+ bonuses: object
+ count: number
+ questionArray: Bonus[]
+ Bonuses
+ that match the query.
+ queryString: string
+ regex is false, then regex characters are escaped.ignoreDiacritics is true, then diacritic substitutions are made.GET qbreader.org/api/random-name+ Get a random adjective-noun pair that can be used as a name. +
+ + ++ This endpoint takes no parameters. +
+string that is the pseudonym.
+ POST qbreader.org/api/random-question+ Get random questions from the database. +
+ + +questionType: "tossup" | "bonus"
+ required
+ "tossup" - only tossups"bonus" - only bonusesdifficulties: number[] | number | string
+ default: undefined
+ undefined then all difficulties are allowed.string or number if there is only 1 difficulty.categories: string[] | string
+ default: undefined
+ undefined then all categories are allowed.string if there is only 1 category.subcategories: string[] | string
+ default: undefined
+ undefined then all subcategories are allowed.string if there is only 1 subcategory."History" and the "Biology"
+ and "Chemistry" subcategories will return no questions.number: number
+ default: 1
+ minYear: number
+ default: 2010
+ maxYear: number
+ default: 2023
+ POST qbreader.org/api/report-question+ Report a question error. +
+ + +_id: string
+ required
+ reason: string
+ default: ""
+ description: string
+ default: ""
+ 200 OK if the operation was successful and 500 Internal Server Error if there was an error.
+ + The QB Reader API represents tossups and bonuses as JSON objects. These schemas describe the + structure of these objects. +
+ + +Tossup
+
+ _id: string
+ question: string
+ formatted_answer: string
+ answer: string
+ category: string
+ subcategory: string
+ packet: string
+ set: string
+ setName: string
+ type: string
+ "tossup" for tossups.packetNumber: number
+ questionNumber: number
+ createdAt: string
+ updatedAt: string
+ difficulty: number
+ [0-10].Bonus
+
+ _id: string
+ leadin: string
+ parts: [string, string, string]
+ formatted_answers: [string, string, string]
+ answers: [string, string, string]
+ category: string
+ subcategory: string
+ packet: string
+ set: string
+ setName: string
+ type: string
+ "bonus" for bonuses.packetNumber: number
+ questionNumber: number
+ createdAt: string
+ updatedAt: string
+ difficulty: number
+ [0-10].GET qbreader.org/api/set-list+ Get a list of all the sets in the database. +
+ + ++ This endpoint takes no parameters. +
+array of all the sets in the database. : string[]
+ The API documentation for QB Reader.
-
- Base URL: https://www.qbreader.org/api
-
- The base URL for the multiplayer API is qbreader.org/api/multiplayer
- (Note: There is only one multiplayer API endpoint.)
-
- You can find the python wrapper module for the API here: - https://github.com/qbreader/python-module. -
-- New rooms are created on the server when a WebSocket connection is established. -
-- GET requests should always have parameters passed through the URI, - and POST requests should have parameters passed through the body. -
-- The API is rate-limited to 20 requests per second. -
-qbreader.org/api/check-answeranswerline - the answerline of the question.
- Preferably including the html tags <b> and <u>, if they are present.
- givenAnswer - the answer the user gave.
- [directive, directedPrompt]
- [ "prompt", "of what status?" ]
- [ "accept", null ]
- directive either equals accept, reject, or prompt
- directedPrompt equals a string if there is a directed prompt, and null
- otherwise
- qbreader.org/api/num-packetssetName - the name of the set (URI-encoded).
- 23404 Not Found status and a response
- of 0qbreader.org/api/packetsetName - the name of the set (URI-encoded).
- packetNumber - the number of the packet in the set, starting from 1.
- { tossups: [{}, ...], bonuses: [{}, ...] }
- qbreader.org/api/packet-bonuses/api/packet
- setName - the name of the set (URI-encoded).packetNumber - the number of the packet in the set, starting from 1. { tossups: [], bonuses: [{}, ...] }
- 404 Not Found status and an (empty)
- packet that equals { tossups: [], bonuses: [] }qbreader.org/api/packet-tossups/api/packet
- setName - the name of the set (URI-encoded).packetNumber - the number of the packet in the set, starting from 1. { tossups: [{}, ...], bonuses: [] }
- 404 Not Found status and an (empty)
- packet that equals { tossups: [], bonuses: [] }qbreader.org/api/queryquestionType - a string that either equals "tossup", "bonus", or "all".
- Otherwise, returns a 400 Bad Request response.
- searchType - a string that either equals "question", "answer", or "all".
- Otherwise, returns a 400 Bad Request response.
- queryString - a string that the query is searching for.
- regex - a boolean that indicates whether queryString
- should be treated as a regular expression.
- false.randomize - a boolean that indicates whether the results should
- be in random order.
- false.setName - a string that is the name of the set to search in.
- difficulties - an array of numbers representing the valid
- possible difficulties.
- categories - an array of strings that contain the allowed
- categories.
- subcategories - an array of strings that contain the allowed
- subcategories.
- maxReturnLength - a number that specifies the maximum number
- of questions to return
- qbreader.org/api/random-nameamiable-emuqbreader.org/api/random-questionquestionType - a string that either equals "tossup" or "bonus".
- Otherwise, returns a 400 Bad Request response.
- difficulties - an array of numbers representing the valid
- possible difficulties.
- categories - an array of strings that contain the allowed
- categories.
- subcategories - an array of strings that contain the allowed
- subcategories.
- number - a number that specifies how many questions to return
- (the length of the return array).
- minYear - a number (default: 2010)
- maxYear - a number (default: 2023)
- 404 Not Found status.qbreader.org/api/report-question_id - the id of the question being reported.reason - the reason why the question is being reported.description - a description of the problem.qbreader.org/api/set-listqbreader.org/api/multiplayer/room-list[number of players, number of active players].
- - Search the database that powers qbreader. + Search the database that powers QB Reader.