backend icon indicating copy to clipboard operation
backend copied to clipboard

Refactor `submissions_by_grader_for_index` and related functions to use piping

Open GabrielCWT opened this issue 10 months ago • 1 comments

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

GabrielCWT avatar Apr 06 '24 07:04 GabrielCWT

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()

GabrielCWT avatar Apr 06 '24 07:04 GabrielCWT