diff --git a/lib/cadet_web/views/assessments_view.ex b/lib/cadet_web/views/assessments_view.ex index 0b967397b..700f13019 100644 --- a/lib/cadet_web/views/assessments_view.ex +++ b/lib/cadet_web/views/assessments_view.ex @@ -37,7 +37,8 @@ defmodule CadetWeb.AssessmentsView do maxTeamSize: :max_team_size, hasVotingFeatures: :has_voting_features, hasTokenCounter: :has_token_counter, - isVotingPublished: &is_voting_assigned(&1.id) + isVotingPublished: &is_voting_assigned(&1.id), + hoursBeforeEarlyXpDecay: & &1.config.hours_before_early_xp_decay }) end diff --git a/test/cadet_web/controllers/assessments_controller_test.exs b/test/cadet_web/controllers/assessments_controller_test.exs index c78bd12ae..f1cc9beb0 100644 --- a/test/cadet_web/controllers/assessments_controller_test.exs +++ b/test/cadet_web/controllers/assessments_controller_test.exs @@ -83,7 +83,8 @@ defmodule CadetWeb.AssessmentsControllerTest do "earlySubmissionXp" => &1.config.early_submission_xp, "hasVotingFeatures" => &1.has_voting_features, "hasTokenCounter" => &1.has_token_counter, - "isVotingPublished" => Assessments.is_voting_published(&1.id) + "isVotingPublished" => Assessments.is_voting_published(&1.id), + "hoursBeforeEarlyXpDecay" => &1.config.hours_before_early_xp_decay } ) @@ -173,7 +174,8 @@ defmodule CadetWeb.AssessmentsControllerTest do "earlySubmissionXp" => &1.config.early_submission_xp, "hasVotingFeatures" => &1.has_voting_features, "hasTokenCounter" => &1.has_token_counter, - "isVotingPublished" => Assessments.is_voting_published(&1.id) + "isVotingPublished" => Assessments.is_voting_published(&1.id), + "hoursBeforeEarlyXpDecay" => &1.config.hours_before_early_xp_decay } ) @@ -289,6 +291,7 @@ defmodule CadetWeb.AssessmentsControllerTest do "isVotingPublished" => Assessments.is_voting_published(&1.id), "earlySubmissionXp" => &1.config.early_submission_xp, "isGradingPublished" => nil, + "hoursBeforeEarlyXpDecay" => &1.config.hours_before_early_xp_decay, "isPublished" => if &1.config.type == hd(configs).type do false