if (req.boundParams.exercise?.assignmentName!=req.boundParams.assignment?.name){
returnreq.session.sendResponse(res,StatusCodes.BAD_REQUEST,undefined,'The exercise does not belong to the assignment',DojoStatusCode.ASSIGNMENT_EXERCISE_NOT_RELATED);
}
if (!req.boundParams.assignment?.published){
returnreq.session.sendResponse(res,StatusCodes.BAD_REQUEST,undefined,'The assignment must be public',DojoStatusCode.ASSIGNMENT_NOT_PUBLISHED);
}
if (!isUpdate&&req.boundParams.exercise?.isCorrection){
returnreq.session.sendResponse(res,StatusCodes.BAD_REQUEST,undefined,'This exercise is already a correction',DojoStatusCode.EXERCISE_CORRECTION_ALREADY_EXIST);
returnreq.session.sendResponse(res,StatusCodes.BAD_REQUEST,undefined,'This exercise is not a correction',DojoStatusCode.EXERCISE_CORRECTION_NOT_EXIST);