Skip to content

Commit

Permalink
KB-5744 | The assessment reattempt count shuld not include the 1st at…
Browse files Browse the repository at this point in the history
…tempt (#630)

1. Assessment reattempt handled.
  • Loading branch information
tarentomaheshvakkund authored Jul 3, 2024
1 parent ab49a6d commit ade47ff
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit ade47ff

Please sign in to comment.