Skip to content

Commit fbc8e15

Browse files
authored
feat: Include hoursBeforeEarlyXpDecay in response (#1156)
* feat: Include hoursBeforeEarlyXpDecay in response * fix: Fix tests
1 parent 9723ec3 commit fbc8e15

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

lib/cadet_web/views/assessments_view.ex

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ defmodule CadetWeb.AssessmentsView do
3737
maxTeamSize: :max_team_size,
3838
hasVotingFeatures: :has_voting_features,
3939
hasTokenCounter: :has_token_counter,
40-
isVotingPublished: &is_voting_assigned(&1.id)
40+
isVotingPublished: &is_voting_assigned(&1.id),
41+
hoursBeforeEarlyXpDecay: & &1.config.hours_before_early_xp_decay
4142
})
4243
end
4344

test/cadet_web/controllers/assessments_controller_test.exs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ defmodule CadetWeb.AssessmentsControllerTest do
8383
"earlySubmissionXp" => &1.config.early_submission_xp,
8484
"hasVotingFeatures" => &1.has_voting_features,
8585
"hasTokenCounter" => &1.has_token_counter,
86-
"isVotingPublished" => Assessments.is_voting_published(&1.id)
86+
"isVotingPublished" => Assessments.is_voting_published(&1.id),
87+
"hoursBeforeEarlyXpDecay" => &1.config.hours_before_early_xp_decay
8788
}
8889
)
8990

@@ -173,7 +174,8 @@ defmodule CadetWeb.AssessmentsControllerTest do
173174
"earlySubmissionXp" => &1.config.early_submission_xp,
174175
"hasVotingFeatures" => &1.has_voting_features,
175176
"hasTokenCounter" => &1.has_token_counter,
176-
"isVotingPublished" => Assessments.is_voting_published(&1.id)
177+
"isVotingPublished" => Assessments.is_voting_published(&1.id),
178+
"hoursBeforeEarlyXpDecay" => &1.config.hours_before_early_xp_decay
177179
}
178180
)
179181

@@ -289,6 +291,7 @@ defmodule CadetWeb.AssessmentsControllerTest do
289291
"isVotingPublished" => Assessments.is_voting_published(&1.id),
290292
"earlySubmissionXp" => &1.config.early_submission_xp,
291293
"isGradingPublished" => nil,
294+
"hoursBeforeEarlyXpDecay" => &1.config.hours_before_early_xp_decay,
292295
"isPublished" =>
293296
if &1.config.type == hd(configs).type do
294297
false

0 commit comments

Comments
 (0)