Skip to content

Commit

Permalink
Create endpoint for retrieval of all assessment submissions (#1210)
Browse files Browse the repository at this point in the history
* Add endpoint

* Shorten comments

* Formatting

* Formatting (again)

* Revert seed change

---------

Co-authored-by: Richard Dominick <34370238+RichDom2185@users.noreply.github.com>
  • Loading branch information
josh1248 and RichDom2185 authored Nov 16, 2024
1 parent 5203125 commit b406ab0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/cadet_web/admin_controllers/admin_grading_controller.ex
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,17 @@ defmodule CadetWeb.AdminGradingController do
index(conn, %{"group" => "false"})
end

def index_all_submissions(conn, _) do
index(
conn,
%{
"group" => "false",
"pageSize" => "100000000000",
"offset" => "0"
}
)
end

def show(conn, %{"submissionid" => submission_id}) when is_ecto_id(submission_id) do
case Assessments.get_answers_in_submission(submission_id) do
{:ok, {answers, assessment}} ->
Expand Down
2 changes: 2 additions & 0 deletions lib/cadet_web/router.ex
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ defmodule CadetWeb.Router do
post("/assessments/:assessmentid", AdminAssessmentsController, :update)
delete("/assessments/:assessmentid", AdminAssessmentsController, :delete)

get("/grading/all_submissions", AdminGradingController, :index_all_submissions)

post(
"/grading/:assessmentid/publish_all_grades",
AdminGradingController,
Expand Down

0 comments on commit b406ab0

Please sign in to comment.