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 @@ } -
| - Assessment - | -- Outcome - | -
|---|---|
| - @entry.SectionName - | -- @("PASSED") - | -
| + Assessment + | ++ Outcome + | +
|---|---|
| + @entry.SectionName + | ++ @("PASSED") + | +
| - Assessment - | -- Outcome - | -||
|---|---|---|---|
| - Assessment - @entry.SectionName - | -- Outcome - @("PASSED") - | + @if (Model.SectionDetails.Where(pass => pass.PLPassed).Any()) + { + +
| + Assessment + | ++ Outcome + |
|---|