Skip to content

Commit

Permalink
Rename contest leaderboard to score leaderboard (#1064)
Browse files Browse the repository at this point in the history
* Rename contestLeaderboard to scoreLeaderboard

In preparation of new feature which shows contest leaderboard based on votes

* Rename contestLeaderboard to scoreLeaderboard for test
  • Loading branch information
DesSnowy authored Feb 13, 2024
1 parent ace47cd commit dba4f95
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/cadet_web/helpers/assessments_helpers.ex
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ defmodule CadetWeb.AssessmentsHelpers do
solutionTemplate: "template",
contestEntries:
&Enum.map(&1[:contest_entries], fn entry -> build_contest_entry(entry) end),
contestLeaderboard:
scoreLeaderboard:
&Enum.map(&1[:contest_leaderboard], fn entry ->
build_contest_leaderboard_entry(entry)
end)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ defmodule CadetWeb.AdminGradingControllerTest do
"autogradingResults" => &1.autograding_results,
"answer" => nil,
"contestEntries" => [],
"contestLeaderboard" => []
"scoreLeaderboard" => []
},
"grade" => %{
"xp" => &1.xp,
Expand Down Expand Up @@ -1019,7 +1019,7 @@ defmodule CadetWeb.AdminGradingControllerTest do
"autogradingResults" => &1.autograding_results,
"answer" => nil,
"contestEntries" => [],
"contestLeaderboard" => []
"scoreLeaderboard" => []
},
"grade" => %{
"xp" => &1.xp,
Expand Down
8 changes: 4 additions & 4 deletions test/cadet_web/controllers/assessments_controller_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ defmodule CadetWeb.AssessmentsControllerTest do
|> Enum.zip(contests_entries)
|> Enum.map(fn {question, contest_entries} ->
question = Map.put(question, "contestEntries", contest_entries)
Map.put(question, "contestLeaderboard", [])
Map.put(question, "scoreLeaderboard", [])
end)

expected_questions =
Expand Down Expand Up @@ -540,7 +540,7 @@ defmodule CadetWeb.AssessmentsControllerTest do
|> json_response(200)
|> Map.get("questions", [])
|> Enum.find(&(&1["id"] == voting_question.id))
|> Map.get("contestLeaderboard")
|> Map.get("scoreLeaderboard")

assert resp_leaderboard == expected_leaderboard
end
Expand Down Expand Up @@ -612,7 +612,7 @@ defmodule CadetWeb.AssessmentsControllerTest do
|> json_response(200)
|> Map.get("questions", [])
|> Enum.find(&(&1["id"] == voting_question.id))
|> Map.get("contestLeaderboard")
|> Map.get("scoreLeaderboard")

assert resp_leaderboard == expected_leaderboard
end
Expand Down Expand Up @@ -672,7 +672,7 @@ defmodule CadetWeb.AssessmentsControllerTest do
|> json_response(200)
|> Map.get("questions", [])
|> Enum.find(&(&1["id"] == voting_question.id))
|> Map.get("contestLeaderboard")
|> Map.get("scoreLeaderboard")

assert resp_leaderboard == expected_leaderboard
end
Expand Down

0 comments on commit dba4f95

Please sign in to comment.