diff --git a/astro.config.mjs b/astro.config.mjs index df9c00b..9b2e75a 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -53,13 +53,87 @@ export default defineConfig({ }, items: [ { - label: 'Doubtfire API Documentation', + label: 'Doubtfire API Documentation List', link: '/backend/api/api_list', }, { - label: 'Activity Types', + label: 'activity types', link: '/backend/api/activity_types', }, + + { + label: 'admin', + link: '/backend/api/admin', + }, + { + label: 'auth', + link: '/backend/api/auth', + }, + { + label: 'campuses', + link: '/backend/api/campuses', + }, + { + label: 'csv', + link: '/backend/api/csv', + }, + { + label: 'projects', + link: '/backend/api/projects', + }, + { + label: 'setting', + link: '/backend/api/setting', + }, + { + label: 'students', + link: '/backend/api/students', + }, + { + label: 'submission', + link: '/backend/api/submission', + }, + { + label: 'tasks', + link: '/backend/api/tasks', + }, + { + label: 'teaching periods', + link: '/backend/api/teaching_periods', + }, + { + label: 'tii_actions', + link: '/backend/api/tii_actions', + }, + { + label: 'tii_eula', + link: '/backend/api/tii_eula', + }, + { + label: 'tii_hook', + link: '/backend/api/tii_hook', + }, + { + label: 'tutorials', + link: '/backend/api/tutorials', + }, + { + label: 'unit_roles', + link: '/backend/api/unit_roles', + }, + + { + label: 'units', + link: '/backend/api/units', + }, + { + label: 'users', + link: '/backend/api/users', + }, + { + label: 'webcal', + link: '/backend/api/webcal', + }, { label: 'Error codes', link: '/backend/api/error_codes', diff --git a/src/content/docs/backend/API/activity_types.md b/src/content/docs/backend/API/activity_types.md index 74b0f10..0a167f5 100644 --- a/src/content/docs/backend/API/activity_types.md +++ b/src/content/docs/backend/API/activity_types.md @@ -2,26 +2,34 @@ title: Doubtfire API Documentation --- -# API: Activity Types +# API: Activity Types +activity_types : Operations about activity_types +This markdown document provides detailed documentation for the "activity_types" API endpoints including their URLs, methods, parameters, responses, and example requests using curl. This "activity_types" API has the following operations. -- **GET**: /api/activity types -- **POST**: /api/activity types -- **DELETE**: /api/activity types/{id} -- **GET**: /api/activity types/{id} -- **PUT**: /api/activity types/{id} +- **GET**: /api/activity_types +- **POST**: /api/activity_types +- **DELETE**: /api/activity_types/{id} +- **GET**: /api/activity_types/{id} +- **PUT**: /api/activity_types/{id} ## Detail of Operations related to activity types. ### GET activity_types: gets a list of all activity types. +GET /api/activity_types -- **URL**: `http://localhost:3000/api/activity_types` -- **Method**: `GET` -- **Parameters**: None -- **Response**: +- URL: `api/activity_types` +- Method: `GET` +- Parameters: None +- Response: `200 OK` - - `200 OK`: +- Example Request: + ```bash + curl -X GET --header 'Accept: application/json' 'http://localhost:3000/api/activity_types' + ``` + +- Response body: ```json [ { @@ -37,13 +45,122 @@ This "activity_types" API has the following operations. { "id": 3, "name": "Class", - "abb + "abbreviation": "cls" }, - ... ] + ``` -- **Example Request**: + +### POST activity_types: creates or adds a new activity type +POST/api/activity_types + +- URL: `api/activity_types` +- Method: `POST` +- Parameters: + + | Parameter | Description |Parameter Type| Data Type|Mandatory| + |---------------------|-----------------|------------|------------|---| + | name | The name of the activity type | formData| string|Yes| + |abbreviation | The abbreviation for the activity type | formData| string|Yes| + |Username | enter the username | header | string |Yes| + |Auth_Token | Authentication token | header | string |Yes| + +- Response: +`201 Created` + +- Example Request: + ```bash + curl -X POST --header 'Content-Type: application/x-www-form-urlencoded' --header 'Accept: application/json' --header 'Username: aadmin' --header 'Auth_Token: 9zV37yx2jQ3j8Nsy4MP_' -d 'activity_type%5Bname%5D=Practical1&activity_type%5Babbreviation%5D=prac1' 'http://localhost:3000/api/activity_types' + ``` + +- Response Body + ```json + { + "id": 4, + "name": "Practical1", + "abbreviation": "prac1" + } + ``` + +### DELETE activity_types: delete an activity type +DELETE /api/activity_types/{id} + +- URL: `api/activity_types/{id}` +- Method: `DELETE` +- Parameters: + + | Parameter | Description |Parameter Type| Data Type|Mandatory| + |---------------------|-----------------|------------|------------|-----| + |Username | enter the username | header | string |Yes| + |Auth_Token | Authentication token | header | string |Yes| + |id | | path | integer|Yes| + +- Response: +`204` No Content + +- Example request ```bash - curl -X GET --header 'Accept: application/json' 'http://localhost:3000/api/activity_types' + curl -X DELETE --header 'Accept: application/json' --header 'Username: aadmin' --header 'Auth_Token: 5zR37VDdBV6FZvJzABPS' 'http://localhost:3000/api/activity_types/4' ``` + +### GET: Get an activity type details +GET /api/activity_types/{id} + +- URL: `api/activity_types/{id}` +- Method: `GET` +- Parameters: + + | Parameter | Description |Parameter Type| Data Type|Mandatory| + |---------------------|-----------------|------------|------------|---| + |id | | path | integer|Yes| + +- Response: +`200 OK` + +- Example request + ```bash + curl -X GET --header 'Accept: application/json' 'http://localhost:3000/api/activity_types/3' + ``` + +- Response Body: + ```json + { + "id": 3, + "name": "Class", + "abbreviation": "cls" + } + ``` + + +### PUT: Update an activity type +PUT /api/activity_types/{id} + +- URL: `api/activity_types/{id}` +- Method: `PUT` +- Parameters: + + | Parameter | Description |Parameter Type| Data Type|Mandatory| + |---------------------|-----------------|------------|------------|-----| + | activity_type [name] | The name of the activity type | formData| string| | + |activity_type [abbreviation] | The abbreviation for the activity type | formData| string|| + |Username | enter the username | header | string |Yes| + |Auth_Token | Authentication token | header | string | Yes| + |id | | path | integer| Yes| + +- Response: `200 OK` + +- Example Request + ```bash + curl -X PUT --header 'Content-Type: application/x-www-form-urlencoded' --header 'Accept: application/json' --header 'Username: aadmin' --header 'Auth_Token: nHyAVEAsSp25snxiLomP' -d 'activity_type%5Bname%5D=Practical1&activity_type%5Babbreviation%5D=prac1' 'http://localhost:3000/api/activity_types/5' + ``` + +- Response Body + ```json + { + "id": 5, + "name": "Practical1", + "abbreviation": "prac1" + } + ``` + diff --git a/src/content/docs/backend/API/admin.md b/src/content/docs/backend/API/admin.md new file mode 100644 index 0000000..d4c830c --- /dev/null +++ b/src/content/docs/backend/API/admin.md @@ -0,0 +1,16 @@ +--- +title: Doubtfire API Documentation +--- + +# API: Admin +admin : Operations about admin +This markdown document provides detailed documentation for the "admin" API endpoints, including their URLs, methods, parameters (if any), responses, and example requests using curl + +This "admin" API has the following operations. +- **PUT**: /api/admin/overseer_images/{id}/pull_image +- **GET**: /api/admin/overseer_images +- **POST**: /api/admin/overseer_images +- **DELETE**: /api/admin/overseer_images/{id} +- **PUT**: /api/admin/overseer_images/{id} + +## Detail of Operations related to admin. \ No newline at end of file diff --git a/src/content/docs/backend/API/auth.md b/src/content/docs/backend/API/auth.md new file mode 100644 index 0000000..b7a5e83 --- /dev/null +++ b/src/content/docs/backend/API/auth.md @@ -0,0 +1,179 @@ +--- +title: Doubtfire API Documentation +--- + +# API: Auth +auth : Operations about auth + +This markdown document provides detailed documentation for the "auth" API endpoints, including their URLs, methods, parameters (if any), responses, and example requests using curl + +This "auth" API has the following operations. +- **DELETE** /api/auth +- **POST** /api/auth +- **PUT** /api/auth +- **GET** /api/auth/signout_url +- **GET** /api/auth/method +- **POST** /api/auth/jwt + +## Detail of Operations related to auth. + +### DELETE: Deletes authentication. + + +- URL: `/api/auth` +- Method: `DELETE` +- Parameters: + | Parameter | Description |Parameter Type| Data Type|Mandatory| + |---------------------|-----------------|------------|------------|---| + |Username | User username | header | string |Yes| + |Auth_Token | Authentication token | header | string |Yes| + +- Response: + - `204 No Content`: Authentication deleted successfully. + +- Example Request: + ```bash + curl -X DELETE --header 'Accept: application/json' --header 'username: student_1' --header 'auth_token: RbYVL1screzs9QGbAkd' 'http://localhost:3000/api/auth' curl -X DELETE http://doubtfire.com/api/auth + ``` + +### POST: Sign in + +- URL: `/api/auth` +- Method: `POST` +- Parameters: Authentication data + | Parameter | Description |Parameter Type| Data Type|Mandatory| + |---------------------|-----------------|------------|------------|---| + |Username |User username | formData | string |Yes| + |password| User password | formData | string |Yes| + |remember| User has requested to remember login | formData | boolean | | + + +- Response: +`201 Created` +- Example Request: + ```bash + curl -X POST --header 'Content-Type: application/x-www-form-urlencoded' --header 'Accept: application/json' -d 'username=student_1&password=password&remember=false' 'http://localhost:3000/api/auth' + ``` + +- Response body: + ```json + { + "user": { + "id": 24, + "student_id": null, + "email": "student_1@doubtfire.com", + "first_name": "Layla", + "last_name": "Kihn", + "username": "student_1", + "nickname": "student_1", + "receive_task_notifications": true, + "receive_portfolio_notifications": true, + "receive_feedback_notifications": true, + "opt_in_to_research": null, + "has_run_first_time_setup": false, + "system_role": "Student" + }, + "auth_token": "zCQZnhmXzqhNzaxw17Qx" + } + ``` + +### PUT: Allow tokens to be updated + +- URL: `/api/auth` +- Method: `PUT` +- Parameters: Authentication data + | Parameter | Description |Parameter Type| Data Type|Mandatory| + |---------------------|-----------------|------------|------------|---| + |Username |User username | formData | string |Yes| + |Auth_Token | Authentication token | header | string |Yes| + |remember| User has requested to remember login | formData | boolean | | + + +- Response: +`201 Created` +- Example Request: + ```bash + curl -X PUT --header 'Content-Type: application/x-www-form-urlencoded' --header 'Accept: application/json' --header 'username: student_1' --header 'auth_token: zCQZnhmXzqhNzaxw17Qx' -d 'remember=false' 'http://localhost:3000/api/auth' + ``` +- Response body: + ```json + { + "auth_token": "zCQZnhmXzqhNzaxw17Qx" + } + ``` + +### GET: Authentication signout URL +GET /api/auth/signout_url + +- URL: `/api/auth/signout_url` +- Method: `GET` +- Parameters: None +- Response: +`200 OK` + +- Example Request: + ```bash + curl -X GET --header 'Accept: application/json' 'http://localhost:3000/api/auth/signout_url' + ``` +- Response body: + ```json + { + "auth_signout_url": null + } + ``` + + +### GET: Authentication method configuration +GET /api/auth/method + +- URL: `/api/auth/method` +- Method: `GET` +- Parameters: None +- Response: +`200 OK` + +- Example Request: + ```bash + curl -X GET --header 'Accept: application/json' 'http://localhost:3000/api/auth/method' + ``` +- Response body: + ```json + { + "method": "database", + "redirect_to": null + } + ``` + +### POST: SAML2.0 auth +POST /api/auth/jwt + +- URL: `/api/auth/jwt` +- Method: `POST` +- Parameters: + | Parameter | Description |Parameter Type| Data Type|Mandatory| + |---------------------|-----------------|------------|------------|---| + |SAMLResponse | Data provided for further processing | header | string |Yes| + +- Response: + - `201 Created`: The JWT token is successfully generated. + +- Example Request: + ```bash + curl -X POST https://your-institution-host/auth/jwt \ + -H "Content-Type: application/json" \ + -d '{ + "SAMLResponse": "Base64EncodedSAMLResponse" + }' + + ``` +- Response body: + ```json + { + "token": "your-jwt-token", + "user": { + "email": "user@example.com", + "name": "User Name" + } + } + ``` + diff --git a/src/content/docs/backend/API/campuses.md b/src/content/docs/backend/API/campuses.md new file mode 100644 index 0000000..9188a52 --- /dev/null +++ b/src/content/docs/backend/API/campuses.md @@ -0,0 +1,189 @@ +--- +title: Doubtfire API Documentation +--- + +# API: Campuses +campuses : Operations about campuses +This markdown document provides detailed documentation for the "campuses" API endpoints, including their URLs, methods, parameters (if any), responses, and example requests using curl. + +This "campuses" API has the following operations. + +- **DELETE** /api/campuses/{id} +- **GET** /api/campuses/{id} +- **PUT** /api/campuses/{id} +- **GET** /api/campuses +- **POST** /api/campuses + +## Detail of Operations related to campuses. + +### DELETE: Delete a campus. +Delete /api/campuses/{id} +- URL: `/api/campuses/{id}` +- Method: `DELETE` +- Parameters: + | Parameter | Description |Parameter Type| Data Type|Mandatory| + |---------------------|-----------------|------------|------------|---| + |Username | User username | header | string |Yes| + |Auth_Token | Authentication token | header | string |Yes| + |id | | path | integer|Yes| + +- Response: + `204 OK`: Campus deleted successfully. + +- Example Request: + ```bash + curl -X DELETE --header 'Accept: application/json' --header 'Username: aadmin' --header 'Auth_Token: yzRDggcmzbVnYEbszVV1' 'http://localhost:3000/api/campuses/6' + ``` +- Response body: + ``` + true + ``` +### GET: fetches a campuses details by ID +GET /api/campuses/{id} + +- URL: `/api/campuses/{id}` +- Method: `GET` +- Parameters: + | Parameter | Description |Parameter Type| Data Type|Mandatory| + |---------------------|-----------------|------------|------------|---| + |id | | path | integer|Yes| + +- Response: +`200 OK` + +- Example Request: + ```bash + curl -X GET --header 'Accept: application/json' 'http://localhost:3000/api/campuses/4' + ``` +- Response body: + ```json + { + "id": 4, + "name": "Geelong_1", + "mode": "timetable", + "abbreviation": "gee test1", + "active": true + } + ``` + +### PUT: Update campus detail for specific ID +PUT /api/campuses/{id} + +- URL: `/campuses/{id}` +- Method: `PUT` +- Parameters: + + | Parameter | Description |Parameter Type| Data Type|Mandatory| + |---------------------|-----------------|------------|------------|---| + |campus[name] | The name of the campus | formData | string |Yes| + |campus[mode] | This will determine the campus mode | formData | string |Yes| + |campus[abbreviation] | The abbreviation for the campus | header | string |Yes| + |campus[active] | Determines whether campus is active | header | string |Yes| + |Username | User username | header | string |Yes| + |Auth_Token | Authentication token | header | string |Yes| + + +- Response: `200 OK` + +- Example Request + ```bash + curl -X PUT --header 'Content-Type: application/x-www-form-urlencoded' --header 'Accept: application/json' --header 'Username: aadmin' --header 'Auth_Token: yzRDggcmzbVnYEbszVV1' -d 'campus%5Bname%5D=Geelong_1&campus%5Bmode%5D=automatic&campus%5Bactive%5D=true' 'http://localhost:3000/api/campuses/4' + ``` + +- Response Body + ```json + { + "id": 4, + "name": "Geelong_1", + "mode": "automatic", + "abbreviation": "gee test1", + "active": true + } + ``` + + + + +### GET: fetches a details of all campuses +GET /api/campuses + +- URL: `/api/campuses` +- Method: `GET` +- Parameters: + | Parameter | Description |Parameter Type| Data Type|Mandatory| + |---------------------|-----------------|------------|------------|---| + |id | | path | integer|Yes| +- Response: +`200 OK` + +- Example Request: + ```bash + curl -X GET --header 'Accept: application/json' 'http://localhost:3000/api/campuses' + ``` +- Response body: + ```json + [ + { + "id": 1, + "name": "Online", + "mode": "timetable", + "abbreviation": "C", + "active": true + }, + { + "id": 2, + "name": "Burwood", + "mode": "automatic", + "abbreviation": "B", + "active": true + }, + { + "id": 3, + "name": "Geelong", + "mode": "manual", + "abbreviation": "G", + "active": true + }, + { + "id": 4, + "name": "Geelong_1", + "mode": "timetable", + "abbreviation": "gee test1", + "active": true + } + ] + ``` + +### POST: Add a Campus +POST /api/campuses +- URL: `/api/campuses` +- Method: `POST` +- Parameters: + | Parameter | Description |Parameter Type| Data Type|Mandatory| + |---------------------|-----------------|------------|------------|---| + |campus[name] | The name of the campus | formData | string |Yes| + |campus[mode] | This will determine the campus mode | formData | string |Yes| + |campus[abbreviation] | The abbreviation for the campus | header | string |Yes| + |campus[active] | Determines whether campus is active | header | string |Yes| + |Username | User username | header | string |Yes| + |Auth_Token | Authentication token | header | string |Yes| + + + +- Response: +`201 Created`: Add a campus +- Example Request: + ```bash + curl -X POST --header 'Content-Type: application/x-www-form-urlencoded' --header 'Accept: application/json' --header 'Username: aadmin' --header 'Auth_Token: yzRDggcmzbVnYEbszVV1' -d 'campus%5Bname%5D=Geelong_2&campus%5Bmode%5D=timetable&campus%5Babbreviation%5D=gee%20test2&campus%5Bactive%5D=true' 'http://localhost:3000/api/campuses' + ``` + +- Response body: + ```json + { + "id": 5, + "name": "Geelong_2", + "mode": "timetable", + "abbreviation": "gee test2", + "active": true + } + ``` diff --git a/src/content/docs/backend/API/csv.md b/src/content/docs/backend/API/csv.md new file mode 100644 index 0000000..0cefb8b --- /dev/null +++ b/src/content/docs/backend/API/csv.md @@ -0,0 +1,280 @@ +--- +title: Doubtfire API +--- +# API: CSV +csv : Operations about csv +This markdown document provides detailed documentation for the "csv" API endpoints, including their URLs, methods, parameters (if any), responses, and example requests using curl. + +This "csv" API has the following operations. + +- **GET** /api/csv/users +- **POST** /api/csv/users +- **GET** /api/csv/units/{id}/tutor_assessments +- **GET** /api/csv/units/{id}/task_completion +- **GET** /api/csv/units/{id} +- **POST** /api/csv/units/{id} +- **POST** /api/csv/units/{id}/withdraw +- **GET** /api/csv/task_definitions +- **POST** /api/csv/task_definitions + + +## Detail of Operations related to csv. + +### GET: Download CSV of all users +GET /api/csv/users + +- URL: `/api/csv/users` +- Method: `GET` +- Parameters: + + | Parameter | Description |Parameter Type| Data Type|Mandatory| + |---------------------|-----------------|------------|------------|---| + |Username | User username | header | string |Yes| + |Auth_Token | Authentication token | header | string |Yes| + + +- Response: + - `200 OK`: Download CSV of all users + +- Example Request + ```bash + curl -X GET --header 'Accept: application/octet-stream' --header 'Username: aadmin' --header 'Auth_Token: orofzZ7rMY5ivQzat2Kv' 'http://localhost:3000/api/csv/users' + ``` +- Response body: + + `Download users` + +------------------------------------------------------------------- + +### POST: Upload CSV of users +POST /api/csv/users + +- URL: `/api/csv/users` +- Method: `POST` +- Parameters: + + | Parameter | Description |Parameter Type| Data Type|Mandatory| + |---------------------|-----------------|------------|------------|---| + |file | CSV upload file. | formData | file |Yes| + |Username | User username | header | string |Yes| + |Auth_Token | Authentication token | header | string |Yes| + + +- Response: + - `201 OK`: Upload CSV of users + +- Example Request + ```bash + curl -X POST --header 'Content-Type: multipart/form-data' --header 'Accept: application/json' --header 'Username: aadmin' --header 'Auth_Token: orofzZ7rMY5ivQzat2Kv' -F file=@"Book2.xlsx" 'http://localhost:3000/api/csv/users' + ``` +- Response body: + + ```json + { + "success": [2], + "ignored": [], + "errors": [] + } + ``` +------------------------------------------------------------- + +### GET: Download stats related to the number of tasks assessed by each tutor +GET /api/csv/units/{id}/tutor_assessments + +- URL: `/api/csv/units/{id}/tutor_assessments` +- Method: `GET` +- Parameters: + + | Parameter | Description |Parameter Type| Data Type|Mandatory| + |---------------------|-----------------|------------|------------|---| + |Username | User username | header | string |Yes| + |Auth_Token | Authentication token | header | string |Yes| + |id| |path|integer|Yes| +- Response: + - `200 OK`: Download stats related to the number of tasks assessed by each tutor + +- Example Request + ```bash + curl -X GET --header 'Accept: application/octet-stream' --header 'Username: aadmin' --header 'Auth_Token: orofzZ7rMY5ivQzat2Kv' 'http://localhost:3000/api/csv/units/1/tutor_assessments' + ``` +- Response body: + + `Download tutor assessments` + +------------------------------------------------------------- + +### GET: Download CSV of all student tasks in this unit +GET /api/csv/units/{id}/task_completion + +- URL: `/api/csv/units/{id}/task_completion` +- Method: `GET` +- Parameters: + + | Parameter | Description |Parameter Type| Data Type|Mandatory| + |---------------------|-----------------|------------|------------|---| + |Username | User username | header | string |Yes| + |Auth_Token | Authentication token | header | string |Yes| + |id| |path|integer|Yes| + +- Response: + - `200 OK`: Download CSV of all students in this unit + +- Example Request + ```bash + curl -X GET --header 'Accept: application/octet-stream' --header 'Username: aadmin' --header 'Auth_Token: B34P_wnsuosY1a2SXA3Q' 'http://localhost:3000/api/csv/units/1/task_completion' + ``` +- Response body: + + `Download task completion` + +---------------------------------------------------------------- + +### GET: Download CSV of all students in this unit +GET /api/csv/units/{id} + +- URL: `/api/csv/units/{id}` +- Method: `GET` +- Parameters: + + | Parameter | Description |Parameter Type| Data Type|Mandatory| + |---------------------|-----------------|------------|------------|---| + |Username | User username | header | string |Yes| + |Auth_Token | Authentication token | header | string |Yes| + |id| |path|integer|Yes| + +- Response: + - `200 OK`: Download CSV of all students in this unit + +- Example Request + ```bash + curl -X GET --header 'Accept: application/octet-stream' --header 'Username: aadmin' --header 'Auth_Token: orofzZ7rMY5ivQzat2Kv' 'http://localhost:3000/api/csv/units/1' + ``` +- Response body: + + `Download1` +--------------------------------------------------------------- + +### POST: Upload CSV of all the students in a unit +POST /api/csv/units/{id} + +- URL: `/api/csv/units/{id}` +- Method: `POST` +- Parameters: + + | Parameter | Description |Parameter Type| Data Type|Mandatory| + |---------------------|-----------------|------------|------------|---| + |file | CSV upload file. | formData | file |Yes| + |Username | User username | header | string |Yes| + |Auth_Token | Authentication token | header | string |Yes| + |id| |path|integer|Yes| + +- Response: + - `201 OK`: Upload CSV of all the students in a unit + +- Example Request + ```bash + curl -X POST --header 'Content-Type: multipart/form-data' --header 'Accept: application/json' --header 'Username: aadmin' --header 'Auth_Token: orofzZ7rMY5ivQzat2Kv' -F file=@"Book2.xlsx" 'http://localhost:3000/api/csv/units/1' + ``` +- Response body: + + ```json + { + "success": [], + "ignored": [], + "errors": [] + } + ``` +------------------------------------------------------------- + +### POST: Upload CSV with the students to un-enrol from the unit +POST /api/csv/units/{id}/withdraw + + +- URL: `/api/csv/units/{id}/withdraw` +- Method: `POST` +- Parameters: + + | Parameter | Description |Parameter Type| Data Type|Mandatory| + |---------------------|-----------------|------------|------------|---| + |file | CSV upload file. | formData | file |Yes| + |Username | User username | header | string |Yes| + |Auth_Token | Authentication token | header | string |Yes| + |id| |path|integer|Yes| + +- Response: + - `201 OK`: Upload CSV with the students to un-enrol from the unit + +- Example Request + ```bash + curl -X POST --header 'Content-Type: multipart/form-data' --header 'Accept: application/json' --header 'Username: aadmin' --header 'Auth_Token: B34P_wnsuosY1a2SXA3Q' -F file=@"Book2.xlsx" 'http://localhost:3000/api/csv/units/1/withdraw' + ``` +- Response body: + + ```json + { + "success": [], + "ignored": [], + "errors": [] + } + ``` + +--------------------------------------------------------------- + +### GET: Download CSV of all task definitions for the given unit +GET /api/csv/task_definitions + +- URL: `/api/csv/task_definitions` +- Method: `GET` +- Parameters: + + | Parameter | Description |Parameter Type| Data Type|Mandatory| + |---------------------|-----------------|------------|------------|---| + |unit_id|The unit to download tasks from |query|integer|Yes| + |Username | User username | header | string |Yes| + |Auth_Token | Authentication token | header | string |Yes| + + +- Response: + - `200 OK`: Download CSV of all student tasks in this unit + +- Example Request + ```bash + curl -X GET --header 'Accept: application/octet-stream' --header 'Username: aadmin' --header 'Auth_Token: orofzZ7rMY5ivQzat2Kv' 'http://localhost:3000/api/csv/units/1/task_completion' + ``` +- Response body: + + `Download task completion` + +-------------------------------------------------------------------------- + +### POST: Upload CSV of task definitions to the provided unit +POST /api/csv/task_definitions + +- URL: `/api/csv/task_definitions` +- Method: `POST` +- Parameters: + + | Parameter | Description |Parameter Type| Data Type|Mandatory| + |---------------------|-----------------|------------|------------|---| + |file | CSV upload file. | formData | file |Yes| + |unit_id| The unit to upload tasks to |formData|integer|Yes| + |Username | User username | header | string |Yes| + |Auth_Token | Authentication token | header | string |Yes| + + +- Response: + - `201 OK`: Upload CSV with the students to un-enrol from the unit + +- Example Request + ```bash + curl -X POST --header 'Content-Type: multipart/form-data' --header 'Accept: application/json' --header 'Username: aadmin' --header 'Auth_Token: B34P_wnsuosY1a2SXA3Q' -F file=@"Book2.xlsx" -F unit_id=1 'http://localhost:3000/api/csv/task_definitions' + ``` +- Response body: + + ```json + { + "success": [], + "ignored": [], + "errors": [] + } + ``` diff --git a/src/content/docs/backend/API/projects.md b/src/content/docs/backend/API/projects.md new file mode 100644 index 0000000..2a62558 --- /dev/null +++ b/src/content/docs/backend/API/projects.md @@ -0,0 +1,43 @@ +--- +title: Doubtfire API +--- + +# List of Doubtfire + +# API: Projects +projects : Operations about projects + +This markdown document provides detailed documentation for the "projects" API endpoints, including their URLs, methods, parameters (if any), responses, and example requests using curl. + +This "projects" API has the following operations. + + +## Detail of Operations related to projects. + +- **GET** /api/projects/{id}/task_def_id/{task_definition_id}/submission_files +- **GET** /api/projects/{id}/task_def_id/{task_definition_id}/submission_details +- **PUT** /api/projects/{id}/task_def_id/{task_definition_id} +- **GET** /api/projects/{project_id}/refresh_tasks/{task_definition_id} +- **DELETE** /api/projects/{project_id}/task_def_id/{task_definition_id}/comments/{id} +- **GET** /api/projects/{project_id}/task_def_id/{task_definition_id}/comments/{id} +- **POST** /api/projects/{project_id}/task_def_id/{task_definition_id}/comments/{id} +- **GET** /api/projects/{project_id}/task_def_id/{task_definition_id}/comments +- **POST** /api/projects/{project_id}/task_def_id/{task_definition_id}/comments +- **GET** /api/projects/{id}/task_def_id/{task_definition_id}/submissions/latest +- **GET** /api/projects/{id}/task_def_id/{task_definition_id}/submissions/timestamps/{timestamp} +- **PUT** /api/projects/{id}/task_def_id/{task_definition_id}/overseer_assessment/{oa_id}/trigger +- **GET** /api/projects/{id}/task_def_id/{task_definition_id}/submissions/timestamps +- **GET** /api/projects/{id}/task_def_id/{task_definition_id}/submission +- **POST** /api/projects/{id}/task_def_id/{task_definition_id}/submission +- **PUT** /api/projects/{id}/task_def_id/{task_definition_id}/submission +- **GET** /api/projects +- **POST** /api/projects +- **GET** /api/projects/{id} +- **PUT** /api/projects/{id} +- **PUT** /api/projects/{project_id}/task_def_id/{task_definition_id}/assess_extension/{task_comment_id} +- **POST** /api/projects/{project_id}/task_def_id/{task_definition_id}/request_extension +- **POST** /api/projects/{project_id}/task_def_id/{task_definition_id}/comments/{task_comment_id}/discussion_comment/reply +- **GET** /api/projects/{project_id}/task_def_id/{task_definition_id}/comments/{task_comment_id}/discussion_comment/response +- **GET** /api/projects/{project_id}/task_def_id/{task_definition_id}/comments/{task_comment_id}/discussion_comment/prompt_number/{prompt_number} +- **POST** /api/projects/{project_id}/task_def_id/{task_definition_id}/discussion_comments + diff --git a/src/content/docs/backend/API/setting.md b/src/content/docs/backend/API/setting.md new file mode 100644 index 0000000..3e07dc4 --- /dev/null +++ b/src/content/docs/backend/API/setting.md @@ -0,0 +1,59 @@ +--- +title: Doubtfire API +--- + +# List of Doubtfire + +# API: Setting +setting : Operations about setting +This markdown document provides detailed documentation for the "setting" API endpoints, including their URLs, methods, parameters (if any), responses, and example requests using curl. + +This "setting" API has the following operations. +- **GET** /api/settings/privacy +- **GET** /api/settings + + +## Detail of Operations related to setting. + +### GET: Return privacy policy details +GET /api/settings/privacy + +- URL: `/api/settings/privacy` +- Method: `GET` +- Parameters: None +- Response: +`200 OK` + +- Example Request: + ```bash + curl -X GET --header 'Accept: application/json' 'http://localhost:3000/api/settings/privacy' + ``` +- Response body: + ```json + { + "privacy": "By clicking on the Upload button, I certify that the attached work is entirely my own (or where submitted to meet the requirements of an approved group assignment is the work of the group), except where work quoted or paraphrased is acknowledged in the text. I also certify that it has not been previously submitted for assessment in this or any other unit or course unless permission for this has been granted by the teaching staff coordinating this unit. I agree that the University may make and retain copies of this work for the purposes of marking and review, and may submit this work to an external plagiarism and collusion detection service who may retain a copy for future plagiarism and collusion detection but will not release it or use it for any other purpose.", + "plagiarism": "Plagiarism and collusion constitute extremely serious academic misconduct. They are forms of cheating, and severe penalties are associated with them, including cancellation of marks for a specific assignment, for a specific unit or even exclusion from the course. If you are ever in doubt about how to cite a reference properly, consult your lecturer or the Study Support website Plagiarism occurs when a student passes off as the student’s own work, or copies without acknowledgement as to its authorship, the work of any other person. Collusion occurs when a student obtains the agreement of another person for a fraudulent purpose, with the intent of obtaining an advantage in submitting an assignment or other work. Work submitted may be reproduced and/or communicated by the university for the purpose of detecting plagiarism and collusion. Students are reminded that assessment work, or parts of assessment work, cannot be re-submitted for a different assessment task in the same unit or any other unit, without the approval from the teaching staff involved. This includes work submitted for assessment at another academic institution. If students wish to reuse or extend parts of previously submitted work then they should discuss this with the teaching staff prior to the submission date. Depending on the nature of the task, the teaching staff may permit or decline the request." + } + ``` + +### GET: Return configurable details for the Doubtfire front end +GET /api/settings + +- URL: `/api/settings` +- Method: `GET` +- Parameters: None +- Response: +`200 OK` + +- Example Request: + ```bash + curl -X GET --header 'Accept: application/json' 'http://localhost:3000/api/settings' + ``` +- Response body: + ```json + { + "externalName": "OnTrack", + "overseerEnabled": false, + "tiiEnabled": false + } + ``` diff --git a/src/content/docs/backend/API/students.md b/src/content/docs/backend/API/students.md new file mode 100644 index 0000000..e20448e --- /dev/null +++ b/src/content/docs/backend/API/students.md @@ -0,0 +1,884 @@ +--- +title: Doubtfire API Documentation +--- + +# API: Students +students : Operations about students +This markdown document provides detailed documentation for the "students" API endpoints, including their URLs, methods, parameters (if any), responses, and example requests using curl + +This "students" API has the following operations. +- **GET**: /api/students + +## Detail of Operations related to students. + +### GET: get users +GET /api/students + +- URL: `/api/students` +- Method: `GET` +- Parameters: + | Parameter | Description |Parameter Type| Data Type|Mandatory| + |---------------------|-----------------|------------|------------|---| + |unit_id |The unit to get the students for| query | integer|Yes| + |withdraw | Show all students or just current students | query |boolean| | + |Username | User username | header | string |Yes| + |Auth_Token | Authentication token | header | string |Yes| + +- Response: +`200 OK` + +- Example Request: + ```bash + curl -X GET --header 'Accept: application/json' --header 'Username: aadmin' --header 'Auth_Token: rrK8BdRfxof9RrJGuk5n' 'http://localhost:3000/api/students?unit_id=1' + ``` +- Response body: + ```json + [ + { + "id": 6, + "enrolled": true, + "campus_id": 2, + "student": { + "id": 28, + "student_id": null, + "username": "student_5", + "email": "student_5@doubtfire.com", + "first_name": "Dale", + "last_name": "Homenick", + "nickname": "student_5" + }, + "target_grade": 2, + "submitted_grade": null, + "compile_portfolio": false, + "grade": 0, + "grade_rationale": null, + "similarity_flag": false, + "has_portfolio": true, + "stats": { + "red_pct": 0, + "grey_pct": 0.73, + "orange_pct": 0.03, + "blue_pct": 0.12, + "green_pct": 0.12, + "order_scale": 24.3 + }, + "tutorial_enrolments": [ + { + "stream_abbr": "wrkshop-1", + "tutorial_id": null + }, + { + "stream_abbr": "cls-1", + "tutorial_id": null + }, + { + "stream_abbr": "cls-2", + "tutorial_id": null + }, + { + "stream_abbr": "wrkshop-2", + "tutorial_id": 1 + } + ] + }, + { + "id": 5, + "enrolled": true, + "campus_id": 2, + "student": { + "id": 27, + "student_id": null, + "username": "student_4", + "email": "student_4@doubtfire.com", + "first_name": "Emanuel", + "last_name": "Kutch", + "nickname": "student_4" + }, + "target_grade": 0, + "submitted_grade": null, + "compile_portfolio": false, + "grade": 0, + "grade_rationale": null, + "similarity_flag": false, + "has_portfolio": true, + "stats": { + "red_pct": 0, + "grey_pct": 0.33, + "orange_pct": 0, + "blue_pct": 0.05, + "green_pct": 0.62, + "order_scale": 67 + }, + "tutorial_enrolments": [ + { + "stream_abbr": "wrkshop-1", + "tutorial_id": null + }, + { + "stream_abbr": "cls-1", + "tutorial_id": null + }, + { + "stream_abbr": "cls-2", + "tutorial_id": null + }, + { + "stream_abbr": "wrkshop-2", + "tutorial_id": 1 + } + ] + }, + { + "id": 14, + "enrolled": true, + "campus_id": 3, + "student": { + "id": 36, + "student_id": null, + "username": "student_13", + "email": "student_13@doubtfire.com", + "first_name": "Georgeanna", + "last_name": "Fay", + "nickname": "student_13" + }, + "target_grade": 0, + "submitted_grade": null, + "compile_portfolio": false, + "grade": 0, + "grade_rationale": null, + "similarity_flag": false, + "has_portfolio": true, + "stats": { + "red_pct": 0, + "grey_pct": 0.95, + "orange_pct": 0, + "blue_pct": 0.05, + "green_pct": 0, + "order_scale": 5 + }, + "tutorial_enrolments": [ + { + "stream_abbr": "wrkshop-1", + "tutorial_id": null + }, + { + "stream_abbr": "cls-1", + "tutorial_id": null + }, + { + "stream_abbr": "cls-2", + "tutorial_id": 3 + }, + { + "stream_abbr": "wrkshop-2", + "tutorial_id": null + } + ] + }, + { + "id": 12, + "enrolled": true, + "campus_id": 3, + "student": { + "id": 34, + "student_id": null, + "username": "student_11", + "email": "student_11@doubtfire.com", + "first_name": "Geraldo", + "last_name": "Rutherford", + "nickname": "student_11" + }, + "target_grade": 3, + "submitted_grade": null, + "compile_portfolio": false, + "grade": 0, + "grade_rationale": null, + "similarity_flag": false, + "has_portfolio": false, + "stats": { + "red_pct": 0, + "grey_pct": 0.36, + "orange_pct": 0, + "blue_pct": 0.06, + "green_pct": 0.58, + "order_scale": 63.99999999999999 + }, + "tutorial_enrolments": [ + { + "stream_abbr": "wrkshop-1", + "tutorial_id": null + }, + { + "stream_abbr": "cls-1", + "tutorial_id": 2 + }, + { + "stream_abbr": "cls-2", + "tutorial_id": null + }, + { + "stream_abbr": "wrkshop-2", + "tutorial_id": null + } + ] + }, + { + "id": 7, + "enrolled": true, + "campus_id": 3, + "student": { + "id": 29, + "student_id": null, + "username": "student_6", + "email": "student_6@doubtfire.com", + "first_name": "Gracia", + "last_name": "Heathcote", + "nickname": "student_6" + }, + "target_grade": 3, + "submitted_grade": null, + "compile_portfolio": false, + "grade": 0, + "grade_rationale": null, + "similarity_flag": false, + "has_portfolio": false, + "stats": { + "red_pct": 0, + "grey_pct": 0.48, + "orange_pct": 0, + "blue_pct": 0.08, + "green_pct": 0.44, + "order_scale": 52 + }, + "tutorial_enrolments": [ + { + "stream_abbr": "wrkshop-1", + "tutorial_id": null + }, + { + "stream_abbr": "cls-1", + "tutorial_id": 2 + }, + { + "stream_abbr": "cls-2", + "tutorial_id": null + }, + { + "stream_abbr": "wrkshop-2", + "tutorial_id": null + } + ] + }, + { + "id": 11, + "enrolled": true, + "campus_id": 3, + "student": { + "id": 33, + "student_id": null, + "username": "student_10", + "email": "student_10@doubtfire.com", + "first_name": "Herbert", + "last_name": "Flatley", + "nickname": "student_10" + }, + "target_grade": 0, + "submitted_grade": null, + "compile_portfolio": false, + "grade": 0, + "grade_rationale": null, + "similarity_flag": false, + "has_portfolio": false, + "stats": { + "red_pct": 0, + "grey_pct": 0.47, + "orange_pct": 0.05, + "blue_pct": 0.1, + "green_pct": 0.38, + "order_scale": 48.5 + }, + "tutorial_enrolments": [ + { + "stream_abbr": "wrkshop-1", + "tutorial_id": null + }, + { + "stream_abbr": "cls-1", + "tutorial_id": 2 + }, + { + "stream_abbr": "cls-2", + "tutorial_id": null + }, + { + "stream_abbr": "wrkshop-2", + "tutorial_id": null + } + ] + }, + { + "id": 15, + "enrolled": true, + "campus_id": 3, + "student": { + "id": 37, + "student_id": null, + "username": "student_14", + "email": "student_14@doubtfire.com", + "first_name": "Idalia", + "last_name": "Smith", + "nickname": "student_14" + }, + "target_grade": 3, + "submitted_grade": null, + "compile_portfolio": false, + "grade": 0, + "grade_rationale": null, + "similarity_flag": false, + "has_portfolio": false, + "stats": { + "red_pct": 0, + "grey_pct": 0.5, + "orange_pct": 0.03, + "blue_pct": 0.03, + "green_pct": 0.44, + "order_scale": 47.3 + }, + "tutorial_enrolments": [ + { + "stream_abbr": "wrkshop-1", + "tutorial_id": null + }, + { + "stream_abbr": "cls-1", + "tutorial_id": null + }, + { + "stream_abbr": "cls-2", + "tutorial_id": 3 + }, + { + "stream_abbr": "wrkshop-2", + "tutorial_id": null + } + ] + }, + { + "id": 9, + "enrolled": true, + "campus_id": 3, + "student": { + "id": 31, + "student_id": null, + "username": "student_8", + "email": "student_8@doubtfire.com", + "first_name": "John", + "last_name": "Padberg", + "nickname": "student_8" + }, + "target_grade": 3, + "submitted_grade": null, + "compile_portfolio": false, + "grade": 0, + "grade_rationale": null, + "similarity_flag": false, + "has_portfolio": false, + "stats": { + "red_pct": 0, + "grey_pct": 0.5, + "orange_pct": 0, + "blue_pct": 0.03, + "green_pct": 0.47, + "order_scale": 50 + }, + "tutorial_enrolments": [ + { + "stream_abbr": "wrkshop-1", + "tutorial_id": null + }, + { + "stream_abbr": "cls-1", + "tutorial_id": 2 + }, + { + "stream_abbr": "cls-2", + "tutorial_id": null + }, + { + "stream_abbr": "wrkshop-2", + "tutorial_id": null + } + ] + }, + { + "id": 13, + "enrolled": true, + "campus_id": 3, + "student": { + "id": 35, + "student_id": null, + "username": "student_12", + "email": "student_12@doubtfire.com", + "first_name": "Jordon", + "last_name": "Pagac", + "nickname": "student_12" + }, + "target_grade": 1, + "submitted_grade": null, + "compile_portfolio": false, + "grade": 0, + "grade_rationale": null, + "similarity_flag": false, + "has_portfolio": false, + "stats": { + "red_pct": 0, + "grey_pct": 0.34, + "orange_pct": 0, + "blue_pct": 0.03, + "green_pct": 0.63, + "order_scale": 66 + }, + "tutorial_enrolments": [ + { + "stream_abbr": "wrkshop-1", + "tutorial_id": null + }, + { + "stream_abbr": "cls-1", + "tutorial_id": null + }, + { + "stream_abbr": "cls-2", + "tutorial_id": 3 + }, + { + "stream_abbr": "wrkshop-2", + "tutorial_id": null + } + ] + }, + { + "id": 10, + "enrolled": true, + "campus_id": 3, + "student": { + "id": 32, + "student_id": null, + "username": "student_9", + "email": "student_9@doubtfire.com", + "first_name": "Juan", + "last_name": "Daugherty", + "nickname": "student_9" + }, + "target_grade": 2, + "submitted_grade": null, + "compile_portfolio": false, + "grade": 0, + "grade_rationale": null, + "similarity_flag": false, + "has_portfolio": true, + "stats": { + "red_pct": 0, + "grey_pct": 0.47, + "orange_pct": 0.03, + "blue_pct": 0.06, + "green_pct": 0.44, + "order_scale": 50.3 + }, + "tutorial_enrolments": [ + { + "stream_abbr": "wrkshop-1", + "tutorial_id": null + }, + { + "stream_abbr": "cls-1", + "tutorial_id": 2 + }, + { + "stream_abbr": "cls-2", + "tutorial_id": null + }, + { + "stream_abbr": "wrkshop-2", + "tutorial_id": null + } + ] + }, + { + "id": 18, + "enrolled": true, + "campus_id": 3, + "student": { + "id": 40, + "student_id": null, + "username": "student_17", + "email": "student_17@doubtfire.com", + "first_name": "Kathey", + "last_name": "Heathcote", + "nickname": "student_17" + }, + "target_grade": 3, + "submitted_grade": null, + "compile_portfolio": false, + "grade": 0, + "grade_rationale": null, + "similarity_flag": false, + "has_portfolio": true, + "stats": { + "red_pct": 0, + "grey_pct": 0.33, + "orange_pct": 0.03, + "blue_pct": 0.11, + "green_pct": 0.53, + "order_scale": 64.3 + }, + "tutorial_enrolments": [ + { + "stream_abbr": "wrkshop-1", + "tutorial_id": null + }, + { + "stream_abbr": "cls-1", + "tutorial_id": null + }, + { + "stream_abbr": "cls-2", + "tutorial_id": 3 + }, + { + "stream_abbr": "wrkshop-2", + "tutorial_id": null + } + ] + }, + { + "id": 17, + "enrolled": true, + "campus_id": 3, + "student": { + "id": 39, + "student_id": null, + "username": "student_16", + "email": "student_16@doubtfire.com", + "first_name": "Kenny", + "last_name": "Blanda", + "nickname": "student_16" + }, + "target_grade": 3, + "submitted_grade": null, + "compile_portfolio": false, + "grade": 0, + "grade_rationale": null, + "similarity_flag": false, + "has_portfolio": false, + "stats": { + "red_pct": 0, + "grey_pct": 0.5, + "orange_pct": 0, + "blue_pct": 0.08, + "green_pct": 0.42, + "order_scale": 50 + }, + "tutorial_enrolments": [ + { + "stream_abbr": "wrkshop-1", + "tutorial_id": null + }, + { + "stream_abbr": "cls-1", + "tutorial_id": null + }, + { + "stream_abbr": "cls-2", + "tutorial_id": 3 + }, + { + "stream_abbr": "wrkshop-2", + "tutorial_id": null + } + ] + }, + { + "id": 16, + "enrolled": true, + "campus_id": 3, + "student": { + "id": 38, + "student_id": null, + "username": "student_15", + "email": "student_15@doubtfire.com", + "first_name": "Krystal", + "last_name": "Crooks", + "nickname": "student_15" + }, + "target_grade": 3, + "submitted_grade": null, + "compile_portfolio": false, + "grade": 0, + "grade_rationale": null, + "similarity_flag": false, + "has_portfolio": true, + "stats": { + "red_pct": 0, + "grey_pct": 0.36, + "orange_pct": 0, + "blue_pct": 0.06, + "green_pct": 0.58, + "order_scale": 63.99999999999999 + }, + "tutorial_enrolments": [ + { + "stream_abbr": "wrkshop-1", + "tutorial_id": null + }, + { + "stream_abbr": "cls-1", + "tutorial_id": null + }, + { + "stream_abbr": "cls-2", + "tutorial_id": 3 + }, + { + "stream_abbr": "wrkshop-2", + "tutorial_id": null + } + ] + }, + { + "id": 2, + "enrolled": true, + "campus_id": 2, + "student": { + "id": 24, + "student_id": null, + "username": "student_1", + "email": "student_1@doubtfire.com", + "first_name": "Layla", + "last_name": "Kihn", + "nickname": "student_1" + }, + "target_grade": 3, + "submitted_grade": null, + "compile_portfolio": false, + "grade": 0, + "grade_rationale": null, + "similarity_flag": true, + "has_portfolio": false, + "stats": { + "red_pct": 0, + "grey_pct": 0.53, + "orange_pct": 0, + "blue_pct": 0.03, + "green_pct": 0.44, + "order_scale": 47 + }, + "tutorial_enrolments": [ + { + "stream_abbr": "wrkshop-1", + "tutorial_id": null + }, + { + "stream_abbr": "cls-1", + "tutorial_id": null + }, + { + "stream_abbr": "cls-2", + "tutorial_id": null + }, + { + "stream_abbr": "wrkshop-2", + "tutorial_id": 1 + } + ] + }, + { + "id": 8, + "enrolled": true, + "campus_id": 3, + "student": { + "id": 30, + "student_id": null, + "username": "student_7", + "email": "student_7@doubtfire.com", + "first_name": "Monte", + "last_name": "Waelchi", + "nickname": "student_7" + }, + "target_grade": 1, + "submitted_grade": null, + "compile_portfolio": false, + "grade": 0, + "grade_rationale": null, + "similarity_flag": false, + "has_portfolio": false, + "stats": { + "red_pct": 0, + "grey_pct": 0.27, + "orange_pct": 0.03, + "blue_pct": 0.1, + "green_pct": 0.6, + "order_scale": 70.3 + }, + "tutorial_enrolments": [ + { + "stream_abbr": "wrkshop-1", + "tutorial_id": null + }, + { + "stream_abbr": "cls-1", + "tutorial_id": 2 + }, + { + "stream_abbr": "cls-2", + "tutorial_id": null + }, + { + "stream_abbr": "wrkshop-2", + "tutorial_id": null + } + ] + }, + { + "id": 3, + "enrolled": true, + "campus_id": 2, + "student": { + "id": 25, + "student_id": null, + "username": "student_2", + "email": "student_2@doubtfire.com", + "first_name": "Nan", + "last_name": "Osinski", + "nickname": "student_2" + }, + "target_grade": 0, + "submitted_grade": null, + "compile_portfolio": false, + "grade": 0, + "grade_rationale": null, + "similarity_flag": false, + "has_portfolio": true, + "stats": { + "red_pct": 0, + "grey_pct": 0.33, + "orange_pct": 0.05, + "blue_pct": 0.05, + "green_pct": 0.57, + "order_scale": 62.49999999999999 + }, + "tutorial_enrolments": [ + { + "stream_abbr": "wrkshop-1", + "tutorial_id": null + }, + { + "stream_abbr": "cls-1", + "tutorial_id": null + }, + { + "stream_abbr": "cls-2", + "tutorial_id": null + }, + { + "stream_abbr": "wrkshop-2", + "tutorial_id": 1 + } + ] + }, + { + "id": 1, + "enrolled": true, + "campus_id": 2, + "student": { + "id": 23, + "student_id": null, + "username": "student_0", + "email": "student_0@doubtfire.com", + "first_name": "Tonita", + "last_name": "Feil", + "nickname": "student_0" + }, + "target_grade": 3, + "submitted_grade": null, + "compile_portfolio": false, + "grade": 0, + "grade_rationale": null, + "similarity_flag": true, + "has_portfolio": false, + "stats": { + "red_pct": 0, + "grey_pct": 0.75, + "orange_pct": 0, + "blue_pct": 0.08, + "green_pct": 0.17, + "order_scale": 25 + }, + "tutorial_enrolments": [ + { + "stream_abbr": "wrkshop-1", + "tutorial_id": null + }, + { + "stream_abbr": "cls-1", + "tutorial_id": null + }, + { + "stream_abbr": "cls-2", + "tutorial_id": null + }, + { + "stream_abbr": "wrkshop-2", + "tutorial_id": 1 + } + ] + }, + { + "id": 4, + "enrolled": true, + "campus_id": 2, + "student": { + "id": 26, + "student_id": null, + "username": "student_3", + "email": "student_3@doubtfire.com", + "first_name": "William", + "last_name": "Schamberger", + "nickname": "student_3" + }, + "target_grade": 1, + "submitted_grade": null, + "compile_portfolio": false, + "grade": 0, + "grade_rationale": null, + "similarity_flag": false, + "has_portfolio": true, + "stats": { + "red_pct": 0, + "grey_pct": 0.43, + "orange_pct": 0.03, + "blue_pct": 0.07, + "green_pct": 0.47, + "order_scale": 54.3 + }, + "tutorial_enrolments": [ + { + "stream_abbr": "wrkshop-1", + "tutorial_id": null + }, + { + "stream_abbr": "cls-1", + "tutorial_id": null + }, + { + "stream_abbr": "cls-2", + "tutorial_id": null + }, + { + "stream_abbr": "wrkshop-2", + "tutorial_id": 1 + } + ] + } + ] + ``` diff --git a/src/content/docs/backend/API/submission.md b/src/content/docs/backend/API/submission.md new file mode 100644 index 0000000..4e0be8a --- /dev/null +++ b/src/content/docs/backend/API/submission.md @@ -0,0 +1,20 @@ +--- +title: Doubtfire API +--- + +# List of Doubtfire + +# API: Submission +submission : Operations about submission +This markdown document provides detailed documentation for the "submission" API endpoints including their URLs, methods, parameters, responses, and example requests using curl. + +This "submission" API has the following operations. + +- **GET**: /api/submission/assess +- **POST**: /api/submission/assess +- **DELETE**: /api/submission/project/{id}/portfolio +- **GET**: /api/submission/project/{id}/portfolio +- **PUT**: /api/submission/project/{id}/portfolio + + +## Detail of Operations related to submission. \ No newline at end of file diff --git a/src/content/docs/backend/API/tasks.md b/src/content/docs/backend/API/tasks.md new file mode 100644 index 0000000..eeb92b4 --- /dev/null +++ b/src/content/docs/backend/API/tasks.md @@ -0,0 +1,22 @@ +--- +title: Doubtfire API +--- + + List of Doubtfire + +# API: Tasks +tasks : Operations about tasks +This markdown document provides detailed documentation for the "task" API endpoints including their URLs, methods, parameters, responses, and example requests using curl. + +This "tasks" API has the following operations. + + +- **GET** /api/tasks/{task_id}/similarities/{id}/viewer_url +- **GET** /api/tasks/{task_id}/similarities/{id}/contents/{idx} +- **PUT** /api/tasks/{task_id}/similarities/{id} +- **GET** /api/tasks/{task_id}/similarities +- **DELETE** /api/tasks/{id}/pin +- **POST** /api/tasks/{id}/pin +- **GET** /api/tasks + +## Detail of Operations related to tasks. \ No newline at end of file diff --git a/src/content/docs/backend/API/teaching_periods.md b/src/content/docs/backend/API/teaching_periods.md new file mode 100644 index 0000000..b610503 --- /dev/null +++ b/src/content/docs/backend/API/teaching_periods.md @@ -0,0 +1,343 @@ +--- +title: Doubtfire API +--- + +# List of Doubtfire + +# API: Teaching period +teaching_period : Operations about teaching_period +This markdown document provides detailed documentation for the "teaching_period" API endpoints including their URLs, methods, parameters, responses, and example requests using curl. + +This "teaching_period" API has the following operations. + +- **POST** /api/teaching_periods/{existing_teaching_period_id}/rollover +- **DELETE** /api/teaching_periods/{teaching_period_id} +- **GET** /api/teaching_periods/{id} +- **PUT** /api/teaching_periods/{id} +- **GET** /api/teaching_periods +- **POST** /api/teaching_periods +- **DELETE** /api/teaching_periods/{teaching_period_id}/breaks/{id} +- **PUT** /api/teaching_periods/{teaching_period_id}/breaks/{id} +- **GET** /api/teaching_periods/{teaching_period_id}/breaks +- **POST** /api/teaching_periods/{teaching_period_id}/breaks + + +## Detail of Operations related to teaching_period. + +### POST: Rollover a Teaching Period +POST /api/teaching_periods/{existing_teaching_period_id}/rollover + +- URL: `/api/teaching_periods/{existing_teaching_period_id}/rollover` +- Method: `POST` +- Parameters: + +- Response: +`200 OK` + +- Example Request: + ```bash + curl -X POST --header 'Content-Type: application/x-www-form-urlencoded' --header 'Accept: application/json' --header 'Username: aadmin' --header 'Auth_Token: quNNcGRv8bLteyUXqE6T' -d 'new_teaching_period_id=5&rollover_inactive=true&search_forward=true' 'http://localhost:3000/api/teaching_periods/3/rollover' + ``` +- Response body: + ```null ``` +-------------------------------------------------------------------------------- + +### DELETE: Delete a teaching period +DELETE /api/teaching_periods/{teaching_period_id} + +- URL: `/api/teaching_periods/{teaching_period_id}` +- Method: `DELETE` +- Parameters: + | Parameter | Description |Parameter Type| Data Type|Mandatory| + |---------------------|-----------------|------------|------------|---| + |Username | User username | header | string |Yes| + |Auth_Token | Authentication token | header | string |Yes| + |teaching_period_id | | path | integer |Yes| + |id| | path | integer| Yes| +- Response: +`204 ` + +- Example Request: + ```bash + curl -X DELETE --header 'Accept: application/json' --header 'Username: aadmin' --header 'Auth_Token: 6NuPzeRAruwgNtHo8V39' 'http://localhost:3000/api/teaching_periods/4' + ``` +- Response body: + ```Teaching period deleted ``` +------------------------------------------------------------------- +### GET: Get a teaching period's details +GET /api/teaching_periods/{id} + +- URL: `/api/teaching_periods/{teaching_period_id}` +- Method: `GET` +- Parameters: + | Parameter | Description |Parameter Type| Data Type|Mandatory| + |---------------------|-----------------|------------|------------|---| + |id || path | integer |Yes| + +- Response: +`200 OK`: Get a teaching period's details + +- Example Request: + ```bash + curl -X GET --header 'Accept: application/json' 'http://localhost:3000/api/teaching_periods/1' + ``` +- Response body: + ```json + { + "id": 1, + "period": "T1", + "year": 2018, + "start_date": "2018-03-05T00:00:00.000Z", + "end_date": "2018-05-25T00:00:00.000Z", + "active_until": "2018-06-15T00:00:00.000Z", + "active": false, + "breaks": [ + { + "id": 1, + "start_date": "2018-03-30", + "number_of_weeks": 1 + } + ], + "units": [] + } + ``` +--------------------------------------------------------------------- +### PUT: Update teaching period +PUT /api/teaching_periods/{id} + +- URL: `/api/teaching_periods/{id}` +- Method: `PUT` +- Parameters: + + | Parameter | Description |Parameter Type| Data Type|Mandatory| + |---------------------|-----------------|------------|------------|---| + |id| The teaching period id to update| path | integer| Yes| + |teaching_period[period] |The name of the teaching period| formData | String || + |teaching_period[year] |The year of the teaching period| formData | integer || + |teaching_period[start_date] |The start date of the teaching period | formData | date || + |teaching_period[end_date] |The end date of the teaching period| formData | integer || + |teaching_period[active_until] |The teaching period will be active until this date | formData | integer || + |Username | User username | header | string |Yes| + |Auth_Token | Authentication token | header | string |Yes| + + +- Response: +`200 OK` + +- Example Request: + ```bash + curl -X PUT --header 'Content-Type: application/x-www-form-urlencoded' --header 'Accept: application/json' --header 'Username: aadmin' --header 'Auth_Token: YhcqgVjqxGDmbxvyfk1q' -d 'teaching_period%5Bactive_until%5D=2024-06-15T00%3A00%3A00.000Z' 'http://localhost:3000/api/teaching_periods/4' + ``` +- Response body: + ```json + { + "id": 4, + "period": "T1", + "year": 2024, + "start_date": "2024-03-05T00:00:00.000Z", + "end_date": "2024-05-25T00:00:00.000Z", + "active_until": "2024-06-15T00:00:00.000Z", + "active": true + } + ``` + +------------------------------------------------------------------------ + +### GET: Get all the Teaching Periods +GET /api/teaching_periods + +- URL: `/api/teaching_periods` +- Method: `GET` +- Parameters: +- Response: +`200 OK` + +- Example Request: + ```bash + curl -X GET --header 'Accept: application/json' 'http://localhost:3000/api/teaching_periods' + ``` +- Response body: + ```json + [ + { + "id": 1, + "period": "T1", + "year": 2018, + "start_date": "2018-03-05T00:00:00.000Z", + "end_date": "2018-05-25T00:00:00.000Z", + "active_until": "2018-06-15T00:00:00.000Z", + "active": false + }, + { + "id": 2, + "period": "T2", + "year": 2018, + "start_date": "2018-07-09T00:00:00.000Z", + "end_date": "2018-09-28T00:00:00.000Z", + "active_until": "2018-10-19T00:00:00.000Z", + "active": false + }, + { + "id": 3, + "period": "T3", + "year": 2018, + "start_date": "2018-11-05T00:00:00.000Z", + "end_date": "2019-02-01T00:00:00.000Z", + "active_until": "2019-02-15T00:00:00.000Z", + "active": false + } + ] + ``` +------------------------------------------------------------------------ + +### POST: Add a Teaching Period +POST /api/teaching_periods + +- URL: `/api/teaching_periods` +- Method: `POST` +- Parameters: + | Parameter | Description |Parameter Type| Data Type|Mandatory| + |---------------------|-----------------|------------|------------|---| + |teaching_period[period] |The name of the teaching period| formData | String |Yes| + |teaching_period[year] |The year of the teaching period| formData | integer |Yes| + |teaching_period[start_date] |The start date of the teaching period | formData | date |Yes| + |teaching_period[end_date] |The end date of the teaching period| formData | integer |Yes| + |teaching_period[active_until] |The teaching period will be active until this date | formData | integer |Yes| + |Username | User username | header | string |Yes| + |Auth_Token | Authentication token | header | string |Yes| + +- Response: +`201 Created` + +- Example Request: + ```bash + curl -X POST --header 'Content-Type: application/x-www-form-urlencoded' --header 'Accept: application/json' --header 'Username: aadmin' --header 'Auth_Token: YhcqgVjqxGDmbxvyfk1q' -d 'teaching_period%5Bperiod%5D=T1&teaching_period%5Byear%5D=2024&teaching_period%5Bstart_date%5D=2024-03-05T00%3A00%3A00.000Z&teaching_period%5Bend_date%5D=2024-05-25T00%3A00%3A00.000Z&teaching_period%5Bactive_until%5D=2024-06-25T00%3A00%3A00.000Z' 'http://localhost:3000/api/teaching_periods' + ``` +- Response body: + ```json + { + "id": 4, + "period": "T1", + "year": 2024, + "start_date": "2024-03-05T00:00:00.000Z", + "end_date": "2024-05-25T00:00:00.000Z", + "active_until": "2024-06-25T00:00:00.000Z", + "active": true + } + ``` + +------------------------------------------------------------------------ + +### DELETE: Remove a break from a teaching period +DELETE /api/teaching_periods/{teaching_period_id}/breaks/{id} + +- URL: `/api/teaching_periods/{teaching_period_id}/breaks/{id}` +- Method: `DELETE` +- Parameters: + | Parameter | Description |Parameter Type| Data Type|Mandatory| + |---------------------|-----------------|------------|------------|---| + |Username | User username | header | string |Yes| + |Auth_Token | Authentication token | header | string |Yes| + |teaching_period_id | | path | integer |Yes| + |id| | path | integer| Yes| +- Response: +`204 ` + +- Example Request: + ```bash + curl -X DELETE --header 'Accept: application/json' --header 'Username: aadmin' --header 'Auth_Token: 6NuPzeRAruwgNtHo8V39' 'http://localhost:3000/api/teaching_periods/4/breaks/4' + ``` +- Response body: + ``` true ``` +------------------------------------------------------------------------ + +### PUT: Update a break in the teaching period +PUT /api/teaching_periods/{teaching_period_id}/breaks/{id} + +- URL: `/api/teaching_periods/{teaching_period_id}/breaks/{id}` +- Method: `PUT` +- Parameters: + | Parameter | Description |Parameter Type| Data Type|Mandatory| + |---------------------|-----------------|------------|------------|---| + |start_date |The start date of the teaching period | formData | date || + |number_of_weeks |Break duration| formData | integer || + |Username | User username | header | string |Yes| + |Auth_Token | Authentication token | header | string |Yes| + |teaching_period_id | | path | integer |Yes| + |id| | path | integer| Yes| + +- Response: +`200 OK` + +- Example Request: + ```bash + curl -X PUT --header 'Content-Type: application/x-www-form-urlencoded' --header 'Accept: application/json' --header 'Username: aadmin' --header 'Auth_Token: 6NuPzeRAruwgNtHo8V39' -d 'number_of_weeks=2' 'http://localhost:3000/api/teaching_periods/4/breaks/4' + ``` +- Response body: + ```json + { + "id": 4, + "start_date": "2024-04-12", + "number_of_weeks": 2 + } + ``` +----------------------------------------------------------------------------- +### GET: Get all the breaks in the Teaching Period +GET /api/teaching_periods/{teaching_period_id}/breaks + +- URL: `/api/teaching_periods/{teaching_period_id}/breaks/{id}` +- Method: `GET` +- Parameters: +- Parameters: + | Parameter | Description |Parameter Type| Data Type|Mandatory| + |---------------------|-----------------|------------|------------|---| + |Username | User username | header | string |Yes| + |Auth_Token | Authentication token | header | string |Yes| + |teaching_period_id| | path| integer| Yes| +- Response: +`200 OK` + +- Example Request: + ```bash + curl -X GET --header 'Accept: application/json' --header 'Username: aadmin' --header 'Auth_Token: YhcqgVjqxGDmbxvyfk1q' 'http://localhost:3000/api/teaching_periods/1/breaks' + ``` +- Response body: + ```json + [ + { + "id": 1, + "start_date": "2018-03-30", + "number_of_weeks": 1 + } + ] + ``` +----------------------------------------------------------------------------- +### POST: Add a new break to the teaching period +POST /api/teaching_periods/{teaching_period_id}/breaks + +- URL: `/api/teaching_periods/{teaching_period_id}/breaks/{id}` +- Method: `POST` +- Parameters: + | Parameter | Description |Parameter Type| Data Type|Mandatory| + |---------------------|-----------------|------------|------------|---| + |start_date |The start date of the break | formData | date |Yes| + |number_of_weeks |Break duration | formData | integer |Yes| + |Username | User username | header | string |Yes| + |Auth_Token | Authentication token | header | string |Yes| + |teaching_period_id| | path| integer| Yes| + +- Response: +`200 OK` + +- Example Request: + ```bash + curl -X POST --header 'Content-Type: application/x-www-form-urlencoded' --header 'Accept: application/json' --header 'Username: aadmin' --header 'Auth_Token: YhcqgVjqxGDmbxvyfk1q' -d 'start_date=2024-04-12T00%3A00%3A00.000Z&number_of_weeks=1' 'http://localhost:3000/api/teaching_periods/4/breaks' + ``` +- Response body: + ```json + { + "id": 4, + "start_date": "2024-04-12", + "number_of_weeks": 1 + } + ``` diff --git a/src/content/docs/backend/API/tii_actions.md b/src/content/docs/backend/API/tii_actions.md new file mode 100644 index 0000000..1c0c6f7 --- /dev/null +++ b/src/content/docs/backend/API/tii_actions.md @@ -0,0 +1,15 @@ +--- +title: Doubtfire API +--- + +# List of Doubtfire + +# API: tii_actions +tii_actions : Operations about tii_actions +This markdown document provides detailed documentation for the "tii_actions" API endpoints, including their URLs, methods, parameters (if any), responses, and example requests using curl. + +This "tii_actipns" API has the following operations. +- **PUT** /api/tii_actions/{id} +- **GET** /api/tii_actions + +## Detail of Operations related to tii_actions. \ No newline at end of file diff --git a/src/content/docs/backend/API/tii_eula.md b/src/content/docs/backend/API/tii_eula.md new file mode 100644 index 0000000..7f2eb16 --- /dev/null +++ b/src/content/docs/backend/API/tii_eula.md @@ -0,0 +1,67 @@ +--- +title: Doubtfire API +--- + +# List of Doubtfire + +# API: tii_eula +tii_eula : Operations about tii_eula +This markdown document provides detailed documentation for the "tii_eula" API endpoints, including their URLs, methods, parameters (if any), responses, and example requests using curl. + +This "tii_eula" API has the following operations. +- **PUT** /api/tii_eula/users/{id}/accept +- **GET** /api/tii_eula + + +## Detail of Operations related to tii_eula. + +### PUT: Trigger an action on the given group attachment +PUT /api/tii_eula/users/{id}/accept + +- URL: `/api/tii_eula/users/{id}/accept` +- Method: `PUT` +- Parameters: + + | Parameter | Description |Parameter Type| Data Type|Mandatory| + |---------------------|-----------------|------------|------------|---| + |id | The user id who is accepting the EULA| path | integer |Yes| + |Username | User username | header | string |Yes| + |Auth_Token | Authentication token | header | string |Yes| + +- Response: +`200 OK` + +- Example Request: + ```bash + curl -X PUT --header 'Content-Type: application/json' --header 'Accept: application/json' --header 'Username: aadmin' --header 'Auth_Token: vs61XXKdACADRUfQBWzr' 'http://localhost:3000/api/tii_eula/users/1/accept' + ``` +- Response body: + ``` + "22448dfcaa620f1ad665d4b7" + ``` + + +### GET: Get the current EULA html +GET /api/tii_eula + +- URL: `/api/tii_eula` +- Method: `GET` +- Parameters: + + | Parameter | Description |Parameter Type| Data Type|Mandatory| + |---------------------|-----------------|------------|------------|---| + |Username | User username | header | string |Yes| + |Auth_Token | Authentication token | header | string |Yes| + +- Response: +`200 OK` + +- Example Request: + ```bash + curl -X GET --header 'Accept: text/html' --header 'Username: aadmin' --header 'Auth_Token: ZRZfC2r8_2KNZKdstXHc' 'http://localhost:3000/api/tii_eula' + ``` +- Response body: + ``` + null + ``` + diff --git a/src/content/docs/backend/API/tii_hook.md b/src/content/docs/backend/API/tii_hook.md new file mode 100644 index 0000000..77e0074 --- /dev/null +++ b/src/content/docs/backend/API/tii_hook.md @@ -0,0 +1,40 @@ +--- +title: Doubtfire API +--- + +# List of Doubtfire + +# API: tii_hook +This markdown document provides detailed documentation for the "tii_hook" API endpoints, including their URLs, methods, parameters (if any), responses, and example requests using curl. + +This "tii_hook" API has the following operations. +- **POST** /api/tii_hook + +## Detail of Operations related to tii_hook. + +### POST activity_types: Accept the TurnItIn EULA +POST /api/tii_hook + +- URL: `api/tii_hook` +- Method: `POST` +- Parameters: + +| Parameter | Description |Parameter Type| Data Type|Mandatory| +|---------------------|-----------------|------------|------------|----| +| X-Turnitin-Signature | Valdates server identity | header| string| Yes| +|X-Turnitin-EventType | The name of the event type for this request | header| string| Yes| + + +- Response: +`201 Created`: Accept the TurnItIn EULA + +- Example Request: + ```bash + curl -X POST --header 'Content-Type: application/json' --header 'Accept: text/error' --header 'X-Turnitin-Signature: ' --header 'X-Turnitin-EventType: PDF_STATUS' 'http://localhost:3000/api/tii_hook' + + ``` + +- Response Body + ``` + success: Accept the TurnItIn EULA + ``` \ No newline at end of file diff --git a/src/content/docs/backend/API/tutorials.md b/src/content/docs/backend/API/tutorials.md new file mode 100644 index 0000000..6229186 --- /dev/null +++ b/src/content/docs/backend/API/tutorials.md @@ -0,0 +1,122 @@ +--- +title: Doubtfire API +--- + +# List of Doubtfire + +# API: tutorials +tutorials : Operations about tutorials +This markdown document provides detailed documentation for the "tutorials" API endpoints, including their URLs, methods, parameters (if any), responses, and example requests using curl. + +This "tutorials" API has the following operations. + +- **DELETE** /api/tutorials/{id} +- **PUT** /api/tutorials/{id} +- **POST** /api/tutorials + + +## Detail of Operations related to users. + +### DELETE: Delete a tutorial +DELETE /api/tutorials/{id} + +- URL: `/api/tutorials/{id}` +- Method: `DELETE` +- Parameters: + | Parameter | Description |Parameter Type| Data Type|Mandatory| + |---------------------|-----------------|------------|------------|---| + |id | | path | integer|Yes| + |Username | User username | header | string |Yes| + |Auth_Token | Authentication token | header | string |Yes| + + +- Response: + `204 OK`: Tutorial deleted successfully. + +- Example Request: + ```bash + curl -X DELETE --header 'Accept: application/json' --header 'Username: aadmin' --header 'Auth_Token: yzRDggcmzbVnYEbszVV1' 'http://localhost:3000/api/campuses/6' + ``` +- Response body: + ``` + true + ``` +----------------------------------------------------------------------------- +### PUT: Update a tutorial +PUT /api/tutorials/{id} + +- URL: `/api/tutorials/{id}` +- Method: `PUT` +- Parameters: + | Parameter | Description |Parameter Type| Data Type|Mandatory| + |---------------------|-----------------|------------|------------|---| + | tutorial [unit_id] | Id of the unit| formData | integer|Yes| + | tutorial [tutor_id] | Id of the tutor| formData | integer|| + | tutorial [campus_id] | Id of the campus| formData | integer|| + | tutorial [capacity] | Capacity of the tutorial| formData | integer|| + |tutorial[abbreviation] | The tutorials code| formData | string|| + |tutorial[meeting_location] |The tutorials location | formData | string|| + |tutorial[meeting_day] |Day of the tutorials | formData | string|| + |tutorial[meeting_time] |Time of the tutorials | formData | string|| + |Username | User username | header | string |Yes| + |Auth_Token | Authentication token | header | string |Yes| + + +- Response: + `200 OK` + +- Example Request: + ```bash + curl -X PUT --header 'Content-Type: application/x-www-form-urlencoded' --header 'Accept: application/json' --header 'Username: aadmin' --header 'Auth_Token: 3DLo9xQoiKbXb7-ViNzJ' -d 'tutorial%5Btutor_id%5D=43&tutorial%5Bcapacity%5D=45' 'http://localhost:3000/api/tutorials/1' + ``` +- Response body: + ```json + { + "id": 1, + "meeting_day": "Wednesday", + "meeting_time": "15:00", + "meeting_location": "geelong", + "abbreviation": "LA1-01", + "campus_id": 2, + "capacity": 45, + "tutorial_stream_abbr": "wrkshop-2", + "num_students": 6, + "tutor_id": 2 + } + ``` + + +----------------------------------------------------------------------------- + +### POST: Create a tutorial +POST /api/tutorials + +- URL: `/api/tutorials` +- Method: `POST` +- Parameters: + | Parameter | Description |Parameter Type| Data Type|Mandatory| + |---------------------|-----------------|------------|------------|---| + | tutorial [unit_id] | Id of the unit| formData | integer|Yes| + | tutorial [tutor_id] | Id of the tutor| formData | integer|Yes| + | tutorial [campus_id] | Id of the campus| formData | integer|| + | tutorial [capacity] | Capacity of the tutorial| formData | integer|Yes| + |tutorial[abbreviation] | The tutorials code| formData | string|Yes| + |tutorial[meeting_location] |The tutorials location | formData | string|Yes| + |tutorial[meeting_day] |Day of the tutorials | formData | string|Yes| + |tutorial[meeting_time] |Time of the tutorials | formData | string|Yes| + |tutorial[tutorial_stream_abbr] |Abbreviation of the associated tutorial stream | formData | string| | + |Username | User username | header | string |Yes| + |Auth_Token | Authentication token | header | string |Yes| + + +- Response: + `201 Created`: Tutorial added successfully. + +- Example Request: + ```bash + curl -X POST --header 'Content-Type: application/x-www-form-urlencoded' --header 'Accept: application/json' --header 'Username: aadmin' --header 'Auth_Token: 3DLo9xQoiKbXb7-ViNzJ' -d 'tutorial%5Bunit_id%5D=1&tutorial%5Btutor_id%5D=43&tutorial%5Bcapacity%5D=45&tutorial%5Babbreviation%5D=tut_test2&tutorial%5Bmeeting_location%5D=online&tutorial%5Bmeeting_day%5D=Tue&tutorial%5Bmeeting_time%5D=11%3A00' 'http://localhost:3000/api/tutorials' + ``` +- Response body: + ``` + Tutorial added successfully. + ``` \ No newline at end of file diff --git a/src/content/docs/backend/API/unit_roles.md b/src/content/docs/backend/API/unit_roles.md new file mode 100644 index 0000000..eaba139 --- /dev/null +++ b/src/content/docs/backend/API/unit_roles.md @@ -0,0 +1,19 @@ +--- +title: Doubtfire API +--- + +# List of Doubtfire |||| DETAILS to be added + +# API: Unit_roles +unit_roles : Operations about unit_roles + +This markdown document provides detailed documentation for the "unit_roles" API endpoints, including their URLs, methods, parameters (if any), responses, and example requests using curl. + +This "unit_roles" API has the following operations. + +- **DELETE** /api/unit_roles/{id} +- **PUT** /api/unit_roles/{id} +- **GET** /api/unit_roles +- **POST** /api/unit_roles + +## Detail of Operations related to unit_roles \ No newline at end of file diff --git a/src/content/docs/backend/API/units.md b/src/content/docs/backend/API/units.md new file mode 100644 index 0000000..7fb1953 --- /dev/null +++ b/src/content/docs/backend/API/units.md @@ -0,0 +1,77 @@ +--- +title: Doubtfire API +--- + +# List of Doubtfire |||| DETAILS to be added + +# API: Units +units : Operations about units + +This markdown document provides detailed documentation for the "units" API endpoints, including their URLs, methods, parameters (if any), responses, and example requests using curl. + +This "units" API has the following operations. + +- **GET** /api/units/{id}/stats/task_completion_stats +- **GET** /api/units/{id}/stats/task_status_pct +- **GET** /api/units/{id}/stats/student_target_grade +- **GET** /api/units/{id}/grades +- **GET** /api/units/{id}/tasks/inbox +- **GET** /api/units/{id}/feedback +- **POST** /api/units/{id}/rollover +- **GET** /api/units +- **POST** /api/units +- **GET** /api/units/{id} +- **PUT** /api/units/{id} +- **DELETE** /api/units/{unit_id}/tutorials/{tutorial_abbr}/enrolments/{project_id} +- **POST** /api/units/{unit_id}/tutorials/{tutorial_abbr}/enrolments/{project_id} +- **DELETE** /api/units/{unit_id}/tutorial_streams/{tutorial_stream_abbr} +- **PUT** /api/units/{unit_id}/tutorial_streams/{tutorial_stream_abbr} +- **POST** /api/units/{unit_id}/tutorial_streams +- **DELETE** /api/units/{unit_id}/task_definitions/{task_def_id}/tii_group_attachments/{id} +- **PUT** /api/units/{unit_id}/task_definitions/{task_def_id}/tii_group_attachments/{id} +- **GET** /api/units/{unit_id}/task_definitions/{task_def_id}/tii_group_attachments +- **DELETE** /api/units/{unit_id}/task_definitions/{task_def_id}/task_assessment_resources +- **GET** /api/units/{unit_id}/task_definitions/{task_def_id}/task_assessment_resources +- **POST** /api/units/{unit_id}/task_definitions/{task_def_id}/task_assessment_resources +- **DELETE** /api/units/{unit_id}/task_definitions/{task_def_id}/task_resources +- **GET** /api/units/{unit_id}/task_definitions/{task_def_id}/task_resources +- **POST** /api/units/{unit_id}/task_definitions/{task_def_id}/task_resources +- **GET** /api/units/{unit_id}/task_definitions/{task_def_id}/task_pdf +- **GET** /api/units/{unit_id}/task_definitions/{task_def_id}/tasks +- **POST** /api/units/{unit_id}/task_definitions/task_pdfs +- **DELETE** /api/units/{unit_id}/task_definitions/{task_def_id}/task_sheet +- **POST** /api/units/{unit_id}/task_definitions/{task_def_id}/task_sheet +- **POST** /api/units/{unit_id}/task_definitions/{task_def_id}/test_overseer_assessment +- **DELETE** /api/units/{unit_id}/task_definitions/{id} +- **PUT** /api/units/{unit_id}/task_definitions/{id} +- **POST** /api/units/{unit_id}/task_definitions +- **GET** /api/units/{unit_id}/learning_alignments/class_details +- **GET** /api/units/{unit_id}/learning_alignments/class_stats +- **DELETE** /api/units/{unit_id}/learning_alignments/{id} +- **PUT** /api/units/{unit_id}/learning_alignments/{id} +- **GET** /api/units/{unit_id}/learning_alignments +- **POST** /api/units/{unit_id}/learning_alignments +- **GET** /api/units/{unit_id}/learning_alignments/csv +- **POST** /api/units/{unit_id}/learning_alignments/csv +- **GET** /api/units/{unit_id}/outcomes/csv +- **POST** /api/units/{unit_id}/outcomes/csv +- **DELETE** /api/units/{unit_id}/outcomes/{id} +- **PUT** /api/units/{unit_id}/outcomes/{id} +- **POST** /api/units/{unit_id}/outcomes +- **DELETE** /api/units/{unit_id}/group_sets/{group_set_id}/groups/{group_id}/members/{id} +- **POST** /api/units/{unit_id}/group_sets/{group_set_id}/groups/{group_id}/members/{project_id} +- **GET** /api/units/{unit_id}/group_sets/{group_set_id}/groups/{group_id}/members +- **DELETE** /api/units/{unit_id}/group_sets/{group_set_id}/groups/{group_id} +- **PUT** /api/units/{unit_id}/group_sets/{group_set_id}/groups/{group_id} +- **GET** /api/units/{unit_id}/group_sets/{group_set_id}/groups/student_csv +- **POST** /api/units/{unit_id}/group_sets/{group_set_id}/groups/student_csv +- **GET** /api/units/{unit_id}/group_sets/{group_set_id}/groups/csv +- **POST** /api/units/{unit_id}/group_sets/{group_set_id}/groups/csv +- **POST** /api/units/{unit_id}/group_sets/{group_set_id}/groups +- **GET** /api/units/{unit_id}/group_sets/{id}/groups +- **DELETE** /api/units/{unit_id}/group_sets/{id} +- **PUT** /api/units/{unit_id}/group_sets/{id} +- **POST** /api/units/{unit_id}/group_sets + + +## Detail of Operations related to units \ No newline at end of file diff --git a/src/content/docs/backend/API/users.md b/src/content/docs/backend/API/users.md new file mode 100644 index 0000000..3f9aae5 --- /dev/null +++ b/src/content/docs/backend/API/users.md @@ -0,0 +1,1247 @@ +--- +title: Doubtfire API +--- + +# List of Doubtfire + +# API: users +users : Operations about users +This markdown document provides detailed documentation for the "users" API endpoints, including their URLs, methods, parameters (if any), responses, and example requests using curl. + +This "users" API has the following operations. + +- **GET** /api/users +- **POST** /api/users +- **GET** /api/users/{id} +- **PUT** /api/users/{id} +- **GET** /api/users/tutors +- **GET** /api/users/convenors + +## Detail of Operations related to users. + +### GET: Get the list of users +GET /api/users + +- URL: `/api/users` +- Method: `GET` +- Parameters: + | Parameter | Description |Parameter Type| Data Type|Mandatory| + |---------------------|-----------------|------------|------------|---| + |Username | User username | header | string |Yes| + |Auth_Token | Authentication token | header | string |Yes| + +- Response: +`200 OK` + +- Example Request: + ```bash + curl -X GET --header 'Accept: application/json' --header 'Username: aadmin' --header 'Auth_Token: vs61XXKdACADRUfQBWzr' 'http://localhost:3000/api/users' + ``` +- Response body: + ```json + [ + { + "id": 1, + "student_id": null, + "email": "aadmin@doubtfire.com", + "first_name": "Admin", + "last_name": "Admin", + "username": "aadmin", + "nickname": "Admin", + "receive_task_notifications": true, + "receive_portfolio_notifications": true, + "receive_feedback_notifications": true, + "opt_in_to_research": null, + "has_run_first_time_setup": false, + "system_role": "Admin" + }, + { + "id": 2, + "student_id": null, + "email": "acain@doubtfire.com", + "first_name": "Andrew", + "last_name": "Cain", + "username": "acain", + "nickname": "Macite", + "receive_task_notifications": true, + "receive_portfolio_notifications": true, + "receive_feedback_notifications": true, + "opt_in_to_research": null, + "has_run_first_time_setup": false, + "system_role": "Admin" + }, + { + "id": 3, + "student_id": null, + "email": "aconvenor@doubtfire.com", + "first_name": "Clinton", + "last_name": "Woodward", + "username": "aconvenor", + "nickname": "The Giant", + "receive_task_notifications": true, + "receive_portfolio_notifications": true, + "receive_feedback_notifications": true, + "opt_in_to_research": null, + "has_run_first_time_setup": false, + "system_role": "Convenor" + }, + { + "id": 4, + "student_id": null, + "email": "ajones@doubtfire.com", + "first_name": "Allan", + "last_name": "Jones", + "username": "ajones", + "nickname": "P-Jiddy", + "receive_task_notifications": true, + "receive_portfolio_notifications": true, + "receive_feedback_notifications": true, + "opt_in_to_research": null, + "has_run_first_time_setup": false, + "system_role": "Admin" + }, + { + "id": 5, + "student_id": null, + "email": "rwilson@doubtfire.com", + "first_name": "Reuben", + "last_name": "Wilson", + "username": "rwilson", + "nickname": "Reubs", + "receive_task_notifications": true, + "receive_portfolio_notifications": true, + "receive_feedback_notifications": true, + "opt_in_to_research": null, + "has_run_first_time_setup": false, + "system_role": "Convenor" + }, + { + "id": 6, + "student_id": null, + "email": "atutor@doubtfire.com", + "first_name": "Akihiro", + "last_name": "Noguchi", + "username": "atutor", + "nickname": "Animations", + "receive_task_notifications": true, + "receive_portfolio_notifications": true, + "receive_feedback_notifications": true, + "opt_in_to_research": null, + "has_run_first_time_setup": false, + "system_role": "Tutor" + }, + { + "id": 7, + "student_id": null, + "email": "acummaudo@doubtfire.com", + "first_name": "Alex", + "last_name": "Cummaudo", + "username": "acummaudo", + "nickname": "DoubtfireDude", + "receive_task_notifications": true, + "receive_portfolio_notifications": true, + "receive_feedback_notifications": true, + "opt_in_to_research": null, + "has_run_first_time_setup": false, + "system_role": "Convenor" + }, + { + "id": 8, + "student_id": null, + "email": "cliff@doubtfire.com", + "first_name": "Cliff", + "last_name": "Warren", + "username": "cliff", + "nickname": "Cliff", + "receive_task_notifications": true, + "receive_portfolio_notifications": true, + "receive_feedback_notifications": true, + "opt_in_to_research": null, + "has_run_first_time_setup": false, + "system_role": "Tutor" + }, + { + "id": 9, + "student_id": null, + "email": "joostfunkekupper@doubtfire.com", + "first_name": "Joost", + "last_name": "Funke Kupper", + "username": "joostfunkekupper", + "nickname": "Joe", + "receive_task_notifications": true, + "receive_portfolio_notifications": true, + "receive_feedback_notifications": true, + "opt_in_to_research": null, + "has_run_first_time_setup": false, + "system_role": "Tutor" + }, + { + "id": 10, + "student_id": null, + "email": "angusmorton@doubtfire.com", + "first_name": "Angus", + "last_name": "Morton", + "username": "angusmorton", + "nickname": "Angus", + "receive_task_notifications": true, + "receive_portfolio_notifications": true, + "receive_feedback_notifications": true, + "opt_in_to_research": null, + "has_run_first_time_setup": false, + "system_role": "Tutor" + }, + { + "id": 11, + "student_id": null, + "email": "123456x@doubtfire.com", + "first_name": "Fred", + "last_name": "Jones", + "username": "123456x", + "nickname": "Foo", + "receive_task_notifications": true, + "receive_portfolio_notifications": true, + "receive_feedback_notifications": true, + "opt_in_to_research": null, + "has_run_first_time_setup": false, + "system_role": "Student" + }, + { + "id": 12, + "student_id": null, + "email": "astudent@doubtfire.com", + "first_name": "student", + "last_name": "surname", + "username": "astudent", + "nickname": "Foo", + "receive_task_notifications": true, + "receive_portfolio_notifications": true, + "receive_feedback_notifications": true, + "opt_in_to_research": null, + "has_run_first_time_setup": false, + "system_role": "Student" + }, + { + "id": 13, + "student_id": null, + "email": "tutor_0@doubtfire.com", + "first_name": "Karon", + "last_name": "Kutch", + "username": "tutor_0", + "nickname": "tutor_0", + "receive_task_notifications": true, + "receive_portfolio_notifications": true, + "receive_feedback_notifications": true, + "opt_in_to_research": null, + "has_run_first_time_setup": false, + "system_role": "Tutor" + }, + { + "id": 14, + "student_id": null, + "email": "tutor_1@doubtfire.com", + "first_name": "Scottie", + "last_name": "Hermiston", + "username": "tutor_1", + "nickname": "tutor_1", + "receive_task_notifications": true, + "receive_portfolio_notifications": true, + "receive_feedback_notifications": true, + "opt_in_to_research": null, + "has_run_first_time_setup": false, + "system_role": "Tutor" + }, + { + "id": 15, + "student_id": null, + "email": "tutor_2@doubtfire.com", + "first_name": "Porfirio", + "last_name": "Ortiz", + "username": "tutor_2", + "nickname": "tutor_2", + "receive_task_notifications": true, + "receive_portfolio_notifications": true, + "receive_feedback_notifications": true, + "opt_in_to_research": null, + "has_run_first_time_setup": false, + "system_role": "Tutor" + }, + { + "id": 16, + "student_id": null, + "email": "tutor_3@doubtfire.com", + "first_name": "Kayce", + "last_name": "Kassulke", + "username": "tutor_3", + "nickname": "tutor_3", + "receive_task_notifications": true, + "receive_portfolio_notifications": true, + "receive_feedback_notifications": true, + "opt_in_to_research": null, + "has_run_first_time_setup": false, + "system_role": "Tutor" + }, + { + "id": 17, + "student_id": null, + "email": "tutor_4@doubtfire.com", + "first_name": "Kristofer", + "last_name": "Schoen", + "username": "tutor_4", + "nickname": "tutor_4", + "receive_task_notifications": true, + "receive_portfolio_notifications": true, + "receive_feedback_notifications": true, + "opt_in_to_research": null, + "has_run_first_time_setup": false, + "system_role": "Tutor" + }, + { + "id": 18, + "student_id": null, + "email": "tutor_5@doubtfire.com", + "first_name": "Granville", + "last_name": "Howell", + "username": "tutor_5", + "nickname": "tutor_5", + "receive_task_notifications": true, + "receive_portfolio_notifications": true, + "receive_feedback_notifications": true, + "opt_in_to_research": null, + "has_run_first_time_setup": false, + "system_role": "Tutor" + }, + { + "id": 19, + "student_id": null, + "email": "tutor_6@doubtfire.com", + "first_name": "Harry", + "last_name": "O'Hara", + "username": "tutor_6", + "nickname": "tutor_6", + "receive_task_notifications": true, + "receive_portfolio_notifications": true, + "receive_feedback_notifications": true, + "opt_in_to_research": null, + "has_run_first_time_setup": false, + "system_role": "Tutor" + }, + { + "id": 20, + "student_id": null, + "email": "tutor_7@doubtfire.com", + "first_name": "Valorie", + "last_name": "Herzog", + "username": "tutor_7", + "nickname": "tutor_7", + "receive_task_notifications": true, + "receive_portfolio_notifications": true, + "receive_feedback_notifications": true, + "opt_in_to_research": null, + "has_run_first_time_setup": false, + "system_role": "Tutor" + }, + { + "id": 21, + "student_id": null, + "email": "tutor_8@doubtfire.com", + "first_name": "Russel", + "last_name": "McCullough", + "username": "tutor_8", + "nickname": "tutor_8", + "receive_task_notifications": true, + "receive_portfolio_notifications": true, + "receive_feedback_notifications": true, + "opt_in_to_research": null, + "has_run_first_time_setup": false, + "system_role": "Tutor" + }, + { + "id": 22, + "student_id": null, + "email": "tutor_9@doubtfire.com", + "first_name": "Billie", + "last_name": "Pagac", + "username": "tutor_9", + "nickname": "tutor_9", + "receive_task_notifications": true, + "receive_portfolio_notifications": true, + "receive_feedback_notifications": true, + "opt_in_to_research": null, + "has_run_first_time_setup": false, + "system_role": "Tutor" + }, + { + "id": 23, + "student_id": null, + "email": "student_0@doubtfire.com", + "first_name": "Tonita", + "last_name": "Feil", + "username": "student_0", + "nickname": "student_0", + "receive_task_notifications": true, + "receive_portfolio_notifications": true, + "receive_feedback_notifications": true, + "opt_in_to_research": null, + "has_run_first_time_setup": false, + "system_role": "Student" + }, + { + "id": 24, + "student_id": null, + "email": "student_1@doubtfire.com", + "first_name": "Layla", + "last_name": "Kihn", + "username": "student_1", + "nickname": "student_1", + "receive_task_notifications": true, + "receive_portfolio_notifications": true, + "receive_feedback_notifications": true, + "opt_in_to_research": null, + "has_run_first_time_setup": false, + "system_role": "Student" + }, + { + "id": 25, + "student_id": null, + "email": "student_2@doubtfire.com", + "first_name": "Nan", + "last_name": "Osinski", + "username": "student_2", + "nickname": "student_2", + "receive_task_notifications": true, + "receive_portfolio_notifications": true, + "receive_feedback_notifications": true, + "opt_in_to_research": null, + "has_run_first_time_setup": false, + "system_role": "Student" + }, + { + "id": 26, + "student_id": null, + "email": "student_3@doubtfire.com", + "first_name": "William", + "last_name": "Schamberger", + "username": "student_3", + "nickname": "student_3", + "receive_task_notifications": true, + "receive_portfolio_notifications": true, + "receive_feedback_notifications": true, + "opt_in_to_research": null, + "has_run_first_time_setup": false, + "system_role": "Student" + }, + { + "id": 27, + "student_id": null, + "email": "student_4@doubtfire.com", + "first_name": "Emanuel", + "last_name": "Kutch", + "username": "student_4", + "nickname": "student_4", + "receive_task_notifications": true, + "receive_portfolio_notifications": true, + "receive_feedback_notifications": true, + "opt_in_to_research": null, + "has_run_first_time_setup": false, + "system_role": "Student" + }, + { + "id": 28, + "student_id": null, + "email": "student_5@doubtfire.com", + "first_name": "Dale", + "last_name": "Homenick", + "username": "student_5", + "nickname": "student_5", + "receive_task_notifications": true, + "receive_portfolio_notifications": true, + "receive_feedback_notifications": true, + "opt_in_to_research": null, + "has_run_first_time_setup": false, + "system_role": "Student" + }, + { + "id": 29, + "student_id": null, + "email": "student_6@doubtfire.com", + "first_name": "Gracia", + "last_name": "Heathcote", + "username": "student_6", + "nickname": "student_6", + "receive_task_notifications": true, + "receive_portfolio_notifications": true, + "receive_feedback_notifications": true, + "opt_in_to_research": null, + "has_run_first_time_setup": false, + "system_role": "Student" + }, + { + "id": 30, + "student_id": null, + "email": "student_7@doubtfire.com", + "first_name": "Monte", + "last_name": "Waelchi", + "username": "student_7", + "nickname": "student_7", + "receive_task_notifications": true, + "receive_portfolio_notifications": true, + "receive_feedback_notifications": true, + "opt_in_to_research": null, + "has_run_first_time_setup": false, + "system_role": "Student" + }, + { + "id": 31, + "student_id": null, + "email": "student_8@doubtfire.com", + "first_name": "John", + "last_name": "Padberg", + "username": "student_8", + "nickname": "student_8", + "receive_task_notifications": true, + "receive_portfolio_notifications": true, + "receive_feedback_notifications": true, + "opt_in_to_research": null, + "has_run_first_time_setup": false, + "system_role": "Student" + }, + { + "id": 32, + "student_id": null, + "email": "student_9@doubtfire.com", + "first_name": "Juan", + "last_name": "Daugherty", + "username": "student_9", + "nickname": "student_9", + "receive_task_notifications": true, + "receive_portfolio_notifications": true, + "receive_feedback_notifications": true, + "opt_in_to_research": null, + "has_run_first_time_setup": false, + "system_role": "Student" + }, + { + "id": 33, + "student_id": null, + "email": "student_10@doubtfire.com", + "first_name": "Herbert", + "last_name": "Flatley", + "username": "student_10", + "nickname": "student_10", + "receive_task_notifications": true, + "receive_portfolio_notifications": true, + "receive_feedback_notifications": true, + "opt_in_to_research": null, + "has_run_first_time_setup": false, + "system_role": "Student" + }, + { + "id": 34, + "student_id": null, + "email": "student_11@doubtfire.com", + "first_name": "Geraldo", + "last_name": "Rutherford", + "username": "student_11", + "nickname": "student_11", + "receive_task_notifications": true, + "receive_portfolio_notifications": true, + "receive_feedback_notifications": true, + "opt_in_to_research": null, + "has_run_first_time_setup": false, + "system_role": "Student" + }, + { + "id": 35, + "student_id": null, + "email": "student_12@doubtfire.com", + "first_name": "Jordon", + "last_name": "Pagac", + "username": "student_12", + "nickname": "student_12", + "receive_task_notifications": true, + "receive_portfolio_notifications": true, + "receive_feedback_notifications": true, + "opt_in_to_research": null, + "has_run_first_time_setup": false, + "system_role": "Student" + }, + { + "id": 36, + "student_id": null, + "email": "student_13@doubtfire.com", + "first_name": "Georgeanna", + "last_name": "Fay", + "username": "student_13", + "nickname": "student_13", + "receive_task_notifications": true, + "receive_portfolio_notifications": true, + "receive_feedback_notifications": true, + "opt_in_to_research": null, + "has_run_first_time_setup": false, + "system_role": "Student" + }, + { + "id": 37, + "student_id": null, + "email": "student_14@doubtfire.com", + "first_name": "Idalia", + "last_name": "Smith", + "username": "student_14", + "nickname": "student_14", + "receive_task_notifications": true, + "receive_portfolio_notifications": true, + "receive_feedback_notifications": true, + "opt_in_to_research": null, + "has_run_first_time_setup": false, + "system_role": "Student" + }, + { + "id": 38, + "student_id": null, + "email": "student_15@doubtfire.com", + "first_name": "Krystal", + "last_name": "Crooks", + "username": "student_15", + "nickname": "student_15", + "receive_task_notifications": true, + "receive_portfolio_notifications": true, + "receive_feedback_notifications": true, + "opt_in_to_research": null, + "has_run_first_time_setup": false, + "system_role": "Student" + }, + { + "id": 39, + "student_id": null, + "email": "student_16@doubtfire.com", + "first_name": "Kenny", + "last_name": "Blanda", + "username": "student_16", + "nickname": "student_16", + "receive_task_notifications": true, + "receive_portfolio_notifications": true, + "receive_feedback_notifications": true, + "opt_in_to_research": null, + "has_run_first_time_setup": false, + "system_role": "Student" + }, + { + "id": 40, + "student_id": null, + "email": "student_17@doubtfire.com", + "first_name": "Kathey", + "last_name": "Heathcote", + "username": "student_17", + "nickname": "student_17", + "receive_task_notifications": true, + "receive_portfolio_notifications": true, + "receive_feedback_notifications": true, + "opt_in_to_research": null, + "has_run_first_time_setup": false, + "system_role": "Student" + }, + { + "id": 41, + "student_id": null, + "email": "tsdummy@doubtfire.com", + "first_name": "First Name", + "last_name": "Surname", + "username": "tsdummy", + "nickname": "Nickname", + "receive_task_notifications": true, + "receive_portfolio_notifications": true, + "receive_feedback_notifications": true, + "opt_in_to_research": null, + "has_run_first_time_setup": false, + "system_role": "Student" + } + ] + ``` + +### POST: Create user +POST /api/users + +- URL: `/api/users` +- Method: `POST` +- Parameters: + | Parameter | Description |Parameter Type| Data Type|Mandatory| + |---------------------|-----------------|------------|------------|---| + |user [first_name] | New first name for user | formData | string |Yes| + |user [last_name] | New last name for user | formData | string |Yes| + |user [email] | New email address for user | formData | string |Yes| + |user [student_id] | New student_id for user | formData | string || + |user [username] | New username for user | formData | string |Yes| + |user [nickname] | New nickname for user | formData | string |Yes| + |user [system_role] | New system role for user [Admin, Convenor, Tutor, Student] | formData | string |Yes| + |Username | User username | header | string |Yes| + |Auth_Token | Authentication token | header | string |Yes| + + +- Response: +`200 OK` + +- Example Request: + ```bash + curl -X POST --header 'Content-Type: application/x-www-form-urlencoded' --header 'Accept: application/json' --header 'Username: aadmin' --header 'Auth_Token: vs61XXKdACADRUfQBWzr' -d 'user%5Bfirst_name%5D=Ronny&user%5Blast_name%5D=Jackson&user%5Bemail%5D=ron.jackson%40dummyemail.com&user%5Busername%5D=rjack&user%5Bnickname%5D=ron&user%5Bsystem_role%5D=tutor' 'http://localhost:3000/api/users' + ``` +- Response body + ```json + { + "id": 43, + "student_id": null, + "email": "ron.jackson@dummyemail.com", + "first_name": "Ronny", + "last_name": "Jackson", + "username": "rjack", + "nickname": "ron", + "receive_task_notifications": true, + "receive_portfolio_notifications": true, + "receive_feedback_notifications": true, + "opt_in_to_research": null, + "has_run_first_time_setup": false, + "system_role": "Tutor" + } + ``` + + + +### GET: Get user +GET /api/users/{id} + +- URL: `/api/users/{id}` +- Method: `GET` +- Parameters: + | Parameter | Description |Parameter Type| Data Type|Mandatory| + |---------------------|-----------------|------------|------------|---| + |Username | User username | header | string |Yes| + |Auth_Token | Authentication token | header | string |Yes| + |id | | path | integer|Yes| + +- Response: +`201 Created` + +- Example Request: + ```bash + curl -X GET --header 'Accept: application/json' --header 'Username: aadmin' --header 'Auth_Token: vs61XXKdACADRUfQBWzr' 'http://localhost:3000/api/users/39' + ``` +- Response body: + ```json + { + "id": 39, + "student_id": null, + "email": "student_16@doubtfire.com", + "first_name": "Kenny", + "last_name": "Blanda", + "username": "student_16", + "nickname": "student_16", + "receive_task_notifications": true, + "receive_portfolio_notifications": true, + "receive_feedback_notifications": true, + "opt_in_to_research": null, + "has_run_first_time_setup": false, + "system_role": "Student" + } + ``` + +### PUT: Update a user +PUT /api/users/{id} + +- URL: `/api/users/{id}` +- Method: `PUT` +- Parameters: + | Parameter | Description |Parameter Type| Data Type|Mandatory| + |---------------------|-----------------|------------|------------|---| + |id | The user id to update | path | integer |Yes| + |user [first_name] | New first name for user | formData | string || + |user [last_name] | New last name for user | formData | string || + |user [email] | New email address for user | formData | string || + |user [student_id] | New student_id for user | formData | string || + |user [nickname] | New nickname for user | formData | string || + |user [system_role] | New system role for user [Admin, Convenor, Tutor, Student] | formData | string || + |user [receive_task_notifications] | Allow user to be sent task notifications | formData | boolean || + |user [receive_portfolio_notifications] | Allow user to be sent portfolio notifications | formData | boolean || + |user [receive_feedback_notifications] | Allow user to be sent feedback notifications | formData | boolean || + |user [opt_in_to_research] | Allow user to opt in to research conducted by Doubtfire | formData | boolean || + |user [has_run_first_time_setup] | Whether or not user has run first-time setup | formData | boolean || + |Username | User username | header | string |Yes| + |Auth_Token | Authentication token | header | string |Yes| + + +- Response: +`200 OK` + +- Example Request: + ```bash + curl -X PUT --header 'Content-Type: application/x-www-form-urlencoded' --header 'Accept: application/json' --header 'Username: aadmin' --header 'Auth_Token: vs61XXKdACADRUfQBWzr' -d 'user%5Bnickname%5D=ronny&user%5Breceive_task_notifications%5D=true&user%5Breceive_portfolio_notifications%5D=true&user%5Breceive_feedback_notifications%5D=true' 'http://localhost:3000/api/users/43' + ``` +- Response body: + ```json + { + "id": 43, + "student_id": null, + "email": "ron.jackson@dummyemail.com", + "first_name": "Ronny", + "last_name": "Jackson", + "username": "rjack", + "nickname": "ronny", + "receive_task_notifications": true, + "receive_portfolio_notifications": true, + "receive_feedback_notifications": true, + "opt_in_to_research": null, + "has_run_first_time_setup": false, + "system_role": "Tutor" + } + ``` + +### GET: Get the list of tutors +GET /api/users/tutors + +- URL: `/api/users/tutors` +- Method: `GET` +- Parameters: + | Parameter | Description |Parameter Type| Data Type|Mandatory| + |---------------------|-----------------|------------|------------|---| + |Username | User username | header | string |Yes| + |Auth_Token | Authentication token | header | string |Yes| + +- Response: +`200 OK` + +- Example Request: + ```bash + curl -X GET --header 'Accept: application/json' --header 'Username: aadmin' --header 'Auth_Token: vs61XXKdACADRUfQBWzr' 'http://localhost:3000/api/users/tutors' + ``` +- Response body: + ```json + [ + { + "id": 6, + "student_id": null, + "email": "atutor@doubtfire.com", + "first_name": "Akihiro", + "last_name": "Noguchi", + "username": "atutor", + "nickname": "Animations", + "receive_task_notifications": true, + "receive_portfolio_notifications": true, + "receive_feedback_notifications": true, + "opt_in_to_research": null, + "has_run_first_time_setup": false, + "system_role": "Tutor" + }, + { + "id": 8, + "student_id": null, + "email": "cliff@doubtfire.com", + "first_name": "Cliff", + "last_name": "Warren", + "username": "cliff", + "nickname": "Cliff", + "receive_task_notifications": true, + "receive_portfolio_notifications": true, + "receive_feedback_notifications": true, + "opt_in_to_research": null, + "has_run_first_time_setup": false, + "system_role": "Tutor" + }, + { + "id": 9, + "student_id": null, + "email": "joostfunkekupper@doubtfire.com", + "first_name": "Joost", + "last_name": "Funke Kupper", + "username": "joostfunkekupper", + "nickname": "Joe", + "receive_task_notifications": true, + "receive_portfolio_notifications": true, + "receive_feedback_notifications": true, + "opt_in_to_research": null, + "has_run_first_time_setup": false, + "system_role": "Tutor" + }, + { + "id": 10, + "student_id": null, + "email": "angusmorton@doubtfire.com", + "first_name": "Angus", + "last_name": "Morton", + "username": "angusmorton", + "nickname": "Angus", + "receive_task_notifications": true, + "receive_portfolio_notifications": true, + "receive_feedback_notifications": true, + "opt_in_to_research": null, + "has_run_first_time_setup": false, + "system_role": "Tutor" + }, + { + "id": 13, + "student_id": null, + "email": "tutor_0@doubtfire.com", + "first_name": "Karon", + "last_name": "Kutch", + "username": "tutor_0", + "nickname": "tutor_0", + "receive_task_notifications": true, + "receive_portfolio_notifications": true, + "receive_feedback_notifications": true, + "opt_in_to_research": null, + "has_run_first_time_setup": false, + "system_role": "Tutor" + }, + { + "id": 14, + "student_id": null, + "email": "tutor_1@doubtfire.com", + "first_name": "Scottie", + "last_name": "Hermiston", + "username": "tutor_1", + "nickname": "tutor_1", + "receive_task_notifications": true, + "receive_portfolio_notifications": true, + "receive_feedback_notifications": true, + "opt_in_to_research": null, + "has_run_first_time_setup": false, + "system_role": "Tutor" + }, + { + "id": 15, + "student_id": null, + "email": "tutor_2@doubtfire.com", + "first_name": "Porfirio", + "last_name": "Ortiz", + "username": "tutor_2", + "nickname": "tutor_2", + "receive_task_notifications": true, + "receive_portfolio_notifications": true, + "receive_feedback_notifications": true, + "opt_in_to_research": null, + "has_run_first_time_setup": false, + "system_role": "Tutor" + }, + { + "id": 16, + "student_id": null, + "email": "tutor_3@doubtfire.com", + "first_name": "Kayce", + "last_name": "Kassulke", + "username": "tutor_3", + "nickname": "tutor_3", + "receive_task_notifications": true, + "receive_portfolio_notifications": true, + "receive_feedback_notifications": true, + "opt_in_to_research": null, + "has_run_first_time_setup": false, + "system_role": "Tutor" + }, + { + "id": 17, + "student_id": null, + "email": "tutor_4@doubtfire.com", + "first_name": "Kristofer", + "last_name": "Schoen", + "username": "tutor_4", + "nickname": "tutor_4", + "receive_task_notifications": true, + "receive_portfolio_notifications": true, + "receive_feedback_notifications": true, + "opt_in_to_research": null, + "has_run_first_time_setup": false, + "system_role": "Tutor" + }, + { + "id": 18, + "student_id": null, + "email": "tutor_5@doubtfire.com", + "first_name": "Granville", + "last_name": "Howell", + "username": "tutor_5", + "nickname": "tutor_5", + "receive_task_notifications": true, + "receive_portfolio_notifications": true, + "receive_feedback_notifications": true, + "opt_in_to_research": null, + "has_run_first_time_setup": false, + "system_role": "Tutor" + }, + { + "id": 19, + "student_id": null, + "email": "tutor_6@doubtfire.com", + "first_name": "Harry", + "last_name": "O'Hara", + "username": "tutor_6", + "nickname": "tutor_6", + "receive_task_notifications": true, + "receive_portfolio_notifications": true, + "receive_feedback_notifications": true, + "opt_in_to_research": null, + "has_run_first_time_setup": false, + "system_role": "Tutor" + }, + { + "id": 20, + "student_id": null, + "email": "tutor_7@doubtfire.com", + "first_name": "Valorie", + "last_name": "Herzog", + "username": "tutor_7", + "nickname": "tutor_7", + "receive_task_notifications": true, + "receive_portfolio_notifications": true, + "receive_feedback_notifications": true, + "opt_in_to_research": null, + "has_run_first_time_setup": false, + "system_role": "Tutor" + }, + { + "id": 21, + "student_id": null, + "email": "tutor_8@doubtfire.com", + "first_name": "Russel", + "last_name": "McCullough", + "username": "tutor_8", + "nickname": "tutor_8", + "receive_task_notifications": true, + "receive_portfolio_notifications": true, + "receive_feedback_notifications": true, + "opt_in_to_research": null, + "has_run_first_time_setup": false, + "system_role": "Tutor" + }, + { + "id": 22, + "student_id": null, + "email": "tutor_9@doubtfire.com", + "first_name": "Billie", + "last_name": "Pagac", + "username": "tutor_9", + "nickname": "tutor_9", + "receive_task_notifications": true, + "receive_portfolio_notifications": true, + "receive_feedback_notifications": true, + "opt_in_to_research": null, + "has_run_first_time_setup": false, + "system_role": "Tutor" + }, + { + "id": 43, + "student_id": null, + "email": "ron.jackson@dummyemail.com", + "first_name": "Ronny", + "last_name": "Jackson", + "username": "rjack", + "nickname": "ronny", + "receive_task_notifications": true, + "receive_portfolio_notifications": true, + "receive_feedback_notifications": true, + "opt_in_to_research": null, + "has_run_first_time_setup": false, + "system_role": "Tutor" + }, + { + "id": 3, + "student_id": null, + "email": "aconvenor@doubtfire.com", + "first_name": "Clinton", + "last_name": "Woodward", + "username": "aconvenor", + "nickname": "The Giant", + "receive_task_notifications": true, + "receive_portfolio_notifications": true, + "receive_feedback_notifications": true, + "opt_in_to_research": null, + "has_run_first_time_setup": false, + "system_role": "Convenor" + }, + { + "id": 5, + "student_id": null, + "email": "rwilson@doubtfire.com", + "first_name": "Reuben", + "last_name": "Wilson", + "username": "rwilson", + "nickname": "Reubs", + "receive_task_notifications": true, + "receive_portfolio_notifications": true, + "receive_feedback_notifications": true, + "opt_in_to_research": null, + "has_run_first_time_setup": false, + "system_role": "Convenor" + }, + { + "id": 7, + "student_id": null, + "email": "acummaudo@doubtfire.com", + "first_name": "Alex", + "last_name": "Cummaudo", + "username": "acummaudo", + "nickname": "DoubtfireDude", + "receive_task_notifications": true, + "receive_portfolio_notifications": true, + "receive_feedback_notifications": true, + "opt_in_to_research": null, + "has_run_first_time_setup": false, + "system_role": "Convenor" + }, + { + "id": 1, + "student_id": null, + "email": "aadmin@doubtfire.com", + "first_name": "Admin", + "last_name": "Admin", + "username": "aadmin", + "nickname": "Admin", + "receive_task_notifications": true, + "receive_portfolio_notifications": true, + "receive_feedback_notifications": true, + "opt_in_to_research": null, + "has_run_first_time_setup": false, + "system_role": "Admin" + }, + { + "id": 2, + "student_id": null, + "email": "acain@doubtfire.com", + "first_name": "Andrew", + "last_name": "Cain", + "username": "acain", + "nickname": "Macite", + "receive_task_notifications": true, + "receive_portfolio_notifications": true, + "receive_feedback_notifications": true, + "opt_in_to_research": null, + "has_run_first_time_setup": false, + "system_role": "Admin" + }, + { + "id": 4, + "student_id": null, + "email": "ajones@doubtfire.com", + "first_name": "Allan", + "last_name": "Jones", + "username": "ajones", + "nickname": "P-Jiddy", + "receive_task_notifications": true, + "receive_portfolio_notifications": true, + "receive_feedback_notifications": true, + "opt_in_to_research": null, + "has_run_first_time_setup": false, + "system_role": "Admin" + } + ] + ``` + +### GET: Get convenors +GET /api/users/convenors + +- URL: `/api/users/convenors` +- Method: `GET` +- Parameters: + | Parameter | Description |Parameter Type| Data Type|Mandatory| + |---------------------|-----------------|------------|------------|---| + |Username | User username | header | string |Yes| + |Auth_Token | Authentication token | header | string |Yes| + +- Response: +`200 OK` + +- Example Request: + ```bash + curl -X GET --header 'Accept: application/json' --header 'Username: aadmin' --header 'Auth_Token: vs61XXKdACADRUfQBWzr' 'http://localhost:3000/api/users/convenors'ame: aadmin' --header 'Auth_Token: vs61XXKdACADRUfQBWzr' 'http://localhost:3000/api/users/tutors' + ``` +- Response body: + ```json + [ + { + "id": 3, + "student_id": null, + "email": "aconvenor@doubtfire.com", + "first_name": "Clinton", + "last_name": "Woodward", + "username": "aconvenor", + "nickname": "The Giant", + "receive_task_notifications": true, + "receive_portfolio_notifications": true, + "receive_feedback_notifications": true, + "opt_in_to_research": null, + "has_run_first_time_setup": false, + "system_role": "Convenor" + }, + { + "id": 5, + "student_id": null, + "email": "rwilson@doubtfire.com", + "first_name": "Reuben", + "last_name": "Wilson", + "username": "rwilson", + "nickname": "Reubs", + "receive_task_notifications": true, + "receive_portfolio_notifications": true, + "receive_feedback_notifications": true, + "opt_in_to_research": null, + "has_run_first_time_setup": false, + "system_role": "Convenor" + }, + { + "id": 7, + "student_id": null, + "email": "acummaudo@doubtfire.com", + "first_name": "Alex", + "last_name": "Cummaudo", + "username": "acummaudo", + "nickname": "DoubtfireDude", + "receive_task_notifications": true, + "receive_portfolio_notifications": true, + "receive_feedback_notifications": true, + "opt_in_to_research": null, + "has_run_first_time_setup": false, + "system_role": "Convenor" + }, + { + "id": 1, + "student_id": null, + "email": "aadmin@doubtfire.com", + "first_name": "Admin", + "last_name": "Admin", + "username": "aadmin", + "nickname": "Admin", + "receive_task_notifications": true, + "receive_portfolio_notifications": true, + "receive_feedback_notifications": true, + "opt_in_to_research": null, + "has_run_first_time_setup": false, + "system_role": "Admin" + }, + { + "id": 2, + "student_id": null, + "email": "acain@doubtfire.com", + "first_name": "Andrew", + "last_name": "Cain", + "username": "acain", + "nickname": "Macite", + "receive_task_notifications": true, + "receive_portfolio_notifications": true, + "receive_feedback_notifications": true, + "opt_in_to_research": null, + "has_run_first_time_setup": false, + "system_role": "Admin" + }, + { + "id": 4, + "student_id": null, + "email": "ajones@doubtfire.com", + "first_name": "Allan", + "last_name": "Jones", + "username": "ajones", + "nickname": "P-Jiddy", + "receive_task_notifications": true, + "receive_portfolio_notifications": true, + "receive_feedback_notifications": true, + "opt_in_to_research": null, + "has_run_first_time_setup": false, + "system_role": "Admin" + } + ] + ``` \ No newline at end of file diff --git a/src/content/docs/backend/API/webcal.md b/src/content/docs/backend/API/webcal.md new file mode 100644 index 0000000..a567e53 --- /dev/null +++ b/src/content/docs/backend/API/webcal.md @@ -0,0 +1,104 @@ +--- +title: Doubtfire API Documentation +--- + +# API: webcal +webcal : Operations about webcal +This markdown document provides detailed documentation for the "webcal" API endpoints, including their URLs, methods, parameters (if any), responses, and example requests using curl. + +This "webcal" API has the following operations. + +- **GET** /api/webcal/{guid} +- **GET** /api/webcal +- **PUT** /api/webcal + +## Detail of Operations related to webcal. + +### GET: Serve webcal with the specified GUID +GET /api/webcal/{guid} + +- URL: `/api/webcal/{guid}` +- Method: `GET` +- Parameters: + | Parameter | Description |Parameter Type| Data Type|Mandatory| + |---------------------|-----------------|------------|------------|---| + |guid | The GUID of the webcal | header | string |Yes| + + +- Response: +`200 OK` + +- Example Request: + ```bash + curl -X GET --header 'Accept: text/calendar' 'http://localhost:3000/api/webcal/545c2530-2932-4bdb-8d79-ae2992494674' + ``` +- Response body: + ```json + BEGIN:VCALENDAR + VERSION:2.0 + PRODID:OnTrack + CALSCALE:GREGORIAN + METHOD:PUBLISH + X-PUBLISHED-TTL;VALUE=DURATION:P1D + REFRESH-INTERVAL;VALUE=DURATION:P1D + END:VCALENDAR + ``` + +### GET: Get webcal details of the authenticated user +GET /api/webcal + +- URL: `/api/webcal` +- Method: `GET` +- Parameters: + | Parameter | Description |Parameter Type| Data Type|Mandatory| + |---------------------|-----------------|------------|------------|---| + |Username | User username | header | string |Yes| + |Auth_Token | Authentication token | header | string |Yes| + +- Response: +`200 OK` + +- Example Request: + ```bash + curl -X GET --header 'Accept: application/json' --header 'Username: aadmin' --header 'Auth_Token: vs61XXKdACADRUfQBWzr' 'http://localhost:3000/api/webcal' + ``` +- Response body: + ```json + { + "enabled": false + } + ``` + +### PUT: Update webcal details of the authenticated user +PUT /api/webcal + +- URL: `/api/webcal` +- Method: `PUT` +- Parameters: + | Parameter | Description |Parameter Type| Data Type|Mandatory| + |---------------------|-----------------|------------|------------|---| + |webcal[enabled] | Is the webcal enabled? | formData | boolean || + |webcal[should_change_guid] | Should the GUID of the webcal be changed? | formData | boolean || + |webcal[include_start_dates] | Should events for start dates be included? | formData | boolean || + |webcal[unit_exclusions] | IDs of units that must be excluded from the webcal | formData | Array[integer] || + |webcal[reminder][time] | | formData | integer || + |webcal[reminder][unit] | w: weeks, d: days, h: hours, m: minutes | formData | string || + |Username | User username | header | string |Yes| + |Auth_Token | Authentication token | header | string |Yes| +- Response: +`200 OK` + +- Example Request: + ```bash + curl -X PUT --header 'Content-Type: application/x-www-form-urlencoded' --header 'Accept: application/json' --header 'Username: aadmin' --header 'Auth_Token: vs61XXKdACADRUfQBWzr' -d 'webcal%5Benabled%5D=true' 'http://localhost:3000/api/webcal' + ``` +- Response body: + ```json + { + "id": 1, + "guid": "545c2530-2932-4bdb-8d79-ae2992494674", + "include_start_dates": false, + "enabled": true, + "unit_exclusions": [] + } + ``` \ No newline at end of file