Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 23 additions & 5 deletions DigitalLearningSolutions.Data/DataServices/SessionDataService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,32 +254,35 @@
}
</tbody>
</table>
<h2 class="heading2">Achievements</h2>
<h4 class="heading4">The following post learning assessments have been passed:</h4>
<br />
<table role="table" class="table table-striped nhsuk-lede-text--small">
<tr>
<th align="left">
Assessment
</th>
<th align="left">
Outcome
</th>
</tr>
<tbody>
@foreach (var entry in Model.SectionDetails.Where(pass => pass.PLPassed))
{
<tr>
<td>
@entry.SectionName
</td>
<td style="color:#0e6935;font-weight:normal;">
@("PASSED")
</td>
</tr>
}
</tbody>
</table>
@if (Model.SectionDetails.Where(pass => pass.PLPassed).Any())
{
<h2 class="heading2">Achievements</h2>
<h4 class="heading4">The following post learning assessments have been passed:</h4>
<br />
<table role="table" class="table table-striped nhsuk-lede-text--small">
<tr>
<th align="left">
Assessment
</th>
<th align="left">
Outcome
</th>
</tr>
<tbody>
@foreach (var entry in Model.SectionDetails.Where(pass => pass.PLPassed))
{
<tr>
<td>
@entry.SectionName
</td>
<td style="color:#0e6935;font-weight:normal;">
@("PASSED")
</td>
</tr>
}
</tbody>
</table>
}
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -212,36 +212,39 @@
}
</tbody>
</table>
<div style="height:20px"></div>
<h2 class="heading2">Achievements</h2>
<h4 class="heading4">The following post learning assessments have been passed:</h4>
<table class="nhsuk-table-responsive">
<thead class="nhsuk-table__head">
<tr class="nhsuk-table__row" role="row">
<th class="nhsuk-table__header" role="columnheader" scope="col">
Assessment
</th>
<th class="nhsuk-table__header" role="columnheader" scope="col">
Outcome
</th>
</tr>
</thead>
<tbody class="nhsuk-table__body">
@foreach (var entry in Model.SectionDetails.Where(pass => pass.PLPassed))
{
<tr class="nhsuk-table__row">
<td class="nhsuk-table__cell" data-label="Assessment" role="cell">
<span class="nhsuk-table-responsive__heading">Assessment</span>
@entry.SectionName
</td>
<td class="nhsuk-table__cell" data-label="Outcome" role="cell">
<span class="nhsuk-table-responsive__heading">Outcome</span>
<span style="color:#0e6935;font-weight:normal;">@("PASSED")</span>
</td>
@if (Model.SectionDetails.Where(pass => pass.PLPassed).Any())
{
<div style="height:20px"></div>
<h2 class="heading2">Achievements</h2>
<h4 class="heading4">The following post learning assessments have been passed:</h4>
<table class="nhsuk-table-responsive">
<thead class="nhsuk-table__head">
<tr class="nhsuk-table__row" role="row">
<th class="nhsuk-table__header" role="columnheader" scope="col">
Assessment
</th>
<th class="nhsuk-table__header" role="columnheader" scope="col">
Outcome
</th>
</tr>
}
</tbody>
</table>
</thead>
<tbody class="nhsuk-table__body">
@foreach (var entry in Model.SectionDetails.Where(pass => pass.PLPassed))
{
<tr class="nhsuk-table__row">
<td class="nhsuk-table__cell" data-label="Assessment" role="cell">
<span class="nhsuk-table-responsive__heading">Assessment</span>
@entry.SectionName
</td>
<td class="nhsuk-table__cell" data-label="Outcome" role="cell">
<span class="nhsuk-table-responsive__heading">Outcome</span>
<span style="color:#0e6935;font-weight:normal;">@("PASSED")</span>
</td>
</tr>
}
</tbody>
</table>
}
</div>
</div>
</div>
Expand Down
Loading