From a9e691cf89cc4901b4a8b35d4aa41f4fec2fc5de Mon Sep 17 00:00:00 2001 From: Labibatanjim Date: Sat, 23 May 2026 16:40:13 +1000 Subject: [PATCH 1/9] docs: document new query parameters for GET /projects endpoint --- .../backend/API/projects-endpoint-updates.md | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 src/content/docs/backend/API/projects-endpoint-updates.md diff --git a/src/content/docs/backend/API/projects-endpoint-updates.md b/src/content/docs/backend/API/projects-endpoint-updates.md new file mode 100644 index 00000000..e5824815 --- /dev/null +++ b/src/content/docs/backend/API/projects-endpoint-updates.md @@ -0,0 +1,52 @@ +--- +title: Projects Endpoint - New Query Parameters +description: Documents new query parameters added to the GET /projects endpoint +--- + +## Overview + +This document describes the new query parameters introduced to the `GET /projects` +endpoint as part of the cross-unit dashboard feature. + +## Endpoint + +`GET /projects` + +## New Query Parameters + +### `include_task_definitions` + +| Property | Value | +|----------|---------| +| Type | Boolean | +| Required | No | +| Default | false | + +When set to `true`, the response will include task definitions for each +project's unit. Task definitions are exposed inside the `unit` object of +the project response. + +**Example request:** +This was introduced to support the cross-unit dashboard, allowing the +frontend to display task definitions without making additional API calls. +Including task definitions improves response time compared to separate +requests (~200ms vs ~800ms). + +### `include_inactive` + +| Property | Value | +|----------|---------| +| Type | Boolean | +| Required | No | +| Default | false | + +When set to `true`, inactive projects are included in the response +alongside active ones. + +**Example request:** +## Combined Usage + +Both parameters can be used together: +## Related + +- [Pull Request #100 - feature: new endpoint for crossunit team](https://github.com/thoth-tech/doubtfire-api/pull/100) \ No newline at end of file From 66d5f50736810706d40243b78dfb99ad44a6f1f5 Mon Sep 17 00:00:00 2001 From: Labibatanjim Date: Sun, 24 May 2026 01:49:21 +1000 Subject: [PATCH 2/9] docs: add include_task_definitions parameter to GET /api/projects section --- src/content/docs/backend/API/projects_2.md | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/content/docs/backend/API/projects_2.md b/src/content/docs/backend/API/projects_2.md index 6ce580dd..614775b1 100644 --- a/src/content/docs/backend/API/projects_2.md +++ b/src/content/docs/backend/API/projects_2.md @@ -140,18 +140,21 @@ GET /api/projects - URL: `/api/projects` - Method: `GET` -- Parameters: - - | Parameter | Description | Parameter Type | Data Type | Mandatory | - |--------------------|---------------------------------------------------------|----------------|-----------|-----------| - | include_inactive | Include projects for units that are no longer active? | query | boolean | No | - | Username | Username | header | string | Yes | - | Auth_Token | Authentication token | header | string | Yes | +- Parameters: -- Response: `200 OK`. + | Parameter | Description | Parameter Type | Data Type | Mandatory | + |---------------------------|----------------------------------------------------------|----------------|-----------|-----------| + | include_inactive | Include projects for units that are no longer active? | query | boolean | No | + | include_task_definitions | Include task definitions for each project's unit | query | boolean | No | + | Username | Username | header | string | Yes | + | Auth_Token | Authentication token | header | string | Yes | + +- Response: `200 OK`. - Example Request: - ```bash +```bash + curl -X GET --header 'Accept: application/json' --header 'Username: student_1' --header 'Auth_Token: bxzSEr86Qgivu5saj6NQ' 'http://localhost:3000/api/projects?include_inactive=true&include_task_definitions=true' +``` curl -X GET --header 'Accept: application/json' --header 'Username: student_1' --header 'Auth_Token: bxzSEr86Qgivu5saj6NQ' 'http://localhost:3000/api/projects?include_inactive=true' ``` From 838b3678fd0d4602db5edec5790c5e63b1cdd2ea Mon Sep 17 00:00:00 2001 From: Labibatanjim Date: Sun, 24 May 2026 23:12:36 +1000 Subject: [PATCH 3/9] fix: remove duplicate example request and unnecessary file --- .../backend/API/projects-endpoint-updates.md | 52 ------------------- src/content/docs/backend/API/projects_2.md | 5 +- 2 files changed, 1 insertion(+), 56 deletions(-) delete mode 100644 src/content/docs/backend/API/projects-endpoint-updates.md diff --git a/src/content/docs/backend/API/projects-endpoint-updates.md b/src/content/docs/backend/API/projects-endpoint-updates.md deleted file mode 100644 index e5824815..00000000 --- a/src/content/docs/backend/API/projects-endpoint-updates.md +++ /dev/null @@ -1,52 +0,0 @@ ---- -title: Projects Endpoint - New Query Parameters -description: Documents new query parameters added to the GET /projects endpoint ---- - -## Overview - -This document describes the new query parameters introduced to the `GET /projects` -endpoint as part of the cross-unit dashboard feature. - -## Endpoint - -`GET /projects` - -## New Query Parameters - -### `include_task_definitions` - -| Property | Value | -|----------|---------| -| Type | Boolean | -| Required | No | -| Default | false | - -When set to `true`, the response will include task definitions for each -project's unit. Task definitions are exposed inside the `unit` object of -the project response. - -**Example request:** -This was introduced to support the cross-unit dashboard, allowing the -frontend to display task definitions without making additional API calls. -Including task definitions improves response time compared to separate -requests (~200ms vs ~800ms). - -### `include_inactive` - -| Property | Value | -|----------|---------| -| Type | Boolean | -| Required | No | -| Default | false | - -When set to `true`, inactive projects are included in the response -alongside active ones. - -**Example request:** -## Combined Usage - -Both parameters can be used together: -## Related - -- [Pull Request #100 - feature: new endpoint for crossunit team](https://github.com/thoth-tech/doubtfire-api/pull/100) \ No newline at end of file diff --git a/src/content/docs/backend/API/projects_2.md b/src/content/docs/backend/API/projects_2.md index 614775b1..96256d0a 100644 --- a/src/content/docs/backend/API/projects_2.md +++ b/src/content/docs/backend/API/projects_2.md @@ -154,9 +154,6 @@ GET /api/projects - Example Request: ```bash curl -X GET --header 'Accept: application/json' --header 'Username: student_1' --header 'Auth_Token: bxzSEr86Qgivu5saj6NQ' 'http://localhost:3000/api/projects?include_inactive=true&include_task_definitions=true' -``` - curl -X GET --header 'Accept: application/json' --header 'Username: student_1' --header 'Auth_Token: bxzSEr86Qgivu5saj6NQ' 'http://localhost:3000/api/projects?include_inactive=true' - ``` - Response Body: ```json @@ -654,4 +651,4 @@ POST /api/projects/{project_id}/task_def_id/{task_definition_id}/discussion_comm "task_definition_id": 91011 } ``` -------------------------------------------------------------- \ No newline at end of file +------------------------------------------------------------- From c7fa67e2f9af32e59b77fb7ba61fab416a28140b Mon Sep 17 00:00:00 2001 From: Labibatanjim Date: Mon, 25 May 2026 03:34:19 +1000 Subject: [PATCH 4/9] fix: add missing closing backticks after example request --- src/content/docs/backend/API/projects_2.md | 1 + 1 file changed, 1 insertion(+) diff --git a/src/content/docs/backend/API/projects_2.md b/src/content/docs/backend/API/projects_2.md index 96256d0a..306a8217 100644 --- a/src/content/docs/backend/API/projects_2.md +++ b/src/content/docs/backend/API/projects_2.md @@ -155,6 +155,7 @@ GET /api/projects ```bash curl -X GET --header 'Accept: application/json' --header 'Username: student_1' --header 'Auth_Token: bxzSEr86Qgivu5saj6NQ' 'http://localhost:3000/api/projects?include_inactive=true&include_task_definitions=true' +``` - Response Body: ```json [ From df4692cf5a4bb98f2c3727748837f075fd1295bc Mon Sep 17 00:00:00 2001 From: Labibatanjim Date: Mon, 25 May 2026 20:38:08 +1000 Subject: [PATCH 5/9] fix: add task_definitions to response body example --- src/content/docs/backend/API/projects_2.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/content/docs/backend/API/projects_2.md b/src/content/docs/backend/API/projects_2.md index 306a8217..0b94c8bb 100644 --- a/src/content/docs/backend/API/projects_2.md +++ b/src/content/docs/backend/API/projects_2.md @@ -175,6 +175,17 @@ GET /api/projects "target_grade": 3, "portfolio_available": false }, + "task_definitions": [ + { + "id": 1, + "name": "Task 1", + "abbreviation": "T1", + "description": "First task definition", + "target_grade": 2, + "start_date": "2024-03-09", + "target_date": "2024-04-09" + } + ], { "id": 20, "campus_id": 3, From b0d6fd306066dff668648d72b73f1bd4dabf5f5c Mon Sep 17 00:00:00 2001 From: Labibatanjim Date: Wed, 27 May 2026 00:24:32 +1000 Subject: [PATCH 6/9] Fix GET /api/projects response body with full format including task definitions --- src/content/docs/backend/API/projects_2.md | 345 +++++++++++++++------ 1 file changed, 250 insertions(+), 95 deletions(-) diff --git a/src/content/docs/backend/API/projects_2.md b/src/content/docs/backend/API/projects_2.md index 0b94c8bb..440b93b3 100644 --- a/src/content/docs/backend/API/projects_2.md +++ b/src/content/docs/backend/API/projects_2.md @@ -158,108 +158,263 @@ GET /api/projects ``` - Response Body: ```json - [ + [ + { + "id": 1, + "campus_id": 1, + "user_id": 1, + "unit": { + "code": "UNIT1001", + "id": 1, + "name": "Introduction to Programming", + "my_role": "Student", + "start_date": "2026-04-14", + "end_date": "2026-06-30", + "active": true, + "task_definitions": [ { - "id": 2, - "campus_id": 2, - "user_id": 24, - "unit": { - "code": "COS10001", - "id": 1, - "name": "Introduction to Programming", - "my_role": "Student", - "start_date": "2024-03-09", - "end_date": "2024-06-08", - "active": true - }, - "target_grade": 3, - "portfolio_available": false + "id": 1, + "unit_id": 1, + "name": "Task 1.1P", + "description": "First task description", + "weighting": 4, + "target_date": "2026-04-29T10:00:00.000Z", + "created_at": "2026-04-01T06:00:00.000Z", + "updated_at": "2026-04-01T06:00:00.000Z", + "abbreviation": "1.1P", + "upload_requirements": [], + "target_grade": 0, + "restrict_status_updates": false, + "plagiarism_report_url": null, + "plagiarism_updated": false, + "plagiarism_warn_pct": 80, + "group_set_id": null, + "due_date": "2026-04-13T10:00:00.000Z", + "start_date": "2026-04-15T10:00:00.000Z", + "is_graded": false, + "max_quality_pts": 0, + "tutorial_stream_id": null, + "assessment_enabled": false, + "overseer_image_id": null, + "tii_group_id": null, + "similarity_language": "c", + "scorm_enabled": false, + "scorm_allow_review": false, + "scorm_bypass_test": false, + "scorm_time_delay_enabled": false, + "scorm_attempt_limit": 0, + "assess_in_portfolio_only": false, + "use_resources_for_jplag_base_code": false, + "lock_assessments_to_tutorial_stream": false }, - "task_definitions": [ - { - "id": 1, - "name": "Task 1", - "abbreviation": "T1", - "description": "First task definition", - "target_grade": 2, - "start_date": "2024-03-09", - "target_date": "2024-04-09" - } - ], { - "id": 20, - "campus_id": 3, - "user_id": 24, - "unit": { - "code": "COS20007", - "id": 2, - "name": "Object Oriented Programming", - "my_role": "Student", - "start_date": "2024-03-09", - "end_date": "2024-06-08", - "active": true - }, - "target_grade": 1, - "portfolio_available": true - }, + "id": 2, + "unit_id": 1, + "name": "Task 1.2P", + "description": "Second task description", + "weighting": 4, + "target_date": "2026-06-01T00:00:00.000Z", + "created_at": "2026-04-15T05:00:00.000Z", + "updated_at": "2026-04-15T05:00:00.000Z", + "abbreviation": "1.2P", + "upload_requirements": [], + "target_grade": 0, + "restrict_status_updates": false, + "plagiarism_report_url": null, + "plagiarism_updated": false, + "plagiarism_warn_pct": 80, + "group_set_id": null, + "due_date": "2026-05-22T00:00:00.000Z", + "start_date": "2026-04-18T00:00:00.000Z", + "is_graded": false, + "max_quality_pts": 0, + "tutorial_stream_id": null, + "assessment_enabled": false, + "overseer_image_id": null, + "tii_group_id": null, + "similarity_language": "c", + "scorm_enabled": false, + "scorm_allow_review": false, + "scorm_bypass_test": false, + "scorm_time_delay_enabled": false, + "scorm_attempt_limit": 0, + "assess_in_portfolio_only": false, + "use_resources_for_jplag_base_code": false, + "lock_assessments_to_tutorial_stream": false + } + ] + }, + "target_grade": 0, + "spec_con_days": 0, + "portfolio_available": false, + "tasks": [ + { + "id": 1, + "task_definition_id": 1, + "status": "complete", + "due_date": "2026-04-29", + "submission_date": "2026-05-03", + "completion_date": "2026-05-03", + "extensions": 0, + "scorm_extensions": 0, + "times_assessed": 1, + "quality_pts": -1, + "include_in_portfolio": true, + "similarity_flag": false, + "num_new_comments": 0 + }, + { + "id": 2, + "task_definition_id": 2, + "status": "redo", + "due_date": "2026-06-01", + "submission_date": "2026-05-18", + "extensions": 0, + "scorm_extensions": 0, + "times_assessed": 1, + "quality_pts": -1, + "include_in_portfolio": true, + "similarity_flag": false, + "num_new_comments": 2 + } + ], + "escalation_attempts_remaining": 3 + }, + { + "id": 2, + "campus_id": 1, + "user_id": 1, + "unit": { + "code": "UNIT2001", + "id": 2, + "name": "Data Structures and Algorithms", + "my_role": "Student", + "start_date": "2026-03-01", + "end_date": "2026-08-24", + "active": true, + "task_definitions": [ { - "id": 39, - "campus_id": 1, - "user_id": 24, - "unit": { - "code": "COS30046", - "id": 3, - "name": "Artificial Intelligence for Games", - "my_role": "Student", - "start_date": "2024-03-09", - "end_date": "2024-06-08", - "active": true - }, - "target_grade": 0, - "portfolio_available": false - }, + "id": 3, + "unit_id": 2, + "name": "Task 1.1P", + "description": "Task description for unit 2", + "weighting": 4, + "target_date": "2026-06-08T00:00:00.000Z", + "created_at": "2026-03-10T06:00:00.000Z", + "updated_at": "2026-03-10T06:00:00.000Z", + "abbreviation": "1.1P", + "upload_requirements": [], + "target_grade": 0, + "restrict_status_updates": false, + "plagiarism_report_url": null, + "plagiarism_updated": false, + "plagiarism_warn_pct": 80, + "group_set_id": null, + "due_date": "2026-08-24T00:00:00.000Z", + "start_date": "2026-03-10T00:00:00.000Z", + "is_graded": false, + "max_quality_pts": 0, + "tutorial_stream_id": null, + "assessment_enabled": false, + "overseer_image_id": null, + "tii_group_id": null, + "similarity_language": "c", + "scorm_enabled": false, + "scorm_allow_review": false, + "scorm_bypass_test": false, + "scorm_time_delay_enabled": false, + "scorm_attempt_limit": 0, + "assess_in_portfolio_only": false, + "use_resources_for_jplag_base_code": false, + "lock_assessments_to_tutorial_stream": false + } + ] + }, + "target_grade": 0, + "spec_con_days": 0, + "portfolio_available": false, + "tasks": [], + "escalation_attempts_remaining": 3 + }, + { + "id": 3, + "campus_id": 1, + "user_id": 1, + "unit": { + "code": "UNIT3001", + "id": 3, + "name": "Software Testing Fundamentals", + "my_role": "Student", + "start_date": "2026-03-01", + "end_date": "2026-08-24", + "active": false, + "task_definitions": [ { - "id": 51, - "campus_id": 2, - "user_id": 24, - "unit": { - "code": "COS30243", - "id": 4, - "name": "Game Programming", - "my_role": "Student", - "start_date": "2024-03-09", - "end_date": "2024-06-08", - "active": true - }, - "target_grade": 0, - "portfolio_available": false + "id": 4, + "unit_id": 3, + "name": "Task 1.1P", + "description": "Task description for unit 3", + "weighting": 4, + "target_date": "2026-06-08T00:00:00.000Z", + "created_at": "2026-03-12T06:00:00.000Z", + "updated_at": "2026-03-12T06:00:00.000Z", + "abbreviation": "1.1P", + "upload_requirements": [], + "target_grade": 0, + "restrict_status_updates": false, + "plagiarism_report_url": null, + "plagiarism_updated": false, + "plagiarism_warn_pct": 80, + "group_set_id": null, + "due_date": "2026-08-24T00:00:00.000Z", + "start_date": "2026-03-12T00:00:00.000Z", + "is_graded": false, + "max_quality_pts": 0, + "tutorial_stream_id": null, + "assessment_enabled": false, + "overseer_image_id": null, + "tii_group_id": null, + "similarity_language": "c", + "scorm_enabled": false, + "scorm_allow_review": false, + "scorm_bypass_test": false, + "scorm_time_delay_enabled": false, + "scorm_attempt_limit": 0, + "assess_in_portfolio_only": false, + "use_resources_for_jplag_base_code": false, + "lock_assessments_to_tutorial_stream": false } - ] - ``` ------------------------------------------------------------- - -### POST: Enrol a student in a unit, creating them a project -POST /api/projects - -- URL: `/api/projects` -- Method: `POST` -- Parameters: - - | Parameter | Description | Parameter Type | Data Type | Mandatory | - |--------------|------------------------------------|----------------|-----------|-----------| - | unit_id | Unit Id | formData | integer | Yes | - | student_num | Student Number 7 digit code | formData | string | Yes | - | campus_id | Campus this project is part of | formData | integer | Yes | - | Username | 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: K6qnzaWKTQxSGzsUMUJm' -d 'unit_id=4&student_num=student_6&campus_id=1' 'http://localhost:3000/api/projects' + ] + }, + "target_grade": 0, + "spec_con_days": 0, + "portfolio_available": false, + "tasks": [], + "escalation_attempts_remaining": 3 + }, + { + "id": 4, + "campus_id": 1, + "user_id": 1, + "unit": { + "code": "UNIT4001", + "id": 4, + "name": "Database Management Systems", + "my_role": "Student", + "teaching_period_id": 3, + "start_date": "2018-11-05", + "end_date": "2019-02-01", + "active": true, + "task_definitions": [] + }, + "target_grade": 0, + "spec_con_days": 0, + "portfolio_available": false, + "tasks": [], + "escalation_attempts_remaining": 3 + } + ] ``` - - Response Body: ```json { From ab350ebcda33e8d3c2a7892f55037c7ac303af7f Mon Sep 17 00:00:00 2001 From: Labibatanjim Date: Wed, 27 May 2026 00:46:59 +1000 Subject: [PATCH 7/9] Update GET /api/projects response body to Owen's shorter format --- src/content/docs/backend/API/projects_2.md | 162 --------------------- 1 file changed, 162 deletions(-) diff --git a/src/content/docs/backend/API/projects_2.md b/src/content/docs/backend/API/projects_2.md index 440b93b3..a52e3edb 100644 --- a/src/content/docs/backend/API/projects_2.md +++ b/src/content/docs/backend/API/projects_2.md @@ -206,41 +206,6 @@ GET /api/projects "assess_in_portfolio_only": false, "use_resources_for_jplag_base_code": false, "lock_assessments_to_tutorial_stream": false - }, - { - "id": 2, - "unit_id": 1, - "name": "Task 1.2P", - "description": "Second task description", - "weighting": 4, - "target_date": "2026-06-01T00:00:00.000Z", - "created_at": "2026-04-15T05:00:00.000Z", - "updated_at": "2026-04-15T05:00:00.000Z", - "abbreviation": "1.2P", - "upload_requirements": [], - "target_grade": 0, - "restrict_status_updates": false, - "plagiarism_report_url": null, - "plagiarism_updated": false, - "plagiarism_warn_pct": 80, - "group_set_id": null, - "due_date": "2026-05-22T00:00:00.000Z", - "start_date": "2026-04-18T00:00:00.000Z", - "is_graded": false, - "max_quality_pts": 0, - "tutorial_stream_id": null, - "assessment_enabled": false, - "overseer_image_id": null, - "tii_group_id": null, - "similarity_language": "c", - "scorm_enabled": false, - "scorm_allow_review": false, - "scorm_bypass_test": false, - "scorm_time_delay_enabled": false, - "scorm_attempt_limit": 0, - "assess_in_portfolio_only": false, - "use_resources_for_jplag_base_code": false, - "lock_assessments_to_tutorial_stream": false } ] }, @@ -262,20 +227,6 @@ GET /api/projects "include_in_portfolio": true, "similarity_flag": false, "num_new_comments": 0 - }, - { - "id": 2, - "task_definition_id": 2, - "status": "redo", - "due_date": "2026-06-01", - "submission_date": "2026-05-18", - "extensions": 0, - "scorm_extensions": 0, - "times_assessed": 1, - "quality_pts": -1, - "include_in_portfolio": true, - "similarity_flag": false, - "num_new_comments": 2 } ], "escalation_attempts_remaining": 3 @@ -292,119 +243,6 @@ GET /api/projects "start_date": "2026-03-01", "end_date": "2026-08-24", "active": true, - "task_definitions": [ - { - "id": 3, - "unit_id": 2, - "name": "Task 1.1P", - "description": "Task description for unit 2", - "weighting": 4, - "target_date": "2026-06-08T00:00:00.000Z", - "created_at": "2026-03-10T06:00:00.000Z", - "updated_at": "2026-03-10T06:00:00.000Z", - "abbreviation": "1.1P", - "upload_requirements": [], - "target_grade": 0, - "restrict_status_updates": false, - "plagiarism_report_url": null, - "plagiarism_updated": false, - "plagiarism_warn_pct": 80, - "group_set_id": null, - "due_date": "2026-08-24T00:00:00.000Z", - "start_date": "2026-03-10T00:00:00.000Z", - "is_graded": false, - "max_quality_pts": 0, - "tutorial_stream_id": null, - "assessment_enabled": false, - "overseer_image_id": null, - "tii_group_id": null, - "similarity_language": "c", - "scorm_enabled": false, - "scorm_allow_review": false, - "scorm_bypass_test": false, - "scorm_time_delay_enabled": false, - "scorm_attempt_limit": 0, - "assess_in_portfolio_only": false, - "use_resources_for_jplag_base_code": false, - "lock_assessments_to_tutorial_stream": false - } - ] - }, - "target_grade": 0, - "spec_con_days": 0, - "portfolio_available": false, - "tasks": [], - "escalation_attempts_remaining": 3 - }, - { - "id": 3, - "campus_id": 1, - "user_id": 1, - "unit": { - "code": "UNIT3001", - "id": 3, - "name": "Software Testing Fundamentals", - "my_role": "Student", - "start_date": "2026-03-01", - "end_date": "2026-08-24", - "active": false, - "task_definitions": [ - { - "id": 4, - "unit_id": 3, - "name": "Task 1.1P", - "description": "Task description for unit 3", - "weighting": 4, - "target_date": "2026-06-08T00:00:00.000Z", - "created_at": "2026-03-12T06:00:00.000Z", - "updated_at": "2026-03-12T06:00:00.000Z", - "abbreviation": "1.1P", - "upload_requirements": [], - "target_grade": 0, - "restrict_status_updates": false, - "plagiarism_report_url": null, - "plagiarism_updated": false, - "plagiarism_warn_pct": 80, - "group_set_id": null, - "due_date": "2026-08-24T00:00:00.000Z", - "start_date": "2026-03-12T00:00:00.000Z", - "is_graded": false, - "max_quality_pts": 0, - "tutorial_stream_id": null, - "assessment_enabled": false, - "overseer_image_id": null, - "tii_group_id": null, - "similarity_language": "c", - "scorm_enabled": false, - "scorm_allow_review": false, - "scorm_bypass_test": false, - "scorm_time_delay_enabled": false, - "scorm_attempt_limit": 0, - "assess_in_portfolio_only": false, - "use_resources_for_jplag_base_code": false, - "lock_assessments_to_tutorial_stream": false - } - ] - }, - "target_grade": 0, - "spec_con_days": 0, - "portfolio_available": false, - "tasks": [], - "escalation_attempts_remaining": 3 - }, - { - "id": 4, - "campus_id": 1, - "user_id": 1, - "unit": { - "code": "UNIT4001", - "id": 4, - "name": "Database Management Systems", - "my_role": "Student", - "teaching_period_id": 3, - "start_date": "2018-11-05", - "end_date": "2019-02-01", - "active": true, "task_definitions": [] }, "target_grade": 0, From 901f27abfd8d687ace901d0a438c46bf54b3621f Mon Sep 17 00:00:00 2001 From: Labibatanjim Date: Wed, 27 May 2026 01:52:23 +1000 Subject: [PATCH 8/9] Restore POST /api/projects endpoint header --- src/content/docs/backend/API/projects_2.md | 187 ++++++++++++++++++++- 1 file changed, 186 insertions(+), 1 deletion(-) diff --git a/src/content/docs/backend/API/projects_2.md b/src/content/docs/backend/API/projects_2.md index a52e3edb..90d12c6b 100644 --- a/src/content/docs/backend/API/projects_2.md +++ b/src/content/docs/backend/API/projects_2.md @@ -206,6 +206,41 @@ GET /api/projects "assess_in_portfolio_only": false, "use_resources_for_jplag_base_code": false, "lock_assessments_to_tutorial_stream": false + }, + { + "id": 2, + "unit_id": 1, + "name": "Task 1.2P", + "description": "Second task description", + "weighting": 4, + "target_date": "2026-06-01T00:00:00.000Z", + "created_at": "2026-04-15T05:00:00.000Z", + "updated_at": "2026-04-15T05:00:00.000Z", + "abbreviation": "1.2P", + "upload_requirements": [], + "target_grade": 0, + "restrict_status_updates": false, + "plagiarism_report_url": null, + "plagiarism_updated": false, + "plagiarism_warn_pct": 80, + "group_set_id": null, + "due_date": "2026-05-22T00:00:00.000Z", + "start_date": "2026-04-18T00:00:00.000Z", + "is_graded": false, + "max_quality_pts": 0, + "tutorial_stream_id": null, + "assessment_enabled": false, + "overseer_image_id": null, + "tii_group_id": null, + "similarity_language": "c", + "scorm_enabled": false, + "scorm_allow_review": false, + "scorm_bypass_test": false, + "scorm_time_delay_enabled": false, + "scorm_attempt_limit": 0, + "assess_in_portfolio_only": false, + "use_resources_for_jplag_base_code": false, + "lock_assessments_to_tutorial_stream": false } ] }, @@ -227,6 +262,20 @@ GET /api/projects "include_in_portfolio": true, "similarity_flag": false, "num_new_comments": 0 + }, + { + "id": 2, + "task_definition_id": 2, + "status": "redo", + "due_date": "2026-06-01", + "submission_date": "2026-05-18", + "extensions": 0, + "scorm_extensions": 0, + "times_assessed": 1, + "quality_pts": -1, + "include_in_portfolio": true, + "similarity_flag": false, + "num_new_comments": 2 } ], "escalation_attempts_remaining": 3 @@ -243,6 +292,119 @@ GET /api/projects "start_date": "2026-03-01", "end_date": "2026-08-24", "active": true, + "task_definitions": [ + { + "id": 3, + "unit_id": 2, + "name": "Task 1.1P", + "description": "Task description for unit 2", + "weighting": 4, + "target_date": "2026-06-08T00:00:00.000Z", + "created_at": "2026-03-10T06:00:00.000Z", + "updated_at": "2026-03-10T06:00:00.000Z", + "abbreviation": "1.1P", + "upload_requirements": [], + "target_grade": 0, + "restrict_status_updates": false, + "plagiarism_report_url": null, + "plagiarism_updated": false, + "plagiarism_warn_pct": 80, + "group_set_id": null, + "due_date": "2026-08-24T00:00:00.000Z", + "start_date": "2026-03-10T00:00:00.000Z", + "is_graded": false, + "max_quality_pts": 0, + "tutorial_stream_id": null, + "assessment_enabled": false, + "overseer_image_id": null, + "tii_group_id": null, + "similarity_language": "c", + "scorm_enabled": false, + "scorm_allow_review": false, + "scorm_bypass_test": false, + "scorm_time_delay_enabled": false, + "scorm_attempt_limit": 0, + "assess_in_portfolio_only": false, + "use_resources_for_jplag_base_code": false, + "lock_assessments_to_tutorial_stream": false + } + ] + }, + "target_grade": 0, + "spec_con_days": 0, + "portfolio_available": false, + "tasks": [], + "escalation_attempts_remaining": 3 + }, + { + "id": 3, + "campus_id": 1, + "user_id": 1, + "unit": { + "code": "UNIT3001", + "id": 3, + "name": "Software Testing Fundamentals", + "my_role": "Student", + "start_date": "2026-03-01", + "end_date": "2026-08-24", + "active": false, + "task_definitions": [ + { + "id": 4, + "unit_id": 3, + "name": "Task 1.1P", + "description": "Task description for unit 3", + "weighting": 4, + "target_date": "2026-06-08T00:00:00.000Z", + "created_at": "2026-03-12T06:00:00.000Z", + "updated_at": "2026-03-12T06:00:00.000Z", + "abbreviation": "1.1P", + "upload_requirements": [], + "target_grade": 0, + "restrict_status_updates": false, + "plagiarism_report_url": null, + "plagiarism_updated": false, + "plagiarism_warn_pct": 80, + "group_set_id": null, + "due_date": "2026-08-24T00:00:00.000Z", + "start_date": "2026-03-12T00:00:00.000Z", + "is_graded": false, + "max_quality_pts": 0, + "tutorial_stream_id": null, + "assessment_enabled": false, + "overseer_image_id": null, + "tii_group_id": null, + "similarity_language": "c", + "scorm_enabled": false, + "scorm_allow_review": false, + "scorm_bypass_test": false, + "scorm_time_delay_enabled": false, + "scorm_attempt_limit": 0, + "assess_in_portfolio_only": false, + "use_resources_for_jplag_base_code": false, + "lock_assessments_to_tutorial_stream": false + } + ] + }, + "target_grade": 0, + "spec_con_days": 0, + "portfolio_available": false, + "tasks": [], + "escalation_attempts_remaining": 3 + }, + { + "id": 4, + "campus_id": 1, + "user_id": 1, + "unit": { + "code": "UNIT4001", + "id": 4, + "name": "Database Management Systems", + "my_role": "Student", + "teaching_period_id": 3, + "start_date": "2018-11-05", + "end_date": "2019-02-01", + "active": true, "task_definitions": [] }, "target_grade": 0, @@ -253,6 +415,29 @@ GET /api/projects } ] ``` + ------------------------------------------------------------ + + +### POST: Enrol a student in a unit, creating them a project +POST /api/projects + +- URL: `/api/projects` +- Method: `POST` +- Parameters: + | Parameter | Description | Parameter Type | Data Type | Mandatory | + |--------------|------------------------------------|----------------|-----------|-----------| + | unit_id | Unit Id | formData | integer | Yes | + | student_num | Student Number 7 digit code | formData | string | Yes | + | campus_id | Campus this project is part of | formData | integer | Yes | + | Username | 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: K6qnzaWKTQxSGzsUMUJm' -d 'unit_id=4&student_num=student_6&campus_id=1' 'http://localhost:3000/api/projects' +``` - Response Body: ```json { @@ -656,4 +841,4 @@ POST /api/projects/{project_id}/task_def_id/{task_definition_id}/discussion_comm "task_definition_id": 91011 } ``` -------------------------------------------------------------- +------------------------------------------------------------- \ No newline at end of file From de5fe23047a3a3b82eb2c64916514ba3f15473b3 Mon Sep 17 00:00:00 2001 From: Labibatanjim Date: Wed, 27 May 2026 02:25:32 +1000 Subject: [PATCH 9/9] Restore POST /api/projects endpoint header --- src/content/docs/backend/API/projects_2.md | 344 ++++++--------------- 1 file changed, 91 insertions(+), 253 deletions(-) diff --git a/src/content/docs/backend/API/projects_2.md b/src/content/docs/backend/API/projects_2.md index 90d12c6b..b4fe5608 100644 --- a/src/content/docs/backend/API/projects_2.md +++ b/src/content/docs/backend/API/projects_2.md @@ -152,267 +152,105 @@ GET /api/projects - Response: `200 OK`. - Example Request: -```bash + ```bash curl -X GET --header 'Accept: application/json' --header 'Username: student_1' --header 'Auth_Token: bxzSEr86Qgivu5saj6NQ' 'http://localhost:3000/api/projects?include_inactive=true&include_task_definitions=true' -``` + ``` - Response Body: ```json [ - { - "id": 1, - "campus_id": 1, - "user_id": 1, - "unit": { - "code": "UNIT1001", + { + "id": 1, + "campus_id": 1, + "user_id": 1, + "unit": { + "code": "UNIT1001", + "id": 1, + "name": "Introduction to Programming", + "my_role": "Student", + "start_date": "2026-04-14", + "end_date": "2026-06-30", + "active": true, + "task_definitions": [ + { "id": 1, - "name": "Introduction to Programming", - "my_role": "Student", - "start_date": "2026-04-14", - "end_date": "2026-06-30", - "active": true, - "task_definitions": [ - { - "id": 1, - "unit_id": 1, - "name": "Task 1.1P", - "description": "First task description", - "weighting": 4, - "target_date": "2026-04-29T10:00:00.000Z", - "created_at": "2026-04-01T06:00:00.000Z", - "updated_at": "2026-04-01T06:00:00.000Z", - "abbreviation": "1.1P", - "upload_requirements": [], - "target_grade": 0, - "restrict_status_updates": false, - "plagiarism_report_url": null, - "plagiarism_updated": false, - "plagiarism_warn_pct": 80, - "group_set_id": null, - "due_date": "2026-04-13T10:00:00.000Z", - "start_date": "2026-04-15T10:00:00.000Z", - "is_graded": false, - "max_quality_pts": 0, - "tutorial_stream_id": null, - "assessment_enabled": false, - "overseer_image_id": null, - "tii_group_id": null, - "similarity_language": "c", - "scorm_enabled": false, - "scorm_allow_review": false, - "scorm_bypass_test": false, - "scorm_time_delay_enabled": false, - "scorm_attempt_limit": 0, - "assess_in_portfolio_only": false, - "use_resources_for_jplag_base_code": false, - "lock_assessments_to_tutorial_stream": false - }, - { - "id": 2, - "unit_id": 1, - "name": "Task 1.2P", - "description": "Second task description", - "weighting": 4, - "target_date": "2026-06-01T00:00:00.000Z", - "created_at": "2026-04-15T05:00:00.000Z", - "updated_at": "2026-04-15T05:00:00.000Z", - "abbreviation": "1.2P", - "upload_requirements": [], - "target_grade": 0, - "restrict_status_updates": false, - "plagiarism_report_url": null, - "plagiarism_updated": false, - "plagiarism_warn_pct": 80, - "group_set_id": null, - "due_date": "2026-05-22T00:00:00.000Z", - "start_date": "2026-04-18T00:00:00.000Z", - "is_graded": false, - "max_quality_pts": 0, - "tutorial_stream_id": null, - "assessment_enabled": false, - "overseer_image_id": null, - "tii_group_id": null, - "similarity_language": "c", - "scorm_enabled": false, - "scorm_allow_review": false, - "scorm_bypass_test": false, - "scorm_time_delay_enabled": false, - "scorm_attempt_limit": 0, - "assess_in_portfolio_only": false, - "use_resources_for_jplag_base_code": false, - "lock_assessments_to_tutorial_stream": false - } - ] - }, - "target_grade": 0, - "spec_con_days": 0, - "portfolio_available": false, - "tasks": [ - { - "id": 1, - "task_definition_id": 1, - "status": "complete", - "due_date": "2026-04-29", - "submission_date": "2026-05-03", - "completion_date": "2026-05-03", - "extensions": 0, - "scorm_extensions": 0, - "times_assessed": 1, - "quality_pts": -1, - "include_in_portfolio": true, - "similarity_flag": false, - "num_new_comments": 0 - }, - { - "id": 2, - "task_definition_id": 2, - "status": "redo", - "due_date": "2026-06-01", - "submission_date": "2026-05-18", - "extensions": 0, - "scorm_extensions": 0, - "times_assessed": 1, - "quality_pts": -1, - "include_in_portfolio": true, - "similarity_flag": false, - "num_new_comments": 2 - } - ], - "escalation_attempts_remaining": 3 - }, - { - "id": 2, - "campus_id": 1, - "user_id": 1, - "unit": { - "code": "UNIT2001", - "id": 2, - "name": "Data Structures and Algorithms", - "my_role": "Student", - "start_date": "2026-03-01", - "end_date": "2026-08-24", - "active": true, - "task_definitions": [ - { - "id": 3, - "unit_id": 2, - "name": "Task 1.1P", - "description": "Task description for unit 2", - "weighting": 4, - "target_date": "2026-06-08T00:00:00.000Z", - "created_at": "2026-03-10T06:00:00.000Z", - "updated_at": "2026-03-10T06:00:00.000Z", - "abbreviation": "1.1P", - "upload_requirements": [], - "target_grade": 0, - "restrict_status_updates": false, - "plagiarism_report_url": null, - "plagiarism_updated": false, - "plagiarism_warn_pct": 80, - "group_set_id": null, - "due_date": "2026-08-24T00:00:00.000Z", - "start_date": "2026-03-10T00:00:00.000Z", - "is_graded": false, - "max_quality_pts": 0, - "tutorial_stream_id": null, - "assessment_enabled": false, - "overseer_image_id": null, - "tii_group_id": null, - "similarity_language": "c", - "scorm_enabled": false, - "scorm_allow_review": false, - "scorm_bypass_test": false, - "scorm_time_delay_enabled": false, - "scorm_attempt_limit": 0, - "assess_in_portfolio_only": false, - "use_resources_for_jplag_base_code": false, - "lock_assessments_to_tutorial_stream": false - } - ] - }, - "target_grade": 0, - "spec_con_days": 0, - "portfolio_available": false, - "tasks": [], - "escalation_attempts_remaining": 3 - }, - { - "id": 3, - "campus_id": 1, - "user_id": 1, - "unit": { - "code": "UNIT3001", - "id": 3, - "name": "Software Testing Fundamentals", - "my_role": "Student", - "start_date": "2026-03-01", - "end_date": "2026-08-24", - "active": false, - "task_definitions": [ - { - "id": 4, - "unit_id": 3, - "name": "Task 1.1P", - "description": "Task description for unit 3", - "weighting": 4, - "target_date": "2026-06-08T00:00:00.000Z", - "created_at": "2026-03-12T06:00:00.000Z", - "updated_at": "2026-03-12T06:00:00.000Z", - "abbreviation": "1.1P", - "upload_requirements": [], - "target_grade": 0, - "restrict_status_updates": false, - "plagiarism_report_url": null, - "plagiarism_updated": false, - "plagiarism_warn_pct": 80, - "group_set_id": null, - "due_date": "2026-08-24T00:00:00.000Z", - "start_date": "2026-03-12T00:00:00.000Z", - "is_graded": false, - "max_quality_pts": 0, - "tutorial_stream_id": null, - "assessment_enabled": false, - "overseer_image_id": null, - "tii_group_id": null, - "similarity_language": "c", - "scorm_enabled": false, - "scorm_allow_review": false, - "scorm_bypass_test": false, - "scorm_time_delay_enabled": false, - "scorm_attempt_limit": 0, - "assess_in_portfolio_only": false, - "use_resources_for_jplag_base_code": false, - "lock_assessments_to_tutorial_stream": false - } - ] - }, - "target_grade": 0, - "spec_con_days": 0, - "portfolio_available": false, - "tasks": [], - "escalation_attempts_remaining": 3 - }, + "unit_id": 1, + "name": "Task 1.1P", + "description": "First task description", + "weighting": 4, + "target_date": "2026-04-29T10:00:00.000Z", + "created_at": "2026-04-01T06:00:00.000Z", + "updated_at": "2026-04-01T06:00:00.000Z", + "abbreviation": "1.1P", + "upload_requirements": [], + "target_grade": 0, + "restrict_status_updates": false, + "plagiarism_report_url": null, + "plagiarism_updated": false, + "plagiarism_warn_pct": 80, + "group_set_id": null, + "due_date": "2026-04-13T10:00:00.000Z", + "start_date": "2026-04-15T10:00:00.000Z", + "is_graded": false, + "max_quality_pts": 0, + "tutorial_stream_id": null, + "assessment_enabled": false, + "overseer_image_id": null, + "tii_group_id": null, + "similarity_language": "c", + "scorm_enabled": false, + "scorm_allow_review": false, + "scorm_bypass_test": false, + "scorm_time_delay_enabled": false, + "scorm_attempt_limit": 0, + "assess_in_portfolio_only": false, + "use_resources_for_jplag_base_code": false, + "lock_assessments_to_tutorial_stream": false + } + ] + }, + "target_grade": 0, + "spec_con_days": 0, + "portfolio_available": false, + "tasks": [ { - "id": 4, - "campus_id": 1, - "user_id": 1, - "unit": { - "code": "UNIT4001", - "id": 4, - "name": "Database Management Systems", - "my_role": "Student", - "teaching_period_id": 3, - "start_date": "2018-11-05", - "end_date": "2019-02-01", - "active": true, - "task_definitions": [] - }, - "target_grade": 0, - "spec_con_days": 0, - "portfolio_available": false, - "tasks": [], - "escalation_attempts_remaining": 3 + "id": 1, + "task_definition_id": 1, + "status": "complete", + "due_date": "2026-04-29", + "submission_date": "2026-05-03", + "completion_date": "2026-05-03", + "extensions": 0, + "scorm_extensions": 0, + "times_assessed": 1, + "quality_pts": -1, + "include_in_portfolio": true, + "similarity_flag": false, + "num_new_comments": 0 } + ], + "escalation_attempts_remaining": 3 + }, + { + "id": 2, + "campus_id": 1, + "user_id": 1, + "unit": { + "code": "UNIT2001", + "id": 2, + "name": "Data Structures and Algorithms", + "my_role": "Student", + "start_date": "2026-03-01", + "end_date": "2026-08-24", + "active": true, + "task_definitions": [] + }, + "target_grade": 0, + "spec_con_days": 0, + "portfolio_available": false, + "tasks": [], + "escalation_attempts_remaining": 3 + } ] ``` ------------------------------------------------------------