-
Notifications
You must be signed in to change notification settings - Fork 56
Add Team Assessments #968
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
Merged
RichDom2185
merged 159 commits into
source-academy:master
from
SA-Teams-Assessment:master
Mar 26, 2024
Merged
Add Team Assessments #968
Changes from all commits
Commits
Show all changes
159 commits
Select commit
Hold shift + click to select a range
e3a6fd2
Update assessment schema and add max_team_size as a required field
LuYiting0913 009045e
Update assessment schema and add max_team_size as a required field
LuYiting0913 539dcba
Add max team size to assessment controller payload
LuYiting0913 71ba4fb
Merge branch 'master' into branch-add-team-size
LuYiting0913 0644003
Update mix.exs
LuYiting0913 82fbece
Merge pull request #1 from SA-Teams-Assessment/branch-add-team-size
CheongYeeMing c8f943b
Create migrations for team assessments
CheongYeeMing 83ccac9
Add Team Formation Models
CheongYeeMing 9fd7bef
Fix line endings
LuYiting0913 995c56e
Fix line endings
LuYiting0913 73a4dd1
Merge pull request #2 from SA-Teams-Assessment/branch-fix-git-diff
CheongYeeMing 186350f
Establish connection with Frontend
CheongYeeMing 54f1a48
Generate seeds for team and team_member
LuYiting0913 6a641d2
Fix line endings
LuYiting0913 8e1dfd8
Add API call to retrieve team formation students
CheongYeeMing 5c74db8
Add Validation for Create Team
CheongYeeMing 925cb87
Update response for Create and Delete Team API
CheongYeeMing 1b47bc1
Add Update Teams API call
CheongYeeMing 50744dc
Modify helper function
CheongYeeMing b930226
Update seeds
LuYiting0913 1188171
Modify TeamMember migration
CheongYeeMing 55dc75d
Update AlterSubmissionsTable migration
CheongYeeMing 7252d4d
Add API to retrieve TeamFormationOverview for students
CheongYeeMing 223c686
Add Delete Team
CheongYeeMing 2d35512
Refactor SQL chunk to fetch both Team and Individual submissions
CheongYeeMing f1443a8
Add retrieve Team Submission
CheongYeeMing e1c7da2
Add create empty submission for Team submission
CheongYeeMing e5cb4ae
Add cascade delete answer when Team is deleted
CheongYeeMing 016dc1d
Update XOR validation in Submission
CheongYeeMing 613eebd
Remove bulk_upload API call and doc
CheongYeeMing 71ece24
Add retrieve of team submission answers
CheongYeeMing 83534b4
Add unsubmit for team submission
CheongYeeMing bc8a49d
Add retrieval of team submissions for grading
CheongYeeMing 9c95f15
Add handle team submission notifications
CheongYeeMing 2e9668f
Remove io inspect statement
CheongYeeMing 79de1ff
Remove io inspect statement
CheongYeeMing 7e1bc84
Merge branch 'master' into add-team-formation
CheongYeeMing 4f43c98
Merge branch 'add-team-formation' of https://github.com/SA-Teams-Asse…
CheongYeeMing da2a782
Revert seeds
CheongYeeMing bf9e4db
Revert seeds
CheongYeeMing ac88a43
Merge branch 'add-team-formation' of https://github.com/SA-Teams-Asse…
CheongYeeMing 7f908f6
Revert seeds
CheongYeeMing 5e0b3b4
Merge pull request #3 from SA-Teams-Assessment/add-team-formation
CheongYeeMing 8fcaaa3
Add last_modified_at field for Answer
CheongYeeMing e7dd797
Add Save-Safe
CheongYeeMing 47d446f
Add documentation for models
CheongYeeMing fec3e70
Minor refactoring of Teams
CheongYeeMing e1a20d0
Add Swagger Documentation for AdminTeamsController
CheongYeeMing a811fd7
Write Function Documentation for Teams
CheongYeeMing 0b523c7
Add documentation and minor refactoring
CheongYeeMing 9defe75
Minor changes to existing tests
CheongYeeMing 80b83a5
Cascade delete notification for submission
CheongYeeMing 9d0c1ab
Update error message for team creation
CheongYeeMing 6a957e7
Update assessments Team retrieval
CheongYeeMing 0661252
Add cascading delete for notifications
8f7684c
Resolve merge conflict
4685c76
Fix Team Delete Bug
CheongYeeMing 295254c
Fix save answer bug when no team
CheongYeeMing 1ea3252
Merge pull request #6 from SA-Teams-Assessment/yeeming
CheongYeeMing 12512cb
Raise exception when mass team imports violates constraints
75d25c6
remove test file
LuYiting0913 f7259cd
Merge pull request #7 from SA-Teams-Assessment/yiting
CheongYeeMing 16fd4ff
Fix bug of importing duplicate students through excel
LuYiting0913 1e66007
Refactor default max team size to 1
LuYiting0913 c7c3572
Check size of the team before insertion
81c608b
Fix format
LuYiting0913 9b01cf7
Fix unsubmit handle notifications bug
CheongYeeMing 99a21f3
Merge pull request #9 from SA-Teams-Assessment/yeeming
CheongYeeMing 7953f62
Fix end of line issue
LuYiting0913 ac1ca18
Fix end of line issue
LuYiting0913 3444aca
Fix end of line issue
LuYiting0913 5efddde
Raise exception when some of the students in mass team import are not…
LuYiting0913 408e348
Update docs
LuYiting0913 6454063
Fix Submission Grading Bug
CheongYeeMing faf64bd
Merge pull request #10 from SA-Teams-Assessment/yeeming
CheongYeeMing f83914c
Update docs
LuYiting0913 2d063c9
Fix team deletion bug when there is a submitted assessment
LuYiting0913 dd73093
Send proper error msg to frontend when delete team fails
LuYiting0913 416b82b
Merge conflict
LuYiting0913 eec1f2b
Merge pull request #8 from SA-Teams-Assessment/yiting
LuYiting0913 a9e14a9
Resolve merge conflict from upstream
CheongYeeMing 07685ae
Merge conflict
CheongYeeMing e8be350
Retrieve Team Submission Details
CheongYeeMing dd41360
Fix failed test cases
LuYiting0913 93d68c5
Add test cases
b154ab7
Team Member Factory
CheongYeeMing 4eb59da
add team tests
LuYiting0913 0f1b347
Modify Submission Factory to include Team Submission
CheongYeeMing 58f86af
Write test for Team Members
CheongYeeMing 7c4aa70
Increase COV for Notification Test
CheongYeeMing bd627b5
Prepend unused variable with underscore
CheongYeeMing 30718dc
Answer View Test
CheongYeeMing 2571136
Team View Test
CheongYeeMing b0c0294
Update Admin Teams Controller
CheongYeeMing 4da966e
Admin Teams Controller Test
CheongYeeMing bc26472
Merge pull request #11 from SA-Teams-Assessment/big-merge
CheongYeeMing 893c226
Clean up test cases
LuYiting0913 97f156b
Improve test coverage for teams
LuYiting0913 88a1e2f
Improve test coverage for team controller
LuYiting0913 7284d2f
Improve submission test coverage
LuYiting0913 a011725
Remove unrecheable code
CheongYeeMing 197e7f8
Empty Guardian Test
CheongYeeMing 52f6792
Answer Controller Test
CheongYeeMing b4b9f5a
Notification Test
CheongYeeMing ecc2fe0
improve test coverage for assessments
LuYiting0913 66d605b
Merge branch 'big-merge' of github.com:SA-Teams-Assessment/backend in…
LuYiting0913 230eb86
Improve test coverage for assessments
LuYiting0913 25b6d6c
Clean up test cases
LuYiting0913 d6ca364
Update Swagger Documentation
CheongYeeMing 4bb9a2e
Merge pull request #12 from SA-Teams-Assessment/big-merge
CheongYeeMing 317c621
Modify AddMaxTeamSizeToAssessments migration file
CheongYeeMing 82ff5f1
Remove unused variable in notification test
CheongYeeMing d642ef6
Merge pull request #13 from SA-Teams-Assessment/big-merge
CheongYeeMing 2620c1f
Merge branch 'master' of https://github.com/source-academy/backend in…
RichDom2185 7d31d8f
Fix format
RichDom2185 f64cd76
Fix credo errors
RichDom2185 ef46487
Fix failing tests
RichDom2185 7852338
Remove unused variables
CheongYeeMing a33b1eb
Fix failing tests
CheongYeeMing af335f3
Remove IO.inspect
CheongYeeMing 4219869
Fix dialyzer CI
CheongYeeMing 4fb8b25
Run mix format
CheongYeeMing c6312c4
Fix format
RichDom2185 2f2ebd2
Simplify code
RichDom2185 059cf74
Revert file permission changes
RichDom2185 168a75c
Remove commented code
RichDom2185 b61e9cf
Revert status code changes
RichDom2185 37944c7
Fix tests following status code change revert
RichDom2185 44a020d
Remove redundant conversion
CheongYeeMing 151a367
Add comment to notifications
CheongYeeMing 65d8367
Add validation for max team size
CheongYeeMing fbf3b06
Update assessment changeset testcase
CheongYeeMing d9e0372
Abstract out find teams
CheongYeeMing a775413
Remove repeated code
CheongYeeMing 300dcd2
Abstraction of XOR logic
CheongYeeMing e5bb030
Fix format
RichDom2185 21f672a
Merge branch 'master' of https://github.com/source-academy/backend in…
RichDom2185 ce1c14f
Fix failing tests
CheongYeeMing 4ee4e16
Run format
RichDom2185 f30934b
Merge branch 'master' into master
RichDom2185 0e3d0d9
Merge branch 'master' into master
RichDom2185 08aff07
Merge branch 'master' into master
RichDom2185 65293d5
Merge branch 'master' into master
RichDom2185 bac7906
Merge branch 'master' of https://github.com/source-academy/backend in…
RichDom2185 a992f0a
Fix format
RichDom2185 b308228
Redate migrations
RichDom2185 bded013
Merge branch 'master' of https://github.com/source-academy/backend in…
RichDom2185 a70477c
Fix format post-merge
RichDom2185 a8ce4b0
Merge branch 'master' into master
RichDom2185 a67c794
Merge branch 'master' into master
RichDom2185 c81537c
Merge branch 'master' into master
RichDom2185 14d39da
Remove typo
RichDom2185 71bd6b9
Merge branch 'master' into master
RichDom2185 5c630de
Revert dependency downgrades
RichDom2185 ba480ef
Merge branch 'master' into master
RichDom2185 4bd6544
Revert incorrect merge conflict resolution
YaleChen299 37ab192
Fix tests
RichDom2185 434d6d6
Update status code for not found
RichDom2185 64f5cbc
Fix test for not found status code
RichDom2185 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import Ecto.Query | ||
alias Cadet.Repo | ||
alias Cadet.Accounts.User | ||
alias Cadet.Accounts.{User, Team, TeamMember} | ||
alias Cadet.Assessments.{Answer, Assessment, Question, Submission} | ||
alias Cadet.Courses.Group |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
defmodule Cadet.Accounts.Team do | ||
@moduledoc """ | ||
This module defines the Ecto schema and changeset for teams in the Cadet.Accounts context. | ||
Teams represent groups of students collaborating on an assessment within a course. | ||
""" | ||
|
||
use Cadet, :model | ||
|
||
alias Cadet.Accounts.TeamMember | ||
alias Cadet.Assessments.{Assessment, Submission} | ||
|
||
@doc """ | ||
Ecto schema definition for teams. | ||
This schema represents a group of students collaborating on a specific assessment within a course. | ||
Fields: | ||
- `assessment`: A reference to the assessment associated with the team. | ||
- `submission`: A reference to the team's submission for the assessment. | ||
- `team_members`: A list of team members associated with the team. | ||
""" | ||
schema "teams" do | ||
belongs_to(:assessment, Assessment) | ||
has_one(:submission, Submission, on_delete: :delete_all) | ||
has_many(:team_members, TeamMember, on_delete: :delete_all) | ||
|
||
timestamps() | ||
end | ||
|
||
@required_fields ~w(assessment_id)a | ||
|
||
@doc """ | ||
Builds an Ecto changeset for a team. | ||
This function is used to create or update a team record based on the provided attributes. | ||
Args: | ||
- `team`: The existing team struct. | ||
- `attrs`: The attributes to be cast and validated for the changeset. | ||
Returns: | ||
A changeset struct with cast and validated attributes. | ||
""" | ||
def changeset(team, attrs) do | ||
team | ||
|> cast(attrs, @required_fields) | ||
|> validate_required(@required_fields) | ||
|> foreign_key_constraint(:assessment_id) | ||
end | ||
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
defmodule Cadet.Accounts.TeamMember do | ||
@moduledoc """ | ||
This module defines the Ecto schema and changeset for team members in the Cadet.Accounts context. | ||
Team members represent the association between a student and a team within a course. | ||
""" | ||
|
||
use Ecto.Schema | ||
|
||
import Ecto.Changeset | ||
|
||
alias Cadet.Accounts.{CourseRegistration, Team} | ||
|
||
@doc """ | ||
Ecto schema definition for team members. | ||
This schema represents the relationship between a student and a team within a course. | ||
Fields: | ||
- `student`: A reference to the student's course registration. | ||
- `team`: A reference to the team associated with the student. | ||
""" | ||
schema "team_members" do | ||
belongs_to(:student, CourseRegistration) | ||
belongs_to(:team, Team) | ||
|
||
timestamps() | ||
end | ||
|
||
@required_fields ~w(student_id team_id)a | ||
|
||
@doc """ | ||
Builds an Ecto changeset for a team member. | ||
This function is used to create or update a team member record based on the provided attributes. | ||
Args: | ||
- `team_member`: The existing team member struct. | ||
- `attrs`: The attributes to be cast and validated for the changeset. | ||
Returns: | ||
A changeset struct with cast and validated attributes. | ||
""" | ||
def changeset(team_member, attrs) do | ||
team_member | ||
|> cast(attrs, @required_fields) | ||
|> validate_required(@required_fields) | ||
|> foreign_key_constraint(:team_id) | ||
|> foreign_key_constraint(:student_id) | ||
end | ||
end |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.