@@ -58,6 +58,21 @@ defmodule CadetWeb.AdminGradingController do
5858 index ( conn , % { "group" => "false" } )
5959 end
6060
61+ @ doc """
62+ # Description
63+ Attains every assessment submission registered, regardless of grading or attempted status.
64+ This is a special call of the general `index` submission whereby pagination is bypassed.
65+ """
66+ def index_all_submissions ( conn , _ ) do
67+ # 100 billion page size here should cover all feasible table rows in 1 page
68+ # given that the hard limit of pages in a postgres database is ~4 billion.
69+ # (https://www.postgresql.org/docs/current/limits.html)
70+ index (
71+ conn ,
72+ % { "group" => "false" , "pageSize" => "100000000000" , "offset" => "0" }
73+ )
74+ end
75+
6176 def show ( conn , % { "submissionid" => submission_id } ) when is_ecto_id ( submission_id ) do
6277 case Assessments . get_answers_in_submission ( submission_id ) do
6378 { :ok , { answers , assessment } } ->
@@ -367,7 +382,9 @@ defmodule CadetWeb.AdminGradingController do
367382 required: true
368383 )
369384
370- student ( Schema . ref ( :StudentInfo ) , "Student who created the submission" , required: true )
385+ student ( Schema . ref ( :StudentInfo ) , "Student who created the submission" ,
386+ required: true
387+ )
371388
372389 unsubmittedBy ( Schema . ref ( :GraderInfo ) )
373390 unsubmittedAt ( :string , "Last unsubmitted at" , format: "date-time" , required: false )
0 commit comments