From 2cc5c078b0a3a2ed02ee1d37477e3154c1962269 Mon Sep 17 00:00:00 2001 From: karthik-tarento Date: Tue, 14 Feb 2023 14:37:48 +0530 Subject: [PATCH] Code merged from PR #173 --- .../service/AssessmentServiceV2Impl.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/java/org/sunbird/assessment/service/AssessmentServiceV2Impl.java b/src/main/java/org/sunbird/assessment/service/AssessmentServiceV2Impl.java index badf33a1e..4215d5372 100644 --- a/src/main/java/org/sunbird/assessment/service/AssessmentServiceV2Impl.java +++ b/src/main/java/org/sunbird/assessment/service/AssessmentServiceV2Impl.java @@ -279,16 +279,16 @@ private Map validateQuestionListAPI(Map requestB List questionsFromAssessment = new ArrayList<>(); List> sections = (List>) userAssessmentAllDetail.get(Constants.CHILDREN); for (Map section : sections) { - questionsFromAssessment.addAll((List) section.get(Constants.CHILD_NODES)); - // Out of the list of questions received in the payload, checking if the request + // Out of the list of questions received in the payload, checking if the request // has only those ids which are a part of the user's latest assessment // Fetching all the remaining questions details from the Redis - if (Boolean.FALSE.equals(validateQuestionListRequest(identifierList, questionsFromAssessment))) { - result.put(Constants.ERROR_MESSAGE, Constants.THE_QUESTIONS_IDS_PROVIDED_DONT_MATCH); - return result; - } + questionsFromAssessment.addAll((List) section.get(Constants.CHILD_NODES)); } - result.put(Constants.ERROR_MESSAGE, ""); + if (validateQuestionListRequest(identifierList, questionsFromAssessment)) { + result.put(Constants.ERROR_MESSAGE, StringUtils.EMPTY); + } else { + result.put(Constants.ERROR_MESSAGE, Constants.THE_QUESTIONS_IDS_PROVIDED_DONT_MATCH); + } return result; } else { result.put(Constants.ERROR_MESSAGE, Constants.ASSESSMENT_ID_INVALID);