From b092a370f0cd51578b7212bde37995bf68fdd8d8 Mon Sep 17 00:00:00 2001 From: sherif-olaboye <123654949+sherif-olaboye@users.noreply.github.com> Date: Mon, 1 Jun 2026 16:05:43 +0100 Subject: [PATCH 1/3] TD-7342 Issue skipping navigating to the Select proficiencies to assess screen after selecting the framework from source --- .../CompetencyAssessments.cs | 11 ++++++-- .../SelectFrameworkSourcesViewModel.cs | 2 +- .../SelectFrameworkSources.cshtml | 27 ++++++++++++------- 3 files changed, 27 insertions(+), 13 deletions(-) diff --git a/DigitalLearningSolutions.Web/Controllers/CompetencyAssessmentsController/CompetencyAssessments.cs b/DigitalLearningSolutions.Web/Controllers/CompetencyAssessmentsController/CompetencyAssessments.cs index b353490b19..a599e16c08 100644 --- a/DigitalLearningSolutions.Web/Controllers/CompetencyAssessmentsController/CompetencyAssessments.cs +++ b/DigitalLearningSolutions.Web/Controllers/CompetencyAssessmentsController/CompetencyAssessments.cs @@ -438,6 +438,11 @@ public IActionResult SelectFrameworkSources(SelectFrameworkSourcesFormData model competencyAssessmentService.InsertSelfAssessmentFramework(adminId, competencyAssessmentId, model.FrameworkId.Value); return RedirectToAction("SelectFrameworkSources", new { competencyAssessmentId, actionName = "Summary" }); } + else if (actionName == "ViewSelected") + { + competencyAssessmentService.InsertSelfAssessmentFramework(adminId, competencyAssessmentId, model.FrameworkId.Value); + return RedirectToAction("ViewSelectedCompetencies", new { competencyAssessmentId }); + } else { competencyAssessmentService.UpdateFrameworkLinksTaskStatus(model.CompetencyAssessmentId, model.TaskStatus ?? false, null); @@ -484,7 +489,7 @@ public IActionResult ViewSelectedCompetencies(int competencyAssessmentId) var linkedFrameworks = competencyAssessmentService.GetLinkedFrameworksForCompetencyAssessment(competencyAssessmentId); if (!linkedFrameworks.Any()) { - return RedirectToAction("AddCompetenciesSelectFramework", new { competencyAssessmentId }); + return RedirectToAction("SelectFrameworkSources", new { competencyAssessmentId, actionName = "ViewSelected" }); } var adminId = GetAdminID(); var competencyAssessmentBase = competencyAssessmentService.GetCompetencyAssessmentBaseById(competencyAssessmentId, adminId); @@ -496,7 +501,8 @@ public IActionResult ViewSelectedCompetencies(int competencyAssessmentId) return View(model); } [Route("/Self-Assessment/{competencyAssessmentId}/Competencies/Add/SelectFramework")] - public IActionResult AddCompetenciesSelectFramework(int competencyAssessmentId) + [Route("/Self-Assessment/{competencyAssessmentId}/{actionName}/Competencies/Add/SelectFramework")] + public IActionResult AddCompetenciesSelectFramework(int competencyAssessmentId, string? actionName) { var linkedFrameworks = competencyAssessmentService.GetLinkedFrameworksForCompetencyAssessment(competencyAssessmentId); if (!linkedFrameworks.Any()) @@ -513,6 +519,7 @@ public IActionResult AddCompetenciesSelectFramework(int competencyAssessmentId) } [HttpPost] [Route("/Self-Assessment/{competencyAssessmentId}/Competencies/Add/SelectFramework")] + [Route("/Self-Assessment/{competencyAssessmentId}/{actionName}/Competencies/Add/SelectFramework")] public IActionResult AddCompetenciesSelectFramework(AddCompetenciesSelectFrameworkFormData formdata) { if (!ModelState.IsValid) diff --git a/DigitalLearningSolutions.Web/ViewModels/CompetencyAssessments/SelectFrameworkSourcesViewModel.cs b/DigitalLearningSolutions.Web/ViewModels/CompetencyAssessments/SelectFrameworkSourcesViewModel.cs index 8d1adea226..45ab4395e2 100644 --- a/DigitalLearningSolutions.Web/ViewModels/CompetencyAssessments/SelectFrameworkSourcesViewModel.cs +++ b/DigitalLearningSolutions.Web/ViewModels/CompetencyAssessments/SelectFrameworkSourcesViewModel.cs @@ -23,7 +23,7 @@ public SelectFrameworkSourcesViewModel(CompetencyAssessmentBase competencyAssess Frameworks = [.. frameworks .Where(f => !excludedIds.Contains(f.ID)) .OrderBy(f => f.FrameworkName)]; - AdditionalFrameworks = [.. additionalFrameworksIds.Select(id => frameworks.First(f => f.ID == id))]; + AdditionalFrameworks = [.. additionalFrameworksIds.Select(id => frameworks.FirstOrDefault(f => f.ID == id))]; ActionName = actionName; } public IEnumerable Frameworks { get; set; } diff --git a/DigitalLearningSolutions.Web/Views/CompetencyAssessments/SelectFrameworkSources.cshtml b/DigitalLearningSolutions.Web/Views/CompetencyAssessments/SelectFrameworkSources.cshtml index 277228e2f2..34e76e560d 100644 --- a/DigitalLearningSolutions.Web/Views/CompetencyAssessments/SelectFrameworkSources.cshtml +++ b/DigitalLearningSolutions.Web/Views/CompetencyAssessments/SelectFrameworkSources.cshtml @@ -73,16 +73,19 @@ } } - @if (Model.AdditionalFrameworks.Count() > 0) + @if (Model?.AdditionalFrameworks != null && Model.AdditionalFrameworks.Any()) { - for (int i = 0; i < Model.AdditionalFrameworks.Count(); i++) + int i = 0; + foreach (var framework in Model.AdditionalFrameworks) { + if (framework == null) continue; // Safety check in case an item in the list is null +
Additional framework @(i + 1)
- @Model.AdditionalFrameworks.ElementAt(i).FrameworkName + @framework.FrameworkName
@if (Model.UserRole > 1) { @@ -90,28 +93,32 @@ }
+ i++; } } + else + { +

No additional frameworks available.

+ } } -@if (Model.ActionName == "AddFramework") +@if (Model.ActionName == "AddFramework" || Model.ActionName == "ViewSelected") {
From 6505e53638c35baf576167304e06c1f93d6998f1 Mon Sep 17 00:00:00 2001 From: sherif-olaboye <123654949+sherif-olaboye@users.noreply.github.com> Date: Mon, 1 Jun 2026 16:14:12 +0100 Subject: [PATCH 2/3] TD-7342 Issue skipping navigating to the Select proficiencies to assess screen after selecting the framework from source --- .../Views/CompetencyAssessments/SelectFrameworkSources.cshtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DigitalLearningSolutions.Web/Views/CompetencyAssessments/SelectFrameworkSources.cshtml b/DigitalLearningSolutions.Web/Views/CompetencyAssessments/SelectFrameworkSources.cshtml index 34e76e560d..b6d7b9e7dd 100644 --- a/DigitalLearningSolutions.Web/Views/CompetencyAssessments/SelectFrameworkSources.cshtml +++ b/DigitalLearningSolutions.Web/Views/CompetencyAssessments/SelectFrameworkSources.cshtml @@ -78,7 +78,7 @@ int i = 0; foreach (var framework in Model.AdditionalFrameworks) { - if (framework == null) continue; // Safety check in case an item in the list is null + if (framework == null) continue;
From b3a5ee4494763a08b124618fd909cfa25bdc336f Mon Sep 17 00:00:00 2001 From: sherif-olaboye <123654949+sherif-olaboye@users.noreply.github.com> Date: Mon, 1 Jun 2026 16:30:53 +0100 Subject: [PATCH 3/3] TD-7342 Issue skipping navigating to the Select proficiencies to assess screen after selecting the framework from source --- .../Views/CompetencyAssessments/SelectFrameworkSources.cshtml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/DigitalLearningSolutions.Web/Views/CompetencyAssessments/SelectFrameworkSources.cshtml b/DigitalLearningSolutions.Web/Views/CompetencyAssessments/SelectFrameworkSources.cshtml index b6d7b9e7dd..d0af8f724a 100644 --- a/DigitalLearningSolutions.Web/Views/CompetencyAssessments/SelectFrameworkSources.cshtml +++ b/DigitalLearningSolutions.Web/Views/CompetencyAssessments/SelectFrameworkSources.cshtml @@ -112,10 +112,6 @@ i++; } } - else - { -

No additional frameworks available.

- } } @if (Model.ActionName == "AddFramework" || Model.ActionName == "ViewSelected")