Skip to content

Commit

Permalink
Merge pull request #379 from kbss-cvut/fix-non-validated-questions
Browse files Browse the repository at this point in the history
Fix non validated questions
  • Loading branch information
blcham authored Jan 7, 2025
2 parents e3882d4 + be813be commit 2dfe61d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
10 changes: 4 additions & 6 deletions src/model/ValidationProcessor.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,11 @@ export default class ValidationProcessor {
* @param {Object} intl - The object used for internationalization.
*/
static updateQuestionValidation = (questions, question, index, intl) => {
if (question[Constants.HAS_ANSWER]) {
const validator = createValidator(question, intl);
const update = validator();
const validator = createValidator(question, intl);
const update = validator();

if (update) {
questions[index] = { ...question, ...update };
}
if (update) {
questions[index] = { ...question, ...update };
}
for (const question of questions) {
this.updateSubQuestionsValidation(question, intl);
Expand Down
2 changes: 0 additions & 2 deletions src/model/ValidatorFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ const createValidator = (question, intl) => {
return () => {
if (FormUtils.hasValidationLogic(question, intl)) {
const answerValue = FormUtils.getAnswerValue(question);
// console.log(question);
// console.log(intl);
return _validateAnswer(question, intl, answerValue, validators);
}
};
Expand Down

0 comments on commit 2dfe61d

Please sign in to comment.