backend
backend copied to clipboard
Refactor `submissions_by_grader_for_index` and related functions to use piping
In order to keep styling consistent throughout the backend, piping should be used in the following functions
- [ ]
submissions_by_grader_for_index
- [ ]
build_user_filter
- [ ]
build_assessment_filter
- [ ]
build_assessment_config_filter
- [ ]
build_submission_filter
- [ ]
build_course_registration_filter
As an add on, I feel that it could be possible that after the refactor submissions_by_grader_for_index
's count query can go before the submissions query such that there is less repeated code.
query = big_query_here
count = query |> select([...], count(s.id)) |> Repo.one()
submissions = query |> limit(...) |> offset(...) |> select(...) |> Repo.all()