From efa225a3bc86332b7d68ca31580b95717d78d8a8 Mon Sep 17 00:00:00 2001 From: sherif-olaboye <123654949+sherif-olaboye@users.noreply.github.com> Date: Thu, 17 Jul 2025 10:00:33 +0100 Subject: [PATCH 1/2] TD-5816 Issue clearing 'confirmation requests' of 'optional competencies' if removed/added some other 'optional' competencies --- .../CompetencyDataService.cs | 10 +--------- .../SelfAssessmentDataService.cs | 1 - .../LearningPortalController/SelfAssessment.cs | 16 ---------------- .../Services/SelfAssessmentService.cs | 6 +----- 4 files changed, 2 insertions(+), 31 deletions(-) diff --git a/DigitalLearningSolutions.Data/DataServices/SelfAssessmentDataService/CompetencyDataService.cs b/DigitalLearningSolutions.Data/DataServices/SelfAssessmentDataService/CompetencyDataService.cs index 3c333e78e8..9ea3060683 100644 --- a/DigitalLearningSolutions.Data/DataServices/SelfAssessmentDataService/CompetencyDataService.cs +++ b/DigitalLearningSolutions.Data/DataServices/SelfAssessmentDataService/CompetencyDataService.cs @@ -639,15 +639,7 @@ FROM SelfAssessmentResults s inner join new { selfAssessmentId, delegateUserId, competencyId } ); } - - public void RemoveReviewCandidateAssessmentOptionalCompetencies(int id) - { - - connection.Execute( - @"delete from SelfAssessmentResultSupervisorVerifications WHERE SelfAssessmentResultId = @id", new { id }); - - } - + private static string PrintResult( int competencyId, int selfAssessmentId, diff --git a/DigitalLearningSolutions.Data/DataServices/SelfAssessmentDataService/SelfAssessmentDataService.cs b/DigitalLearningSolutions.Data/DataServices/SelfAssessmentDataService/SelfAssessmentDataService.cs index 324a1050a7..682cbcb2b5 100644 --- a/DigitalLearningSolutions.Data/DataServices/SelfAssessmentDataService/SelfAssessmentDataService.cs +++ b/DigitalLearningSolutions.Data/DataServices/SelfAssessmentDataService/SelfAssessmentDataService.cs @@ -174,7 +174,6 @@ int GetSelfAssessmentActivityDelegatesExportCount(string searchString, string so bool IsCentreSelfAssessment(int selfAssessmentId, int centreId); bool HasMinimumOptionalCompetencies(int selfAssessmentId, int delegateUserId); int GetSelfAssessmentCategoryId(int selfAssessmentId); - void RemoveReviewCandidateAssessmentOptionalCompetencies(int id); public IEnumerable GetSelfAssessmentResultswithSupervisorVerificationsForDelegateSelfAssessmentCompetency( int delegateUserId, int selfAssessmentId, diff --git a/DigitalLearningSolutions.Web/Controllers/LearningPortalController/SelfAssessment.cs b/DigitalLearningSolutions.Web/Controllers/LearningPortalController/SelfAssessment.cs index bd8188b453..955fe570b3 100644 --- a/DigitalLearningSolutions.Web/Controllers/LearningPortalController/SelfAssessment.cs +++ b/DigitalLearningSolutions.Web/Controllers/LearningPortalController/SelfAssessment.cs @@ -1532,22 +1532,6 @@ ManageOptionalCompetenciesViewModel model ); } } - var optionalCompetency = - (selfAssessmentService.GetCandidateAssessmentOptionalCompetencies(selfAssessmentId, delegateUserId)).Where(x => !x.IncludedInSelfAssessment); - if (optionalCompetency.Any()) - { - foreach (var optinal in optionalCompetency) - { - var selfAssessmentResults = selfAssessmentService.GetSelfAssessmentResultswithSupervisorVerificationsForDelegateSelfAssessmentCompetency(delegateUserId, selfAssessmentId, optinal.Id); - if (selfAssessmentResults.Any()) - { - foreach (var item in selfAssessmentResults) - { - selfAssessmentService.RemoveReviewCandidateAssessmentOptionalCompetencies(item.Id); - } - } - } - } if (model.GroupOptionalCompetenciesChecked != null) { var optionalCompetencies = diff --git a/DigitalLearningSolutions.Web/Services/SelfAssessmentService.cs b/DigitalLearningSolutions.Web/Services/SelfAssessmentService.cs index c9a50014fa..3bd04f0795 100644 --- a/DigitalLearningSolutions.Web/Services/SelfAssessmentService.cs +++ b/DigitalLearningSolutions.Web/Services/SelfAssessmentService.cs @@ -161,7 +161,6 @@ public IEnumerable GetSelfAssessmentResultswithSupervisorV int selfAssessmentId, int competencyId ); - void RemoveReviewCandidateAssessmentOptionalCompetencies(int id); } public class SelfAssessmentService : ISelfAssessmentService @@ -606,9 +605,6 @@ int competencyId { return selfAssessmentDataService.GetSelfAssessmentResultswithSupervisorVerificationsForDelegateSelfAssessmentCompetency(delegateUserId, selfAssessmentId, competencyId); } - public void RemoveReviewCandidateAssessmentOptionalCompetencies(int id) - { - selfAssessmentDataService.RemoveReviewCandidateAssessmentOptionalCompetencies(id); - } + } } From e27c8fb3ee980ab9e750bf08360fe1231c4206c7 Mon Sep 17 00:00:00 2001 From: sherif-olaboye <123654949+sherif-olaboye@users.noreply.github.com> Date: Thu, 17 Jul 2025 10:05:26 +0100 Subject: [PATCH 2/2] TD-5816 Issue clearing 'confirmation requests' of 'optional competencies' if removed/added some other 'optional' competencies --- DigitalLearningSolutions.Web/Services/SelfAssessmentService.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/DigitalLearningSolutions.Web/Services/SelfAssessmentService.cs b/DigitalLearningSolutions.Web/Services/SelfAssessmentService.cs index 3bd04f0795..fecd63b4dc 100644 --- a/DigitalLearningSolutions.Web/Services/SelfAssessmentService.cs +++ b/DigitalLearningSolutions.Web/Services/SelfAssessmentService.cs @@ -605,6 +605,5 @@ int competencyId { return selfAssessmentDataService.GetSelfAssessmentResultswithSupervisorVerificationsForDelegateSelfAssessmentCompetency(delegateUserId, selfAssessmentId, competencyId); } - } }