Skip to content

Commit

Permalink
Merge branch 'master' into SKIL-group
Browse files Browse the repository at this point in the history
  • Loading branch information
malloc-nbytes committed Jan 9, 2025
2 parents 6c9fcc6 + 303e805 commit 22e3272
Show file tree
Hide file tree
Showing 14 changed files with 1,254 additions and 967 deletions.
12 changes: 10 additions & 2 deletions BackEndFlask/controller/Routes/Completed_assessment_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,15 +235,23 @@ def add_completed_assessment():
@admin_check()
def update_completed_assessment():
try:
assessment_data = request.json
team_id = int(assessment_data["team_id"])
if (team_id == -1):
assessment_data["team_id"] = None
user_id = int(assessment_data["user_id"])
if (user_id == -1):
assessment_data["user_id"] = None

completed_assessment_id = request.args.get("completed_assessment_id")

updated_completed_assessment = None

if(completed_assessment_id):
updated_completed_assessment = replace_completed_assessment(request.json, completed_assessment_id)
updated_completed_assessment = replace_completed_assessment(assessment_data, completed_assessment_id)

else:
updated_completed_assessment = create_completed_assessment(request.json)
updated_completed_assessment = create_completed_assessment(assessment_data)

return create_good_response(completed_assessment_schema.dump(updated_completed_assessment), 201, "completed_assessments")

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
!! Delete this file after Ad Hoc Teams have been integrated into unit.js and CompleteAssessmentTask.js !!

Form.js and it's children have been transitioned to use units rather than reference specific database units. This allows Complete Assessment Task (CAT) data to be handled the same way regardless of the type of unit being handled. The logic for units is contained entirely in "unit.js" through the abstract class `ATUnit` and its children, `IndividualUnit` and `FixedTeamUnit`. These units are created in `generateUnitList()` and their own respective creation functions: `createIndividualUnit` and `createFixedTeamUnit`. An enum `UnitType` is used to help determine the type of a unit.

"CompleteAssessmentTask.js" is in charge of fetching the unit information for all types of units from the backend, and calling `generateUnitList()` with the correct arguments. "unit.js" holds all of the logic for the unit classes and creation.

Here's what we think will need to be changed to update these files for Ad Hoc teams:

"CompleteAssessmentTask.js":
- Update Fetches to include Ad Hoc data
- Pass in new information into `generateUnitList()`

"unit.js":
- Use ad hoc UnitType in enum
- Add new child class of ATUnit for ad hoc units
- Update unit list generation in generateUnitList
- Create new functions to createAdHocUnits
- Likely will need to track ad hoc team members with a CheckinTracker Object from cat_utils.js

Check for any places that assume fixed teams. We removed as many of these as we could find, but we may have missed a couple.
Loading

0 comments on commit 22e3272

Please sign in to comment.