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

LEAF-4604 update form progress checking to account for conditional logic #2613

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

aerinkayne
Copy link
Contributor

@aerinkayne aerinkayne commented Dec 3, 2024

The current Form getProgress method still compares a flat array of required questions with data entries in order to determine form progress percentage. Individual questions account for direct conditional logic. However, since there is no information about form structure, using conditional logic when the conditional indicator has required sub-questions is problematic / tedious because the logic needs to be repeated on the subquestion.

This update will take form structure into account (when needed) during the progress count so that any ancestor in a hidden state is sufficient.

Front end:
Updates to form.js to handle conditional display states and to toggle front end validation for required questions

Server-Side:
Updates to form method getProgress to account for structure.
Following a check for submission and for the number of required questions, method will progress with a depth search assessment of question display state, visible required question, and total required question totals. Required questions that are not in a visible state because they OR one of their ancestors are hidden by conditional do not count towards the visible total.

Impact / Testing.

Associated go test PR
department-of-veterans-affairs/LEAF-Automated-Tests#20

This has high impact to the initial request submission process.
If the total is inaccurate
-data entry or submission could be prevented without a visible indication to the user as to why.
-submission could be allowed despite the user not having answered all required questions.

Test form data entry (initial request) and confirm that the percentage (form progress) reflects the percentage of answered required questions that are visible on the form. Required questions hidden by ifthen logic directly, or because they are subquestions of hidden questions should not count towards the visible total.

shaneodd
shaneodd previously approved these changes Dec 3, 2024
jampaul3
jampaul3 previously approved these changes Dec 4, 2024
*/
public function getProgress($recordID)
private function count_required(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Where's my return type? ;-)

* @param int $recordID
* @return int Percent completed
*/
public function getProgress($recordID)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Type cast and return type, please.

@aerinkayne aerinkayne dismissed stale reviews from jampaul3 and shaneodd via fdd9aa0 December 4, 2024 20:31
@Pelentan Pelentan added the With QA Ticket is to QA. No changes unless pulled back to in progress label Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
With QA Ticket is to QA. No changes unless pulled back to in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants