Skip to content

Commit

Permalink
KB-5130 | DEV| Assessment | BE | Enhancement in Consumption Logic for…
Browse files Browse the repository at this point in the history
… the QuestionWeightage Assessment Type. (#604)

1. Null pointer exceptions handled.
  • Loading branch information
tarentomaheshvakkund authored Jun 14, 2024
1 parent 792dab4 commit 6c0460d
Showing 1 changed file with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -392,8 +392,11 @@ public SBApiResponse submitAssessmentAsync(Map<String, Object> submitRequest, St
}
}
if (Constants.SECTION_LEVEL_SCORE_CUTOFF.equalsIgnoreCase(scoreCutOffType)) {
Date assessmentStart = (Date) existingAssessmentData.get(Constants.START_TIME);
long assessmentStartTime = assessmentStart.getTime();
long assessmentStartTime = 0;
if (existingAssessmentData.get(Constants.START_TIME)!=null) {
Date assessmentStart = (Date) existingAssessmentData.get(Constants.START_TIME);
assessmentStartTime = assessmentStart.getTime();
}
Map<String, Object> result = calculateSectionFinalResults(sectionLevelsResults,assessmentStartTime,assessmentCompletionTime,maxAssessmentRetakeAttempts,retakeAttemptsConsumed);
outgoingResponse.getResult().putAll(result);
outgoingResponse.getParams().setStatus(Constants.SUCCESS);
Expand Down Expand Up @@ -809,8 +812,12 @@ private Map<String, Object> calculateSectionFinalResults(List<Map<String, Object
if (result >= minimumPassPercentage) {
pass++;
}
totalSectionMarks += (Integer) sectionChildren.get(Constants.SECTION_MARKS);
totalMarks += (Integer) sectionChildren.get(Constants.TOTAL_MARKS);
if(sectionChildren.get(Constants.SECTION_MARKS)!=null){
totalSectionMarks += (Integer) sectionChildren.get(Constants.SECTION_MARKS);
}
if(sectionChildren.get(Constants.TOTAL_MARKS)!=null){
totalMarks += (Integer) sectionChildren.get(Constants.TOTAL_MARKS);
}
}
res.put(Constants.OVERALL_RESULT, totalResult / sectionLevelResults.size());
res.put(Constants.BLANK, blank);
Expand Down

0 comments on commit 6c0460d

Please sign in to comment.