diff --git a/DigitalLearningSolutions.Data/DataServices/SessionDataService.cs b/DigitalLearningSolutions.Data/DataServices/SessionDataService.cs index c7c0cd0d12..3cc404004f 100644 --- a/DigitalLearningSolutions.Data/DataServices/SessionDataService.cs +++ b/DigitalLearningSolutions.Data/DataServices/SessionDataService.cs @@ -57,11 +57,29 @@ public void StopDelegateSession(int candidateId) public int UpdateDelegateSessionDuration(int sessionId, DateTime currentUtcTime) { - return connection.Execute( - @"UPDATE Sessions SET Duration = DATEDIFF(minute, LoginTime, @currentUtcTime) - WHERE [SessionID] = @sessionId AND Active = 1;", - new { sessionId, currentUtcTime } - ); + int retryCount = 3; + bool success = false; + var rowsCount = 0; + while (retryCount > 0 && !success) + { + try + { + rowsCount = connection.Execute( + @"UPDATE Sessions SET Duration = DATEDIFF(minute, LoginTime, @currentUtcTime) + WHERE [SessionID] = @sessionId AND Active = 1;", + new { sessionId, currentUtcTime }); + success = true; + } + catch (Exception) + { + retryCount--; + if (retryCount == 0) + { + throw; + } + } + } + return rowsCount; } public int StartAdminSession(int adminId) diff --git a/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/DelegateProgress/DownloadProgress.cshtml b/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/DelegateProgress/DownloadProgress.cshtml index 425d268dd4..4166b353aa 100644 --- a/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/DelegateProgress/DownloadProgress.cshtml +++ b/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/DelegateProgress/DownloadProgress.cshtml @@ -254,32 +254,35 @@ } -

Achievements

-

The following post learning assessments have been passed:

-
- - - - - - - @foreach (var entry in Model.SectionDetails.Where(pass => pass.PLPassed)) - { - - - - - } - -
- Assessment - - Outcome -
- @entry.SectionName - - @("PASSED") -
+ @if (Model.SectionDetails.Where(pass => pass.PLPassed).Any()) + { +

Achievements

+

The following post learning assessments have been passed:

+
+ + + + + + + @foreach (var entry in Model.SectionDetails.Where(pass => pass.PLPassed)) + { + + + + + } + +
+ Assessment + + Outcome +
+ @entry.SectionName + + @("PASSED") +
+ } diff --git a/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/DelegateProgress/ViewDelegateProgress.cshtml b/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/DelegateProgress/ViewDelegateProgress.cshtml index d982f93511..da6fa33022 100644 --- a/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/DelegateProgress/ViewDelegateProgress.cshtml +++ b/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/DelegateProgress/ViewDelegateProgress.cshtml @@ -42,15 +42,15 @@ } /*.p-4 { - padding: 1.5rem !important - } + padding: 1.5rem !important + } - #Logo { - max-width: 500px; - max-height: 90px; - height: auto; - width: auto; - }*/ + #Logo { + max-width: 500px; + max-height: 90px; + height: auto; + width: auto; + }*/ .heading2 { font-size: 2rem; @@ -212,36 +212,39 @@ } -
-

Achievements

-

The following post learning assessments have been passed:

- - - - - - - - - @foreach (var entry in Model.SectionDetails.Where(pass => pass.PLPassed)) - { - - - + @if (Model.SectionDetails.Where(pass => pass.PLPassed).Any()) + { +
+

Achievements

+

The following post learning assessments have been passed:

+
- Assessment - - Outcome -
- Assessment - @entry.SectionName - - Outcome - @("PASSED") -
+ + + + - } - -
+ Assessment + + Outcome +
+ + + @foreach (var entry in Model.SectionDetails.Where(pass => pass.PLPassed)) + { + + + Assessment + @entry.SectionName + + + Outcome + @("PASSED") + + + } + + + }