Skip to content

Commit 429a2ea

Browse files
authored
Merge pull request #2809 from TechnologyEnhancedLearning/Develop/Fixes/TD-4243-Resolvingduplicateofcourses
Develop/fixes/td 4243 resolving duplicate of courses in enrol activity, available activities and current activities
2 parents 335495b + 5e5ccec commit 429a2ea

File tree

4 files changed

+21
-19
lines changed

4 files changed

+21
-19
lines changed

DigitalLearningSolutions.Data.Migrations/202408271645_AlterAvailableandCompletedCoursesForDelegate.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,20 @@ namespace DigitalLearningSolutions.Data.Migrations
44
{
55
using FluentMigrator;
66

7-
[Migration(202408271645)]
7+
[Migration(202409031645)]
88
public class AlterAvailableandCompletedCoursesForDelegate : Migration
99
{
1010
public override void Up()
1111
{
1212
Execute.Sql(Properties.Resources.TD_4243_Alter_GetActivitiesForDelegateEnrolment_proc_up);
1313
Execute.Sql(Properties.Resources.TD_4243_Alter_GetCompletedCoursesForCandidate_proc_up);
14+
Execute.Sql(Properties.Resources.TD_4243_Alter_GetCurrentCoursesForCandidate_V2_proc_up);
1415
}
1516
public override void Down()
1617
{
1718
Execute.Sql(Properties.Resources.TD_4243_Alter_GetActivitiesForDelegateEnrolment_proc_down);
1819
Execute.Sql(Properties.Resources.TD_4243_Alter_GetCompletedCoursesForCandidate_proc_down);
20+
Execute.Sql(Properties.Resources.TD_4243_Alter_GetCurrentCoursesForCandidate_V2_proc_down);
1921
}
2022
}
2123
}

DigitalLearningSolutions.Data.Migrations/Properties/Resources.Designer.cs

Lines changed: 16 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

DigitalLearningSolutions.Data.Migrations/Resources/TD-4243_Alter_GetActivitiesForDelegateEnrolment_proc_up.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ AS
2323
SET NOCOUNT ON;
2424
SELECT * FROM
2525
-- Insert statements for procedure here
26-
(SELECT cu.CustomisationID, cu.Active, cu.CurrentVersion, cu.CentreID, cu.ApplicationID, (CASE WHEN cu.CustomisationName <> '' THEN a.ApplicationName + ' - ' + cu.CustomisationName ELSE a.ApplicationName END) AS CourseName, cu.CustomisationText, 0 AS IncludesSignposting, 0 AS IsSelfAssessment, cu.SelfRegister AS SelfRegister,
26+
(SELECT DISTINCT cu.CustomisationID, cu.Active, cu.CurrentVersion, cu.CentreID, cu.ApplicationID, (CASE WHEN cu.CustomisationName <> '' THEN a.ApplicationName + ' - ' + cu.CustomisationName ELSE a.ApplicationName END) AS CourseName, cu.CustomisationText, 0 AS IncludesSignposting, 0 AS IsSelfAssessment, cu.SelfRegister AS SelfRegister,
2727
cu.IsAssessed, dbo.CheckCustomisationSectionHasDiagnostic(cu.CustomisationID, 0) AS HasDiagnostic,
2828
dbo.CheckCustomisationSectionHasLearning(cu.CustomisationID, 0) AS HasLearning, (SELECT BrandName FROM Brands WHERE BrandID = a.BrandID) AS Brand, (SELECT CategoryName FROM CourseCategories WHERE CourseCategoryID = a.CourseCategoryID) AS Category, (SELECT CourseTopic FROM CourseTopics WHERE CourseTopicID = a.CourseTopicID) AS Topic, dbo.CheckDelegateStatusForCustomisation(cu.CustomisationID, @DelegateID) AS DelegateStatus,
2929
cu.HideInLearnerPortal

DigitalLearningSolutions.Data.Migrations/Resources/TD-4243_Alter_GetCurrentCoursesForCandidate_V2_proc_up.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ BEGIN
2323
SET NOCOUNT ON;
2424

2525
-- Insert statements for procedure here
26-
SELECT p.ProgressID, (CASE WHEN cu.CustomisationName <> '' THEN a.ApplicationName + ' - ' + cu.CustomisationName ELSE a.ApplicationName END) AS CourseName, p.CustomisationID, p.SubmittedTime AS LastAccessed,
26+
SELECT DISTINCT p.ProgressID, (CASE WHEN cu.CustomisationName <> '' THEN a.ApplicationName + ' - ' + cu.CustomisationName ELSE a.ApplicationName END) AS CourseName, p.CustomisationID, p.SubmittedTime AS LastAccessed,
2727
p.FirstSubmittedTime AS StartedDate, p.DiagnosticScore, p.PLLocked, cu.IsAssessed, dbo.CheckCustomisationSectionHasDiagnostic(p.CustomisationID, 0)
2828
AS HasDiagnostic, dbo.CheckCustomisationSectionHasLearning(p.CustomisationID, 0) AS HasLearning,
2929
COALESCE

0 commit comments

Comments
 (0)