MAB-624: Remove non visible questions from _progress#122
MAB-624: Remove non visible questions from _progress#122Joselgc1 wants to merge 1 commit intounesco-mabfrom
Conversation
|
@Joselgc1 |
|
@AntoineRelief I added this because I ran into in an error when I first tried loading the "[MAB] Fillable form":
The error was caused because with the original code the first read character is "[", creating some invalid IDs, and also caused duplicated key errors when trying to update existing records. This commit prevents that error from happening so I thought you might want to see it. Don't know if implementing is needed but it solved the issue on my local machine. |
Description
Fixed the progress bar calculation on forms to exclude invisible questions from the percentage.
The issue was that required questions hidden by isVisibleIf were still being counted. Created a isQuestionVisible() helper function that checks both the question and its parent visibility (it was already implemented locally), and we use it on the progress filter to update the value.
Now, only visible required questions count for completion.
Useful links
Type of change
Checklist:
( * == Mandatory )