hypothesis / lms

LTI app for integrating with learning management systems
BSD 2-Clause "Simplified" License
46 stars 14 forks source link

Store group set information in the new LMSGroupSet table #6837

Closed marcospri closed 3 weeks ago

marcospri commented 3 weeks ago

For:

We currently only store group sets as a json array in "Grouping.extra". This is awkward to query and impossible to relate to other tables.

After creating LMS GroupSet we'll start recording groups sets in both tables in parallel.

Testing

For example:

https://hypothesis.instructure.com/courses/125/assignments/7412/edit?name=Assignment%20creation%20-%20test%20&due_at=&points_possible=0

Groups sets in the old location

select extra->'group_sets' from grouping where type = 'course' and extra->'group_sets' is not null;
                                                                                                    ?column?                                                                                                     
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 [{"id": "121", "name": "Test group set"}, {"id": "122", "name": "Empty group set"}, {"id": "125", "name": "PoC"}, {"id": "129", "name": "Group Set with No Students in It"}, {"id": "389", "name": "everyone"}]

Groups sets in the new location

select * from lms_group_set;
 id | lms_id |               name               | lms_course_id |         created          |         updated          
----+--------+----------------------------------+---------------+--------------------------+--------------------------
  6 | 121    | Test group set                   |           105 | 2024-11-04 13:28:48.4531 | 2024-11-04 13:28:48.4531
  7 | 122    | Empty group set                  |           105 | 2024-11-04 13:28:48.4531 | 2024-11-04 13:28:48.4531
  8 | 125    | PoC                              |           105 | 2024-11-04 13:28:48.4531 | 2024-11-04 13:28:48.4531
  9 | 129    | Group Set with No Students in It |           105 | 2024-11-04 13:28:48.4531 | 2024-11-04 13:28:48.4531
 10 | 389    | everyone                         |           105 | 2024-11-04 13:28:48.4531 | 2024-11-04 13:28:48.4531
(5 rows)