-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Create index on assessment ID in submissions table Improves read performance. * Create separate view layer for grading summary * Move views under AdminGradingView * Migrate to more optimised query * Use subquery instead of join for answers * Split main model query and view model generation * Split queries into 3 * Use ORM where possible * Fix typing * Restore group filtering functionality * Update Avenger backlog notification workers Fixes compatibilty with new function signature. * Remove old query * Remove comment
- Loading branch information
1 parent
ee70c48
commit f46a9cd
Showing
7 changed files
with
194 additions
and
112 deletions.
There are no files selected for viewing
This file contains 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 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 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 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
11 changes: 11 additions & 0 deletions
11
priv/repo/migrations/20231105164101_create_submissions_assessment_index.exs
This file contains 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,11 @@ | ||
defmodule Cadet.Repo.Migrations.CreateSubmissionsAssessmentIndex do | ||
use Ecto.Migration | ||
|
||
def up do | ||
create(index(:submissions, [:assessment_id])) | ||
end | ||
|
||
def down do | ||
drop(index(:submissions, [:assessment_id])) | ||
end | ||
end |
This file contains 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 |
---|---|---|
|
@@ -24,10 +24,8 @@ defmodule Cadet.EmailTest do | |
avenger_user = insert(:user, %{email: "[email protected]"}) | ||
avenger = insert(:course_registration, %{user: avenger_user, role: :staff}) | ||
|
||
ungraded_submissions = | ||
Jason.decode!( | ||
elem(Cadet.Assessments.all_submissions_by_grader_for_index(avenger, true, true), 1) | ||
) | ||
{:ok, %{submissions: ungraded_submissions}} = | ||
Cadet.Assessments.all_submissions_by_grader_for_index(avenger, true, true) | ||
|
||
email = Email.avenger_backlog_email("avenger_backlog", avenger_user, ungraded_submissions) | ||
|
||
|
This file contains 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