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
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
Layout = "SelfAssessments/_Layout";
ViewData["Title"] = "Self Assessment";
ViewData["SelfAssessmentTitle"] = Model.SelfAssessment.Name;
var selfAssessedTotal = 0;
var verifiedTotal = 0;
var questionsTotal = 0;
}
@section breadcrumbs {
<li class="nhsuk-breadcrumb__item">
Expand Down Expand Up @@ -35,9 +38,22 @@
{
foreach (var competencyGroup in Model.CompetencyGroups)
{
var questions = competencyGroup.SelectMany(c => c.AssessmentQuestions).Where(q => q.Required);
var selfAssessedCount = questions.Count(q => q.ResultId.HasValue);
var verifiedCount = questions.Count(q => q.Verified.HasValue);
var competencySummaryViewData = new ViewDataDictionary(ViewData)
{
{ "isSupervisorResultsReviewed", Model.SelfAssessment.IsSupervisorResultsReviewed },
{ "questionsCount", questions.Count() },
{ "selfAssessedCount", selfAssessedCount },
{ "verifiedCount", verifiedCount }
};
selfAssessedTotal += selfAssessedCount;
verifiedTotal += verifiedCount;
questionsTotal += questions.Count();
<div class="nhsuk-panel competency-group-panel nhsuk-u-padding-0">
@{
var expanderOpen = Model.CompetencyGroups.Count() == 1
var expanderOpen = Model.CompetencyGroups.Count() == 1
? "open"
: ViewContext.RouteData.Values.ContainsKey("competencyGroupId")
? ViewContext.RouteData.Values["competencyGroupId"].Equals(competencyGroup.First().CompetencyGroupID.ToString()) ? "open" : ""
Expand All @@ -50,8 +66,7 @@
</span>
</summary>
<div class="nhsuk-details__text">
<partial name="SelfAssessments/_CompetencySummary"
view-data="@(new ViewDataDictionary(ViewData) { { "competencyGroup", competencyGroup }, { "selfAssessment", Model.SelfAssessment } })" />
<partial name="SelfAssessments/_CompetencySummary" view-data="@competencySummaryViewData" />

@if (Model.SelfAssessment.LinearNavigation)
{
Expand All @@ -66,8 +81,7 @@
</div>
</details>
<div class="outer-score-container">
<partial name="SelfAssessments/_CompetencySummary"
view-data="@(new ViewDataDictionary(ViewData) { { "competencyGroup", competencyGroup }, { "selfAssessment", Model.SelfAssessment } })" />
<partial name="SelfAssessments/_CompetencySummary" view-data="@competencySummaryViewData" />
</div>
@if (Model.SelfAssessment.LinearNavigation)
{
Expand Down Expand Up @@ -109,6 +123,14 @@
@if (Model.SelfAssessment.IsSupervised)
{
<div class="nhsuk-panell competency-group-panel nhsuk-u-padding-4">
<h2>Overall Progress</h2>
<p class="nhsuk-body-l">
<span class="score">Self assessed: @selfAssessedTotal / @questionsTotal</span>
@if (Model.SelfAssessment.IsSupervisorResultsReviewed)
{
<span class="score">Confirmed: @verifiedTotal / @questionsTotal</span>
}
</p>
<h2>@Model.SelfAssessment.SignOffRoleName Sign-off</h2>
<partial name="../../Supervisor/Shared/_SupervisorSignOffSummary.cshtml" model="Model.SupervisorSignOffs" />
@if (Model.AllQuestionsVerifiedOrNotRequired())
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
@using DigitalLearningSolutions.Data.Models.SelfAssessments
@{
var selfAssessment = (CurrentSelfAssessment)ViewData["selfAssessment"];
var questions = ((IGrouping<string, Competency>)ViewData["competencyGroup"])
.SelectMany(c => c.AssessmentQuestions)
.Where(q => q.Required);
var selfAssessed = questions.Count(q => q.ResultId.HasValue);
var verified = questions.Count(q => q.Verified.HasValue);
@{
var isSupervisorResultsReviewed = (bool)ViewData["isSupervisorResultsReviewed"];
var questionsCount = (int)ViewData["questionsCount"];
var selfAssessedCount = (int)ViewData["selfAssessedCount"];
var verifiedCount = (int)ViewData["verifiedCount"];
}

<span class="score">
Self assessed: @selfAssessed / @questions.Count()
Self assessed: @selfAssessedCount / @questionsCount
</span>
<br />
@if (selfAssessment.IsSupervisorResultsReviewed)
@if (isSupervisorResultsReviewed)
Copy link
Contributor

@kevwhitt-hee kevwhitt-hee Mar 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs applying to the overall summary. Currently, the confirmed summary is always shown (this is a self assessment where isSupervisorResultsReviewed == false):
image

{
<span class="score">
Confirmed: @verified / @questions.Count()
Confirmed: @verifiedCount / @questionsCount
</span>
<br />
}
<br />
2 changes: 1 addition & 1 deletion DigitalLearningSolutions.Web/appsettings.Development.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"ConnectionStrings": {
"DefaultConnection": "Data Source=localhost;Initial Catalog=mbdbx101;Integrated Security=True;"
"DefaultConnection": "Data Source=ACER\\SQLEXPRESS;Initial Catalog=mbdbx101;Integrated Security=True;"
},
"CurrentSystemBaseUrl": "https://localhost:44367",
"AppRootPath": "https://localhost:44363",
Expand Down
2 changes: 1 addition & 1 deletion DigitalLearningSolutions.Web/appsettings.SIT.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"AllowedHosts": "*",
"ConnectionStrings": {
"DefaultConnection": "Data Source=localhost;Initial Catalog=mbdbx101_test;Integrated Security=True;"
"DefaultConnection": "Data Source=ACER\\SQLEXPRESS;Initial Catalog=mbdbx101_test;Integrated Security=True;"
},
"CurrentSystemBaseUrl": "https://localhost:44367",
"AppRootPath": "https://localhost:44363",
Expand Down
2 changes: 1 addition & 1 deletion DigitalLearningSolutions.Web/appsettings.Test.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"AllowedHosts": "*",
"ConnectionStrings": {
"DefaultConnection": "Data Source=localhost;Initial Catalog=mbdbx101;Integrated Security=True;"
"DefaultConnection": "Data Source=ACER\\SQLEXPRESS;Initial Catalog=mbdbx101_test;Integrated Security=True;"
},
"CurrentSystemBaseUrl": "https://www.dls.nhs.uk/dev-prev",
"AppRootPath": "https://hee-dls-test.softwire.com",
Expand Down
4 changes: 2 additions & 2 deletions DigitalLearningSolutions.Web/appsettings.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"AllowedHosts": "*",
"ConnectionStrings": {
"DefaultConnection": "Data Source=localhost;Initial Catalog=mbdbx101;Integrated Security=True;",
"UnitTestConnection": "Data Source=localhost;Initial Catalog=mbdbx101_test;Integrated Security=True;"
"DefaultConnection": "Data Source=ACER\\SQLEXPRESS;Initial Catalog=mbdbx101;Integrated Security=True;",
"UnitTestConnection": "Data Source=ACER\\SQLEXPRESS;Initial Catalog=mbdbx101_test;Integrated Security=True;"
},
"CurrentSystemBaseUrl": "https://www.dls.nhs.uk",
"AppRootPath": "https://localhost:44363",
Expand Down