Skip to content

Create endpoint for retrieval of all assessment submissions #1210

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

Merged
Merged
Show file tree
Hide file tree
Changes from 4 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
2 changes: 1 addition & 1 deletion priv/repo/seeds.exs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
# Cadet.Repo.insert!(%Cadet.Settings.Sublanguage{chapter: 1, variant: "default"})

if Cadet.Env.env() == :dev do
number_of_students = 100_000
number_of_students = 100
Copy link
Member

Choose a reason for hiding this comment

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

Any reason this is reduced again?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it was taking too long to reset the db :(

Copy link
Member

Choose a reason for hiding this comment

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

Oof 😢 ok maybe we will see how then, we can change it back later haha

Copy link
Member

Choose a reason for hiding this comment

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

Though I think we can put it to 1000 to mimic 1101S?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, 1000 would be good! doesnt take too long for a one time set up (at most a minute).

number_of_assessments = 5
number_of_questions = 13

Expand Down Expand Up @@ -84,7 +84,7 @@
# Users
Enum.each(groups_and_courses, fn {group, course} ->
students =
for i <- 1..number_of_students do

Check warning on line 87 in priv/repo/seeds.exs

View workflow job for this annotation

GitHub Actions / Run CI

variable "i" is unused (if the variable is not meant to be used, prefix it with an underscore)
student = insert(:user, %{latest_viewed_course: course})

student_cr =
Expand Down Expand Up @@ -118,7 +118,7 @@
})
end)

for i <- 1..number_of_assessments do

Check warning on line 121 in priv/repo/seeds.exs

View workflow job for this annotation

GitHub Actions / Run CI

variable "i" is unused (if the variable is not meant to be used, prefix it with an underscore)
assessment =
insert(:assessment, %{
is_published: true,
Expand Down
Loading