Skip to content

Commit 56898be

Browse files
authored
Merge pull request #2071 from TechnologyEnhancedLearning/Develop/Fixes/TD-1766-RemovedHyphenFromOtherPlacesAsPerTesting
TD-1766 Removing hyphen from all the places listed
2 parents 309597a + 4d698c9 commit 56898be

File tree

8 files changed

+160
-5
lines changed

8 files changed

+160
-5
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
using FluentMigrator;
2+
3+
namespace DigitalLearningSolutions.Data.Migrations
4+
{
5+
[Migration(202308161530)]
6+
public class AlterGetCompletedCoursesForCandidateSP : Migration
7+
{
8+
public override void Up()
9+
{
10+
Execute.Sql(Properties.Resources.TD_1766_GetCompletedCoursesForCandidateTweak);
11+
}
12+
public override void Down()
13+
{
14+
Execute.Sql(Properties.Resources.TD_1766_GetCompletedCoursesForCandidateTweak_down);
15+
}
16+
}
17+
}

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

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

DigitalLearningSolutions.Data.Migrations/Properties/Resources.resx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,4 +295,10 @@
295295
<data name="TermsAndConditionsOldrecord" type="System.Resources.ResXFileRef, System.Windows.Forms">
296296
<value>..\Resources\TermsAndConditionsOldrecord.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
297297
</data>
298-
</root>
298+
<data name="TD_1766_GetCompletedCoursesForCandidateTweak_down" type="System.Resources.ResXFileRef, System.Windows.Forms">
299+
<value>..\Scripts\TD-1766-GetCompletedCoursesForCandidateTweak_down.sql;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
300+
</data>
301+
<data name="TD_1766_GetCompletedCoursesForCandidateTweak" type="System.Resources.ResXFileRef, System.Windows.Forms">
302+
<value>..\Scripts\TD-1766-GetCompletedCoursesForCandidateTweak.sql;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
303+
</data>
304+
</root>
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/****** Object: StoredProcedure [dbo].[GetCompletedCoursesForCandidate] Script Date: 16/08/2023 12:17:34 ******/
2+
SET ANSI_NULLS ON
3+
GO
4+
5+
SET QUOTED_IDENTIFIER ON
6+
GO
7+
8+
-- =============================================
9+
-- Author: Kevin Whittaker
10+
-- Create date: 16/12/2016
11+
-- Description: Returns a list of completed courses for the candidate.
12+
-- 21/06/2021: Adds Applications.ArchivedDate field to output.
13+
-- =============================================
14+
ALTER PROCEDURE [dbo].[GetCompletedCoursesForCandidate]
15+
-- Add the parameters for the stored procedure here
16+
@CandidateID int
17+
AS
18+
BEGIN
19+
-- SET NOCOUNT ON added to prevent extra result sets from
20+
-- interfering with SELECT statements.
21+
SET NOCOUNT ON;
22+
23+
-- Insert statements for procedure here
24+
SELECT p.ProgressID, (CASE WHEN cu.CustomisationName <> '' THEN a.ApplicationName + ' - ' + cu.CustomisationName ELSE a.ApplicationName END) AS CourseName, p.CustomisationID, p.SubmittedTime AS LastAccessed, p.Completed,
25+
p.FirstSubmittedTime AS StartedDate, p.DiagnosticScore, p.PLLocked, cu.IsAssessed, dbo.CheckCustomisationSectionHasDiagnostic(p.CustomisationID, 0)
26+
AS HasDiagnostic, dbo.CheckCustomisationSectionHasLearning(p.CustomisationID, 0) AS HasLearning,
27+
COALESCE
28+
((SELECT COUNT(Passes) AS Passes
29+
FROM (SELECT COUNT(AssessAttemptID) AS Passes
30+
FROM AssessAttempts AS aa
31+
WHERE (CandidateID = p.CandidateID) AND (CustomisationID = p.CustomisationID) AND (Status = 1)
32+
GROUP BY SectionNumber) AS derivedtbl_2), 0) AS Passes,
33+
(SELECT COUNT(SectionID) AS Sections
34+
FROM Sections AS s
35+
WHERE (ApplicationID = cu.ApplicationID)) AS Sections, p.Evaluated, p.FollupUpEvaluated, a.ArchivedDate
36+
FROM Progress AS p INNER JOIN
37+
Customisations AS cu ON p.CustomisationID = cu.CustomisationID INNER JOIN
38+
Applications AS a ON cu.ApplicationID = a.ApplicationID
39+
WHERE (NOT (p.Completed IS NULL)) AND (p.CandidateID = @CandidateID)
40+
ORDER BY p.Completed DESC
41+
42+
END
43+
GO
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/****** Object: StoredProcedure [dbo].[GetCompletedCoursesForCandidate] Script Date: 16/08/2023 12:17:34 ******/
2+
SET ANSI_NULLS ON
3+
GO
4+
5+
SET QUOTED_IDENTIFIER ON
6+
GO
7+
8+
-- =============================================
9+
-- Author: Kevin Whittaker
10+
-- Create date: 16/12/2016
11+
-- Description: Returns a list of completed courses for the candidate.
12+
-- 21/06/2021: Adds Applications.ArchivedDate field to output.
13+
-- =============================================
14+
ALTER PROCEDURE [dbo].[GetCompletedCoursesForCandidate]
15+
-- Add the parameters for the stored procedure here
16+
@CandidateID int
17+
AS
18+
BEGIN
19+
-- SET NOCOUNT ON added to prevent extra result sets from
20+
-- interfering with SELECT statements.
21+
SET NOCOUNT ON;
22+
23+
-- Insert statements for procedure here
24+
SELECT p.ProgressID, a.ApplicationName + ' - ' + cu.CustomisationName AS CourseName, p.CustomisationID, p.SubmittedTime AS LastAccessed, p.Completed,
25+
p.FirstSubmittedTime AS StartedDate, p.DiagnosticScore, p.PLLocked, cu.IsAssessed, dbo.CheckCustomisationSectionHasDiagnostic(p.CustomisationID, 0)
26+
AS HasDiagnostic, dbo.CheckCustomisationSectionHasLearning(p.CustomisationID, 0) AS HasLearning,
27+
COALESCE
28+
((SELECT COUNT(Passes) AS Passes
29+
FROM (SELECT COUNT(AssessAttemptID) AS Passes
30+
FROM AssessAttempts AS aa
31+
WHERE (CandidateID = p.CandidateID) AND (CustomisationID = p.CustomisationID) AND (Status = 1)
32+
GROUP BY SectionNumber) AS derivedtbl_2), 0) AS Passes,
33+
(SELECT COUNT(SectionID) AS Sections
34+
FROM Sections AS s
35+
WHERE (ApplicationID = cu.ApplicationID)) AS Sections, p.Evaluated, p.FollupUpEvaluated, a.ArchivedDate
36+
FROM Progress AS p INNER JOIN
37+
Customisations AS cu ON p.CustomisationID = cu.CustomisationID INNER JOIN
38+
Applications AS a ON cu.ApplicationID = a.ApplicationID
39+
WHERE (NOT (p.Completed IS NULL)) AND (p.CandidateID = @CandidateID)
40+
ORDER BY p.Completed DESC
41+
42+
END
43+
GO

