Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create endpoint for retrieval of all assessment submissions #1210

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haha sure, maybe in the future we can filter by assessment name (it's a use case for the PA because we export the grades to Canvas separately).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh yes, that would be a good future change to generalize the export function!

"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
Loading