Skip to content

Commit

Permalink
Merging 4.8.15 dev v2 to cbrelease-4.5.15 (#602)
Browse files Browse the repository at this point in the history
* KB-5130 | DEV| Assessment | BE | Enhancement in Consumption Logic for the QuestionWeightage Assessment Type (#586)

1. Enhancements in the assessment consumption logic.

* Fix for Save Assessment

* Fix for Save Assessment

* Fix for Save Assessment

* KB-5130 | DEV| Assessment | BE | Enhancement in Consumption Logic for the QuestionWeightage Assessment Type (#587)

1. Score calculation fix.

* Assessment SavePoint

* 4.8.15 assessment score calcln fix (#588)

* KB-5130 | DEV| Assessment | BE | Enhancement in Consumption Logic for the QuestionWeightage Assessment Type

1. Score calculation fix.

* KB-5130 | DEV| Assessment | BE | Enhancement in Consumption Logic for the QuestionWeightage Assessment Type

1. Score calculation issue fix.

* Assessment Defect Fix

* Practise Assessment Defect Fix

* DEV| Assessment | BE | Enhancement in Consumption Logic for the QuestionWeightage Assessment Type. (#591)

1. Section name is added.

* Assessment Configurations for V5 (#601)

Assessment Configurations for V5

---------

Co-authored-by: tarentomaheshvakkund <[email protected]>
Co-authored-by: saipradeep_ravipati <[email protected]>
Co-authored-by: karthik-tarento <[email protected]>
  • Loading branch information
4 people authored Jun 14, 2024
1 parent 3e3de8d commit 792dab4
Show file tree
Hide file tree
Showing 10 changed files with 149 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,16 @@ public ResponseEntity<SBApiResponse> readAssessmentResultV5(@Valid @RequestBody
public ResponseEntity<SBApiResponse> saveUserAssessmentV5(@Valid @RequestBody Map<String, Object> requestBody,
@RequestHeader("x-authenticated-user-token") String authUserToken,@RequestParam(name = "editMode" ,required = false) String editMode) {
boolean edit = !StringUtils.isEmpty(editMode) && Boolean.parseBoolean(editMode);
SBApiResponse submitResponse = assessmentServiceV5.submitAssessmentAsync(requestBody, authUserToken,edit);
SBApiResponse submitResponse = assessmentServiceV5.saveAssessmentAsync(requestBody, authUserToken,edit);
return new ResponseEntity<>(submitResponse, submitResponse.getResponseCode());
}

@GetMapping("/v5/quml/assessment/savepoint/{assessmentIdentifier}")
public ResponseEntity<SBApiResponse> readSavePointV5(
@PathVariable("assessmentIdentifier") String assessmentIdentifier,
@RequestHeader(Constants.X_AUTH_TOKEN) String token,@RequestParam(name = "editMode" ,required = false) String editMode) {
boolean edit = !StringUtils.isEmpty(editMode) && Boolean.parseBoolean(editMode);
SBApiResponse readResponse = assessmentServiceV5.readAssessmentSavePoint(assessmentIdentifier, token,edit);
return new ResponseEntity<>(readResponse, readResponse.getResponseCode());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,5 @@ boolean addUserAssesmentDataToDB(String userId, String assessmentId, Timestamp s

Boolean updateUserAssesmentDataToDB(String userId, String assessmentIdentifier,
Map<String, Object> submitAssessmentRequest, Map<String, Object> submitAssessmentResponse, String status,
Date startTime);
Date startTime,Map<String, Object> saveSubmitAssessmentRequest);
}
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ public List<Map<String, Object>> fetchUserAssessmentDataFromDB(String userId, St
@Override
public Boolean updateUserAssesmentDataToDB(String userId, String assessmentIdentifier,
Map<String, Object> submitAssessmentRequest, Map<String, Object> submitAssessmentResponse, String status,
Date startTime) {
Date startTime,Map<String, Object> saveSubmitAssessmentRequest) {
Map<String, Object> compositeKeys = new HashMap<>();
compositeKeys.put(Constants.USER_ID, userId);
compositeKeys.put(Constants.ASSESSMENT_ID_KEY, assessmentIdentifier);
Expand All @@ -178,6 +178,9 @@ public Boolean updateUserAssesmentDataToDB(String userId, String assessmentIdent
if (StringUtils.isNotBlank(status)) {
fieldsToBeUpdated.put(Constants.STATUS, status);
}
if (MapUtils.isNotEmpty(saveSubmitAssessmentRequest)) {
fieldsToBeUpdated.put("savepointsubmitreq", new Gson().toJson(saveSubmitAssessmentRequest));
}
cassandraOperation.updateRecord(Constants.KEYSPACE_SUNBIRD, Constants.TABLE_USER_ASSESSMENT_DATA,
fieldsToBeUpdated, compositeKeys);
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ private void writeDataToDatabaseAndTriggerKafkaEvent(Map<String, Object> submitR
if (questionSetFromAssessment.get(Constants.START_TIME) != null) {
Long existingAssessmentStartTime = (Long) questionSetFromAssessment.get(Constants.START_TIME);
Timestamp startTime = new Timestamp(existingAssessmentStartTime);
Boolean isAssessmentUpdatedToDB = assessmentRepository.updateUserAssesmentDataToDB(userId, (String) submitRequest.get(Constants.IDENTIFIER), submitRequest, result, Constants.SUBMITTED, startTime);
Boolean isAssessmentUpdatedToDB = assessmentRepository.updateUserAssesmentDataToDB(userId, (String) submitRequest.get(Constants.IDENTIFIER), submitRequest, result, Constants.SUBMITTED, startTime,null);
if (Boolean.TRUE.equals(isAssessmentUpdatedToDB)) {
Map<String, Object> kafkaResult = new HashMap<>();
kafkaResult.put(Constants.CONTENT_ID_KEY, submitRequest.get(Constants.IDENTIFIER));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,7 @@ private void writeDataToDatabaseAndTriggerKafkaEvent(Map<String, Object> submitR
Timestamp startTime = new Timestamp(existingAssessmentStartTime);
Boolean isAssessmentUpdatedToDB = assessmentRepository.updateUserAssesmentDataToDB(userId,
(String) submitRequest.get(Constants.IDENTIFIER), submitRequest, result, Constants.SUBMITTED,
startTime);
startTime,null);
if (Boolean.TRUE.equals(isAssessmentUpdatedToDB)) {
Map<String, Object> kafkaResult = new HashMap<>();
kafkaResult.put(Constants.CONTENT_ID_KEY, submitRequest.get(Constants.IDENTIFIER));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,6 @@ public interface AssessmentServiceV5 {

public SBApiResponse saveAssessmentAsync(Map<String, Object> data, String userAuthToken,boolean editMode);

}
public SBApiResponse readAssessmentSavePoint(String assessmentIdentifier, String token,boolean editMode);

}
Loading

0 comments on commit 792dab4

Please sign in to comment.