Skip to content

Commit

Permalink
Revert "KB-6027 |DEV | Assessment | BE | Changes to allow for Standal…
Browse files Browse the repository at this point in the history
…one Assessment with question type FTB to show Options." (#655) (#656)

This reverts commit 85b2f07.

Co-authored-by: tarentomaheshvakkund <[email protected]>
  • Loading branch information
SaipradeepR and tarentomaheshvakkund authored Jul 29, 2024
1 parent 5780fee commit a3d638d
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ public SBApiResponse readQuestionList(Map<String, Object> requestBody, String au
String assessmentIdFromRequest = (String) requestBody.get(Constants.ASSESSMENT_ID_KEY);
Map<String, Object> questionsMap = assessUtilServ.readQListfromCache(identifierList,assessmentIdFromRequest,editMode,authUserToken);
for (String questionId : identifierList) {
questionList.add(assessUtilServ.filterQuestionMapDetailV2((Map<String, Object>) questionsMap.get(questionId),
questionList.add(assessUtilServ.filterQuestionMapDetail((Map<String, Object>) questionsMap.get(questionId),
result.get(Constants.PRIMARY_CATEGORY)));
}
if (errMsg.isEmpty() && identifierList.size() == questionList.size()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,4 @@ public Map<String, Object> validateQumlAssessment(List<String> originalQuestionL
*/
public Map<String, Object> validateQumlAssessmentV2(Map<String, Object> questionSetDetailsMap, List<String> originalQuestionList,
List<Map<String, Object>> userQuestionList, Map<String,Object> questionMap);

Map<String, Object> filterQuestionMapDetailV2(Map<String, Object> questionMapResponse, String primaryCategory);
}
Original file line number Diff line number Diff line change
Expand Up @@ -796,41 +796,4 @@ public static List<Map<String, Object>> shuffleOptions(List<Map<String, Object>>
Collections.shuffle(shuffledList);
return shuffledList;
}

@Override
public Map<String, Object> filterQuestionMapDetailV2(Map<String, Object> questionMapResponse,
String primaryCategory) {
List<String> questionParams = serverProperties.getAssessmentQuestionParams();
Map<String, Object> 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<String, Object> editorState = (Map<String, Object>) questionMapResponse.get(Constants.EDITOR_STATE);
updatedQuestionMap.put(Constants.EDITOR_STATE, editorState);
}
if (questionMapResponse.containsKey(Constants.CHOICES)
&& updatedQuestionMap.containsKey(Constants.PRIMARY_CATEGORY)) {
Map<String, Object> choicesObj = (Map<String, Object>) questionMapResponse.get(Constants.CHOICES);
Map<String, Object> updatedChoicesMap = new HashMap<>();
if (choicesObj.containsKey(Constants.OPTIONS)) {
List<Map<String, Object>> optionsMapList = (List<Map<String, Object>>) 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<Object> rhsChoicesObj = (List<Object>) questionMapResponse.get(Constants.RHS_CHOICES);
Collections.shuffle(rhsChoicesObj);
updatedQuestionMap.put(Constants.RHS_CHOICES, rhsChoicesObj);
}

return updatedQuestionMap;
}
}

0 comments on commit a3d638d

Please sign in to comment.