Skip to content
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

Add partial scoring for 2 CMMC questions #4304

Merged
merged 1 commit into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,12 @@ public class CmmcBusiness

private List<MATURITY_EXTRA> _maturityExtra;

// Answers that don't count against the score
private readonly List<string> _goodAnswerOptions = new List<string>() {"Y", "NA"};

// The questions that allow an "incomplete" answer selection
private readonly List<int> _questionsThatAllowIncomplete = new List<int>() { 5330, 5382 };

// CMMC 2.0 FINAL model ID
private readonly int modelIdCmmc2 = 19;

Expand Down Expand Up @@ -280,9 +284,19 @@ public CmmcScoreModel GetSPRSScore(int assessmentId)
/// Successful answers (Y, NA) deduct no points.
/// Questions not defined with a point value in MATURITY_EXTRA (e.g., Level 1 and Level 3)
/// default to a 1-point deduction.
///
/// SPECIAL CASE: Two of the questions can get a partial score. This limited scenario is not
/// worth a total refactor of MATURITY_EXTRA, so we are handling it programmatically
/// in this method for now.
/// </summary>
private int DeductionForAnswer(CmmcQuestion q)
{
// Special "incomplete" scenario for CMMC questions 5330 and 5382
if (_questionsThatAllowIncomplete.Contains(q.QuestionId) && q.AnswerText == "I")
{
return 3;
}

if (_goodAnswerOptions.Contains(q.AnswerText))
{
return 0;
Expand Down
1 change: 1 addition & 0 deletions CSETWebNg/src/assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,7 @@
"no-cmmc": "Not Met",
"n-cmmc": "Not Met",
"na-cmmc": "N/A",
"i-cmmc": "Incomplete",
"u-cmmc": "Unanswered"
},
"placeholders": {
Expand Down
Loading