From a8456ed421dc34dcdf6f7c9abf54c3b4f4eef4bd Mon Sep 17 00:00:00 2001 From: tarentomaheshvakkund <139739142+tarentomaheshvakkund@users.noreply.github.com> Date: Wed, 3 Jul 2024 18:08:20 +0530 Subject: [PATCH] KB-5744 | The assessment reattempt count shuld not include the 1st attempt (#632) * KB-5744 | The assessment reattempt count shuld not include the 1st attempt 1. Assessment reattempt handled. * KB-5744 | The assessment reattempt count shuld not include the 1st attempt --- .../sunbird/assessment/service/AssessmentServiceV5Impl.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/org/sunbird/assessment/service/AssessmentServiceV5Impl.java b/src/main/java/org/sunbird/assessment/service/AssessmentServiceV5Impl.java index a403bffe1..efe199840 100644 --- a/src/main/java/org/sunbird/assessment/service/AssessmentServiceV5Impl.java +++ b/src/main/java/org/sunbird/assessment/service/AssessmentServiceV5Impl.java @@ -186,9 +186,8 @@ public SBApiResponse readAssessment(String assessmentIdentifier, String token,bo logger.info( "Incase the assessment is submitted before the end time, or the endtime has exceeded, read assessment freshly "); if (assessmentAllDetail.get(Constants.MAX_ASSESSMENT_RETAKE_ATTEMPTS) != null) { - int retakeAttemptsAllowed = (int) assessmentAllDetail.get(Constants.MAX_ASSESSMENT_RETAKE_ATTEMPTS); + int retakeAttemptsAllowed = (int) assessmentAllDetail.get(Constants.MAX_ASSESSMENT_RETAKE_ATTEMPTS) +1; int retakeAttemptsConsumed = calculateAssessmentRetakeCount(userId, assessmentIdentifier); - retakeAttemptsConsumed=retakeAttemptsConsumed+1; if(retakeAttemptsConsumed >= retakeAttemptsAllowed) { errMsg = Constants.ASSESSMENT_RETRY_ATTEMPTS_CROSSED; updateErrorDetails(response, errMsg, HttpStatus.INTERNAL_SERVER_ERROR);