Skip to content

Commit 2dfe61d

Browse files
authored
Merge pull request #379 from kbss-cvut/fix-non-validated-questions
Fix non validated questions
2 parents e3882d4 + be813be commit 2dfe61d

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

src/model/ValidationProcessor.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,11 @@ export default class ValidationProcessor {
1111
* @param {Object} intl - The object used for internationalization.
1212
*/
1313
static updateQuestionValidation = (questions, question, index, intl) => {
14-
if (question[Constants.HAS_ANSWER]) {
15-
const validator = createValidator(question, intl);
16-
const update = validator();
14+
const validator = createValidator(question, intl);
15+
const update = validator();
1716

18-
if (update) {
19-
questions[index] = { ...question, ...update };
20-
}
17+
if (update) {
18+
questions[index] = { ...question, ...update };
2119
}
2220
for (const question of questions) {
2321
this.updateSubQuestionsValidation(question, intl);

src/model/ValidatorFactory.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ const createValidator = (question, intl) => {
1717
return () => {
1818
if (FormUtils.hasValidationLogic(question, intl)) {
1919
const answerValue = FormUtils.getAnswerValue(question);
20-
// console.log(question);
21-
// console.log(intl);
2220
return _validateAnswer(question, intl, answerValue, validators);
2321
}
2422
};

0 commit comments

Comments
 (0)