Skip to content

Commit

Permalink
Assessment overview bonus xp (#1076)
Browse files Browse the repository at this point in the history
* Added early submission Exp to Overview

* fixed format

* Changed Exp to Xp
  • Loading branch information
DesSnowy authored Mar 26, 2024
1 parent b410b5f commit d00bcd4
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/cadet_web/admin_views/admin_assessments_view.ex
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ defmodule CadetWeb.AdminAssessmentsView do
isPublished: :is_published,
questionCount: :question_count,
gradedCount: &(&1.graded_count || 0),
earlySubmissionXp: & &1.config.early_submission_xp,
maxTeamSize: :max_team_size,
hasVotingFeatures: :has_voting_features,
hasTokenCounter: :has_token_counter
Expand Down
1 change: 1 addition & 0 deletions lib/cadet_web/views/assessments_view.ex
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ defmodule CadetWeb.AssessmentsView do
isPublished: :is_published,
questionCount: :question_count,
gradedCount: &(&1.graded_count || 0),
earlySubmissionXp: & &1.config.early_submission_xp,
maxTeamSize: :max_team_size,
hasVotingFeatures: :has_voting_features,
hasTokenCounter: :has_token_counter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ defmodule CadetWeb.AdminAssessmentsControllerTest do
"gradedCount" => 0,
"questionCount" => 9,
"xp" => (800 + 500 + 100) * 3,
"earlySubmissionXp" => &1.config.early_submission_xp,
"hasVotingFeatures" => &1.has_voting_features,
"hasTokenCounter" => &1.has_token_counter
}
Expand Down Expand Up @@ -140,6 +141,7 @@ defmodule CadetWeb.AdminAssessmentsControllerTest do
"gradedCount" => 0,
"questionCount" => 9,
"xp" => 0,
"earlySubmissionXp" => &1.config.early_submission_xp,
"hasVotingFeatures" => &1.has_voting_features,
"hasTokenCounter" => &1.has_token_counter
}
Expand Down
3 changes: 3 additions & 0 deletions test/cadet_web/controllers/assessments_controller_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ defmodule CadetWeb.AssessmentsControllerTest do
"isPublished" => &1.is_published,
"gradedCount" => 0,
"questionCount" => 9,
"earlySubmissionXp" => &1.config.early_submission_xp,
"hasVotingFeatures" => &1.has_voting_features,
"hasTokenCounter" => &1.has_token_counter
}
Expand Down Expand Up @@ -166,6 +167,7 @@ defmodule CadetWeb.AssessmentsControllerTest do
"isPublished" => &1.is_published,
"gradedCount" => 0,
"questionCount" => 9,
"earlySubmissionXp" => &1.config.early_submission_xp,
"hasVotingFeatures" => &1.has_voting_features,
"hasTokenCounter" => &1.has_token_counter
}
Expand Down Expand Up @@ -280,6 +282,7 @@ defmodule CadetWeb.AssessmentsControllerTest do
"questionCount" => 9,
"hasVotingFeatures" => &1.has_voting_features,
"hasTokenCounter" => &1.has_token_counter,
"earlySubmissionXp" => &1.config.early_submission_xp,
"isPublished" =>
if &1.config.type == hd(configs).type do
false
Expand Down

0 comments on commit d00bcd4

Please sign in to comment.