Skip to content

Commit

Permalink
Improve documentation for units.js
Browse files Browse the repository at this point in the history
  • Loading branch information
jcallison1 committed Dec 21, 2024
1 parent 38a3d17 commit 0ece360
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
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.
11 changes: 11 additions & 0 deletions FrontEndReact/src/View/Admin/View/CompleteAssessmentTask/unit.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,17 @@ export const UnitType = Object.freeze({
// ROCS Data - An object that stores information about how an assessment task has been completed.
// This includes things like what checkboxes have been clicked and comments. This object
// also includes information about the rubric it's based on.
//
// Structure:
// A map of rubric category names to category objects.
// Category objects:
// - comments: string - The comments for this category.
// - description: string - The description of this rubric category. This is the same as the description in the rubric itself.
// - observable_characteristics: string of 1s and 0s - Each 1 or 0 in the string represents if that checkbox is checked for Observable Characteristics.
// - suggestions: string of 1s and 0s - Has the same meaning as observable_characteristics except for Suggestions.
// - rating: integer - The rating for the category.
// - rating_json: map from tick mark position to tick mark name - Used for the tick mark names on the Ratings slider.
// This map also may contain "comments" and "done" entries. These are unused and a legacy artifact.
//
// Completed Assessment Task (CAT) - An object fetched by the completedAssessments route that
// associates ROCS data and whether the AT is done or not with a user/team.
Expand Down

0 comments on commit 0ece360

Please sign in to comment.