diff --git a/src/main/java/org/sunbird/assessment/service/AssessmentServiceV5Impl.java b/src/main/java/org/sunbird/assessment/service/AssessmentServiceV5Impl.java index bf9cf764b..efe199840 100644 --- a/src/main/java/org/sunbird/assessment/service/AssessmentServiceV5Impl.java +++ b/src/main/java/org/sunbird/assessment/service/AssessmentServiceV5Impl.java @@ -238,7 +238,7 @@ public SBApiResponse readQuestionList(Map requestBody, String au String assessmentIdFromRequest = (String) requestBody.get(Constants.ASSESSMENT_ID_KEY); Map questionsMap = assessUtilServ.readQListfromCache(identifierList,assessmentIdFromRequest,editMode,authUserToken); for (String questionId : identifierList) { - questionList.add(assessUtilServ.filterQuestionMapDetailV2((Map) questionsMap.get(questionId), + questionList.add(assessUtilServ.filterQuestionMapDetail((Map) questionsMap.get(questionId), result.get(Constants.PRIMARY_CATEGORY))); } if (errMsg.isEmpty() && identifierList.size() == questionList.size()) { diff --git a/src/main/java/org/sunbird/assessment/service/AssessmentUtilServiceV2.java b/src/main/java/org/sunbird/assessment/service/AssessmentUtilServiceV2.java index 4b09e0f09..3de59dd36 100644 --- a/src/main/java/org/sunbird/assessment/service/AssessmentUtilServiceV2.java +++ b/src/main/java/org/sunbird/assessment/service/AssessmentUtilServiceV2.java @@ -37,6 +37,4 @@ public Map validateQumlAssessment(List originalQuestionL */ public Map validateQumlAssessmentV2(Map questionSetDetailsMap, List originalQuestionList, List> userQuestionList, Map questionMap); - - Map filterQuestionMapDetailV2(Map questionMapResponse, String primaryCategory); } diff --git a/src/main/java/org/sunbird/assessment/service/AssessmentUtilServiceV2Impl.java b/src/main/java/org/sunbird/assessment/service/AssessmentUtilServiceV2Impl.java index 6c85faee7..600f55675 100644 --- a/src/main/java/org/sunbird/assessment/service/AssessmentUtilServiceV2Impl.java +++ b/src/main/java/org/sunbird/assessment/service/AssessmentUtilServiceV2Impl.java @@ -796,41 +796,4 @@ public static List> shuffleOptions(List> Collections.shuffle(shuffledList); return shuffledList; } - - @Override - public Map filterQuestionMapDetailV2(Map questionMapResponse, - String primaryCategory) { - List questionParams = serverProperties.getAssessmentQuestionParams(); - Map updatedQuestionMap = new HashMap<>(); - for (String questionParam : questionParams) { - if (questionMapResponse.containsKey(questionParam)) { - updatedQuestionMap.put(questionParam, questionMapResponse.get(questionParam)); - } - } - if (questionMapResponse.containsKey(Constants.EDITOR_STATE) - && primaryCategory.equalsIgnoreCase(Constants.PRACTICE_QUESTION_SET)) { - Map editorState = (Map) questionMapResponse.get(Constants.EDITOR_STATE); - updatedQuestionMap.put(Constants.EDITOR_STATE, editorState); - } - if (questionMapResponse.containsKey(Constants.CHOICES) - && updatedQuestionMap.containsKey(Constants.PRIMARY_CATEGORY)) { - Map choicesObj = (Map) questionMapResponse.get(Constants.CHOICES); - Map updatedChoicesMap = new HashMap<>(); - if (choicesObj.containsKey(Constants.OPTIONS)) { - List> optionsMapList = (List>) choicesObj - .get(Constants.OPTIONS); - updatedChoicesMap.put(Constants.OPTIONS, shuffleOptions(optionsMapList)); - } - updatedQuestionMap.put(Constants.CHOICES, updatedChoicesMap); - } - if (questionMapResponse.containsKey(Constants.RHS_CHOICES) - && updatedQuestionMap.containsKey(Constants.PRIMARY_CATEGORY) && updatedQuestionMap - .get(Constants.PRIMARY_CATEGORY).toString().equalsIgnoreCase(Constants.MTF_QUESTION)) { - List rhsChoicesObj = (List) questionMapResponse.get(Constants.RHS_CHOICES); - Collections.shuffle(rhsChoicesObj); - updatedQuestionMap.put(Constants.RHS_CHOICES, rhsChoicesObj); - } - - return updatedQuestionMap; - } } \ No newline at end of file