diff --git a/src/main/java/org/sunbird/assessment/service/AssessmentServiceV5Impl.java b/src/main/java/org/sunbird/assessment/service/AssessmentServiceV5Impl.java index 52ede65e3..a403bffe1 100644 --- a/src/main/java/org/sunbird/assessment/service/AssessmentServiceV5Impl.java +++ b/src/main/java/org/sunbird/assessment/service/AssessmentServiceV5Impl.java @@ -83,6 +83,7 @@ public SBApiResponse retakeAssessment(String assessmentIdentifier, String token, // if (serverProperties.isAssessmentRetakeCountVerificationEnabled()) { retakeAttemptsConsumed = calculateAssessmentRetakeCount(userId, assessmentIdentifier); + retakeAttemptsConsumed=retakeAttemptsConsumed-1; //} } catch (Exception e) { errMsg = String.format("Error while calculating retake assessment. Exception: %s", e.getMessage()); @@ -187,6 +188,7 @@ public SBApiResponse readAssessment(String assessmentIdentifier, String token,bo if (assessmentAllDetail.get(Constants.MAX_ASSESSMENT_RETAKE_ATTEMPTS) != null) { int retakeAttemptsAllowed = (int) assessmentAllDetail.get(Constants.MAX_ASSESSMENT_RETAKE_ATTEMPTS); int retakeAttemptsConsumed = calculateAssessmentRetakeCount(userId, assessmentIdentifier); + retakeAttemptsConsumed=retakeAttemptsConsumed+1; if(retakeAttemptsConsumed >= retakeAttemptsAllowed) { errMsg = Constants.ASSESSMENT_RETRY_ATTEMPTS_CROSSED; updateErrorDetails(response, errMsg, HttpStatus.INTERNAL_SERVER_ERROR);