OpenTree-Education / rhizone-lms

A learning management system focused on self-reflection.
https://rhi.zone
BSD 3-Clause Clear License
14 stars 7 forks source link

Users need to have their `participant_activities` pre-filled in order for the new routes to work #488

Closed seidior closed 1 year ago

seidior commented 1 year ago

Details and resources

In order for the new routes (#469) and frontend (#470) to work correctly, we need to pre-fill the participant_activities table with placeholders for the assignments for the active user for each program in the database.

We also need to remove Cohort 5, since its dates are non-final.

This can be accomplished by modifying the existing migration to remove Cohort 5. Then, a new migration can create a stored procedure that we can call from the backend the first time a user loads the calendar. Finally, the backend needs to be adapted to call the stored procedure the first time (and only the first time) the calendar is loaded.

This is not a requirement for this feature to work, and it should be merged after #470 in case it doesn't end up being completed by go-live.

Checklist

phoebehala commented 1 year ago

Those are activities we currently have with 'assignment' type.

INSERT INTO principals () VALUES ();
SET @principalId = LAST_INSERT_ID();

INSERT INTO participant_activities (program_id, activity_id, principal_id, completed) VALUES
  (1, 1, @principalId, 1),
  (1, 83, @principalId, 1),
  (1, 88, @principalId, 1),
  (1, 8, @principalId, 0),
  (1, 48, @principalId, 0),
  (1, 92, @principalId, 0);