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 rules and adjust existing rule #231

Merged
merged 8 commits into from
Dec 20, 2024
Merged

Conversation

mlan225
Copy link
Member

@mlan225 mlan225 commented Dec 18, 2024

FIxes: #221

These questions are the focus of the PR. The numbering can change depending on the form types, but the labels and validation will remain the same.

image

example of error text display

image

Adjust the validation for the C2 in all versions of the form (InPerson and remote):

  • For Delayed recall questions: 'No cue', 'Category cue', and 'Recognition' the sum of questions with a value of 0 - 5 should be less than or equal to 5
  • If Delayed recall - No cue is equal to 5, then Delayed recall - Category cue and Delayed recall - Recognition should both be 88
  • If the sum of Delayed recall - No cue and Delayed recall - Category are equal to 5, then Delayed recall - Recognition should be 88

@mlan225 mlan225 marked this pull request as draft December 18, 2024 13:51
@mlan225
Copy link
Member Author

mlan225 commented Dec 18, 2024

Josh and I discovered that there is an extra case that delayed recall questions can be, and have some current instances of:

  1. value
  2. 88
  3. value

With this in mind, we still needed to check if all of the values that were NOT 88 or 93 - 95 did not have a sum of > 5

The completed form cannot have these values as null, but just to make sure i am making the code null safe.
Comment on lines +679 to +701
int? mocarecnValue = 0;
int? mocareccValue = 0;
int? mocarecrValue = 0;

//if input is an exception value (93 - 95 or 88) then calculate as 0 in total
if (MOCARECN != null)
{
mocarecnValue = MOCARECN >= 95 ? 0 : MOCARECN;
}

if (MOCARECC != null)
{
mocareccValue = MOCARECC == 88 ? 0 : MOCARECC;
}

if (MOCARECR != null)
{
mocarecrValue = MOCARECR == 88 ? 0 : MOCARECR;
}

if (mocarecnValue + mocareccValue + mocarecrValue > 5) return null;

return true;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made this code null safe, even though it should not be possible to reach a finalized state AND have null values for MOCARECN, MOCARECC, and MOCARECR.

@mlan225 mlan225 marked this pull request as ready for review December 18, 2024 23:34
Copy link
Member

@ashleybot ashleybot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mlan225 Looks good! 👍 I added a small commit so the display of the error messages follows the existing behavior in the form (displaying in the 3rd column).

Existing layout of error messages in the 3rd column:

Screenshot 2024-12-20 at 8 25 40 AM

Failure states

MOCARECN + MOCARECC + MOCARECR > 5
Screenshot 2024-12-20 at 8 26 19 AM

If MOCARECN == 5 then ( MOCARECC != 88 && MOCARECR != 88)
Screenshot 2024-12-20 at 8 27 50 AM

Success states

If MOCARECN == 5 then ( MOCARECC == 88 && MOCARECR == 88)
Screenshot 2024-12-20 at 8 28 18 AM

MOCARECN + MOCARECC + MOCARECR <= 5
Screenshot 2024-12-20 at 8 29 15 AM

if MOCARECN == 95 then MOCARECC + MOCARECR <= 5
Screenshot 2024-12-20 at 8 28 48 AM

@ashleybot
Copy link
Member

@mlan225 Good to bump the version to 4.6.5 and merge to main. After merge to main tag commit with v4.6.5 to trigger github action to build nuget packages.

@ashleybot
Copy link
Member

@mlan225 We have some more cards getting approved. This needs to be merged first or the version numbers will get out of sync.

@mlan225 mlan225 merged commit 08bebec into main Dec 20, 2024
4 checks passed
@mlan225 mlan225 deleted the c2-delayed-recall-validation branch December 20, 2024 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

C2 MOCA Delayed Recall Enhanced Validation
2 participants