aboutsummaryrefslogtreecommitdiffstats
path: root/SCHEMA.md
diff options
context:
space:
mode:
authorGravatar Hassan Abouelela <[email protected]>2021-06-02 04:06:00 +0300
committerGravatar Hassan Abouelela <[email protected]>2021-06-02 04:06:00 +0300
commitb98da9ae3693b40427077f69092b4b8ee69d2543 (patch)
tree64bcbdf573e8fd665f0fa05403b5266139ac142c /SCHEMA.md
parentAdds Code Question Model (diff)
Records Failed Unittests
Adds logic for saving submissions of failed unittests. Updates schema docs. Signed-off-by: Hassan Abouelela <[email protected]>
Diffstat (limited to 'SCHEMA.md')
-rw-r--r--SCHEMA.md17
1 files changed, 16 insertions, 1 deletions
diff --git a/SCHEMA.md b/SCHEMA.md
index 57c238a..93be830 100644
--- a/SCHEMA.md
+++ b/SCHEMA.md
@@ -169,10 +169,25 @@ Textareas require no additional configuration.
| `_id`/`id` | MongoDB ObjectID | Random identifier used for the response |
| `user` | Optional [user details object](#user-details-object) | An object describing the user that submitted if the form is not anonymous |
| `antispam` | Optional [anti spam object](#anti-spam-object) | An object containing information about the anti-spam on the form submission |
-| `response` | Object | Object containing question IDs mapping to the users answer |
+| `response` | Object | Object containing question IDs mapping to the users answer* |
| `form_id` | String | ID of the form that the user is submitting to |
| `timestamp` | String | ISO formatted string of submission time. |
+
+&nbsp;* If the question is of type `code`, the response has the following structure:
+```json
+"response": {
+ "<QUESTION ID>": {
+ "value": "<USER CODE>",
+ "passed": bool,
+ "failures": ["<TEST NAME 1>", "<TEST NAME 4>", "<HIDDEN TEST 1>", ...]
+ },
+ ...
+}
+```
+* Values in `<>` are placeholders, while the rest are actual keys
+* `passed` is True only if all tests in the suite passed.
+
### User details object
The user details contains the information returned by Discord alongside an `admin` boolean key representing that the user has admin privileges. The information returned from Discord can be found in the [Discord Developer portal](https://discord.com/developers/docs/resources/user#user-object).