DigitalLearningSolutions.Data/Models/SectionContent/SectionContent.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public SectionContent(
6262
bool passwordSubmitted
6363
)
6464
{
65-
CourseTitle = $"{applicationName} - {customisationName}";
65+
CourseTitle = !String.IsNullOrEmpty(customisationName) ? $"{applicationName} - {customisationName}" : applicationName;
6666
CourseDescription = applicationInfo;
6767
SectionName = sectionName;
6868
HasLearning = hasLearning;

DigitalLearningSolutions.Data/Models/TutorialContent/TutorialContent.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
namespace DigitalLearningSolutions.Data.Models.TutorialContent
1+
using System;
2+
3+
namespace DigitalLearningSolutions.Data.Models.TutorialContent
24
{
35
public class TutorialContent
46
{
@@ -19,7 +21,7 @@ int currentVersion
1921
{
2022
TutorialName = tutorialName;
2123
SectionName = sectionName;
22-
CourseTitle = $"{applicationName} - {customisationName}";
24+
CourseTitle = !String.IsNullOrEmpty(customisationName) ? $"{applicationName} - {customisationName}" : applicationName;
2325
TutorialPath = tutorialPath;
2426
Version = currentVersion;
2527
}

DigitalLearningSolutions.Data/Models/TutorialContent/TutorialInformation.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ bool passwordSubmitted
7474
Id = id;
7575
Name = name;
7676
SectionName = sectionName;
77-
CourseTitle = $"{applicationName} - {customisationName}";
77+
CourseTitle = !String.IsNullOrEmpty(customisationName) ? $"{applicationName} - {customisationName}" : applicationName;
7878
CourseDescription = applicationInfo;
7979
Status = status;
8080
TimeSpent = timeSpent;

0 commit comments

Comments
 (0)