Integrity checks
This functionality checks the questionnaire integrity after each modification. These checks will generate error messages that will appear at the top of the questionnaire in a dedicated panel.
It has been implemented with the integrityChecker function, which is called to build the main reducer. It takes a reducer as its first argument and a checker
as its second argument, and returns a dynamically built reducer which will first call the reducer it was given to process the actions, and then, based on the new state produced by the initial reducer, process some integrity checks implemented by the checker
.
The initial reducer will be a combination of all the existing reducers. It implements the application logic (for instance, how to update the state when we add a question).
The checker can be built by combining multiple checkers with the combineCheckers function.
The reducer built by integrityChecker
will add an errors
key to the application state.
For now, only checks of goTos consistency and questionnaire length have been implemented.