Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(Peer Group): Add support for Peer Group activities #111

Merged
merged 37 commits into from
May 13, 2022

Conversation

hirokiterashima
Copy link
Member

@hirokiterashima hirokiterashima commented Mar 17, 2022

DB Changes

(These changes are reflected in wise_db_init.sql)

create table peer_groupings (
    id bigint not null auto_increment,
    runId bigint not null,
    logic text not null,
    logicThresholdCount integer,
    logicThresholdPercent integer,
    maxMembershipCount integer,
    tag varchar(30) not null,
    OPTLOCK integer,
    index peerGroupingsRunIdIndex (runId),
    constraint peerGroupingsRunIdFK foreign key (runId) references runs (id),
    primary key (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

create table peer_groups (
    id bigint not null auto_increment,
    peerGroupingId bigint not null,
    periodId bigint,
    OPTLOCK integer,
    constraint peerGroupingIdFK foreign key (peerGroupingId) references peer_groupings (id),
    primary key (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

create table peer_groups_related_to_workgroups (
    peer_group_fk bigint not null,
    workgroup_fk bigint not null,
    constraint peer_groups_related_to_workgroups_workgroup_fk foreign key (workgroup_fk) references workgroups (id),
    constraint peer_groups_related_to_workgroups_peer_group_fk foreign key (peer_group_fk) references peer_groups (id),
    primary key (peer_group_fk, workgroup_fk)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

alter table studentWork add column peerGroupId bigint;
alter table studentWork add constraint studentWorkPeerGroupIdFK foreign key (peerGroupId) references peer_groups (id);

hirokiterashima and others added 27 commits October 13, 2021 11:48
Requires creating new tables in the database (see wise_db_init.sql).
Domain objects include PeerGroupActivity and PeerGroup.
Add unit tests.
)

- Add PeerGroupActivityService and getByComponent() method to return
PeerGroupActivity for a specific component.

- Add supporting classes (ProjectContent, ProjectNode, ProjectComponent)
to parse the project JSON.

- PeerGroupActivityNotFoundException is thrown if a PeerGroupActivity
for the component cannot be found in the database and curriculum
content.
- Assumes PeerGrouping logic looks at the same nodeId/componentId
- Extracted common hibernate/service test methods to parent.
* feat(Peer Group): Add endpoint to get PeerGroup

- Ensure there are at least 2 submissions before pairing

* feat(Peer Group): Add endpoint to get PeerGroup

- Threshold not met now throws an exception instead of returning null.
- Throws PeerGroupCreationException when there are other workgroups
to wait for.
- Fix issue calculating completion percentage by using float instead
of int.

* feat(Peer Group): Add endpoint to get PeerGroup

- Add id equality test to WorkgroupImpl and PersistentGroup
- Changed getNumWorkgroupsInPeerGroup() to get PeerGroup for activity
component instead of logic component
- Return exception key in ResponseBody
- Also change URL to get PeerGroup to
  /{runId}/{workgroupId}/{nodeId}/{componentId}
* refactor(Peer Group): Move PeerGroupWork api to new class

* feat(Peer Group): Add teacher endpoint to get work for PeerGroup

- Extract common test methods to AbstractPeerGroupAPIControllerTest
- When maxMembershipCount + 1 students have not been pair yet, and
everybody else have completed the logic activity, we put them all
into the same peer group.
- Also updated code to ensure that we only look for workgroups
in the same period when pairing students into PeerGroups.
…vity (#58)

* feat(Peer Group): Add teacher endpoint to get PeerGroups for activity

Requires database change: add periodId bigint field to peer_groups table

Closes #57

* feat(PeerGroup): Add teacher endpoint to get PeerGroup info

- url: /api/teacher/peer-group-info returns a Map of PeerGroups and
workgroups that don't belong in PeerGroups for the specified
PeerGroupActivity

* Remove PeerGroupActivity from PeerGroup serialization #57

* Exclude HibernateStudentAttendaceDao unit test

This test has been known to be finicky, so we decided to exclude from
running until we can find time to look into the root cause.
The other work is the work from a previous component that is shown at the top of the Peer Chat component.

Closes #62
* feat(Group): Add GroupRepository

* feat(PeerGroup): Add teacher endpoint for creating PeerGroup

- Needed to edit APIControllerTest to use the PersistentGroup class type
  now that we are using DomainConverter to directly pass in objects
  instead of Long

* feat(PeerGroup): Add teacher endpoint for creating PeerGroup

- Ensure that requested period is in requested run.
- Modified test's period name to distinguish from other periods
* feat(Group): Add GroupRepository

* feat(PeerGroup): Add teacher endpoint for creating PeerGroup

- Needed to edit APIControllerTest to use the PersistentGroup class type
  now that we are using DomainConverter to directly pass in objects
  instead of Long

* feat(Peer-Chat): Add endpoint to add member to PeerGroup

- Added PeerGroupRepository to convert PeerGroupId PathVariables to
  PeerGroup objects and updated tests to use impl classes.

* feat(Peer-Chat): Add endpoint to add member to PeerGroup

- Don't allow addMember if requested workgroup does not belong in the
  run.

* fix(Test): Fix a test that was not compiling
* feat(Peer Group): Add ability to get manually assigned peer group

If a Peer Activity uses auto assignment and a Peer Group is requested
and the Peer Group does not exist, it will automatically be created.

If a Peer Activity uses manual assignment and a Peer Group is requested
and the Peer Group does not exist, it will not be automatically created.
…ServiceTest

- Renamed PeerGroupServiceHelperTest to PeerGroupServiceTest
* feat(PeerGroup): Add endpoint to get by Tag
* feat(PeerGroup): Create PeerGroupActivity from tag in project

When a peerGroupActivityTag is added in the project in the authoring tool
or if a new run is created from the project that contains the tag,
PeerGroupActivities are created for each tag.
* refactor(PeerGroup): Use PeerGroupActivityTag to get PeerGroup

- Switch to using the new PeerGroupActivityTag to lookup the
PeerGroupActrivity instead of nodeId/componentId.
- Add tag column to db init sql
- Clean up code

* Remove unused exceptions
* feat(PeerChat): Group students randomly

* Improve addMembersRandomly efficiency

Removed randomly chosen members from future consideration.

* Optimize addMembersRandomly method
- Add endpoint at /api/teacher/run/{runId}/work for teachers to POST work
- Add PeerGroupId to StudentWork (requires db update, see below)
- Remove nodeId, componentId fields from PeerGroupActivity
- Set PeerGroupActivity.logic field's default value to [{"name":"manual"}]
- Remove PeerGroupActivityDao.getByComponent()
hirokiterashima and others added 8 commits March 17, 2022 16:43
* refactor(PeerGroupActivityDao): Remove getByComponent()

Layers above should now be using getByTag() to look up the
PeerGroupActivity.

* refactor(PeerGroupActivityImpl): Remove nodeId, componentId fields

Also set logic field's default value to [{"name":"manual"}]

* Remove nodeId/componentId fields from db init sql

* refactor(PeerGroupActivity): Change logic field from JSON array to string (#107)

Instead of expressing the logic entirely in the logic field, use the
logic field to only store a string from the following: "manual",
"random", "custom".

* feat(Peer Group Activity): Move settings to project-level

- Introduce new "peerGroupActivity" project level field, an array to store
PeerGroupActivities in the unit
- This API endpoint has been replaced by getting PeerGroup by Tag
* feat(ACL): Add support for parsing permission string

* feat(Peer Group Settings): Add endpoint to create/edit

* feat(Peer Group Settings): Remove scan for tags on project save

#112

Co-authored-by: Geoffrey Kwan <[email protected]>
- Also remove completion requirement before pairing
- Fix tests
@hirokiterashima hirokiterashima marked this pull request as ready for review May 12, 2022 18:02
@geoffreykwan geoffreykwan merged commit a800bea into develop May 13, 2022
@geoffreykwan geoffreykwan deleted the issue-37-peer-interaction branch May 13, 2022 22:10
@geoffreykwan
Copy link
Member

🎉 This PR is included in version 1.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants