Skip to content

Commit d99fd62

Browse files
authored
Merge pull request #2448 from TechnologyEnhancedLearning/Develop/fix/TD-1988-All-centre-learners-progress-on-DCSA
TD-1988- Show all centre learners progress on DCSA reports, regardless of which centre enrolled
2 parents e106cef + 5361435 commit d99fd62

File tree

3 files changed

+14
-18
lines changed

3 files changed

+14
-18
lines changed

DigitalLearningSolutions.Data/DataServices/SelfAssessmentDataService/DCSAReportDataService.cs

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88

99
public interface IDCSAReportDataService
1010
{
11-
IEnumerable<DCSADelegateCompletionStatus> GetDelegateCompletionStatusForCentre(int centreId);
12-
IEnumerable<DCSAOutcomeSummary> GetOutcomeSummaryForCentre(int centreId);
11+
IEnumerable<DCSADelegateCompletionStatus> GetDelegateCompletionStatus();
12+
IEnumerable<DCSAOutcomeSummary> GetOutcomeSummary();
1313
}
1414
public partial class DCSAReportDataService : IDCSAReportDataService
1515
{
@@ -21,7 +21,7 @@ public DCSAReportDataService(IDbConnection connection, ILogger<SelfAssessmentDat
2121
this.connection = connection;
2222
this.logger = logger;
2323
}
24-
public IEnumerable<DCSAOutcomeSummary> GetOutcomeSummaryForCentre(int centreId)
24+
public IEnumerable<DCSAOutcomeSummary> GetOutcomeSummary()
2525
{
2626
return connection.Query<DCSAOutcomeSummary>(
2727
@"SELECT DATEPART(month, caa.StartedDate) AS EnrolledMonth, DATEPART(yyyy, caa.StartedDate) AS EnrolledYear, jg.JobGroupName AS JobGroup, ca.Answer1 AS CentreField1, ca.Answer2 AS CentreField2, ca.Answer3 AS CentreField3, CASE WHEN (caa.SubmittedDate IS NOT NULL)
@@ -107,24 +107,20 @@ FROM SelfAssessmentResults AS sar INNER JOIN
107107
FROM Candidates AS ca INNER JOIN
108108
CandidateAssessments AS caa ON ca.UserID = caa.DelegateUserID AND ca.CentreID = caa.CentreID INNER JOIN Users AS u ON caa.DelegateUserID = u.ID INNER JOIN
109109
JobGroups AS jg ON u.JobGroupID = jg.JobGroupID
110-
WHERE (ca.Active = 1) AND (ca.CentreID = @centreId) AND (caa.SelfAssessmentID = 1)
111-
ORDER BY EnrolledYear DESC, EnrolledMonth DESC, JobGroup, CentreField1, CentreField2, CentreField3, Status",
112-
new { centreId }
113-
);
110+
WHERE (ca.Active = 1) AND (caa.SelfAssessmentID = 1)
111+
ORDER BY EnrolledYear DESC, EnrolledMonth DESC, JobGroup, CentreField1, CentreField2, CentreField3, Status");
114112
}
115113

116-
public IEnumerable<DCSADelegateCompletionStatus> GetDelegateCompletionStatusForCentre(int centreId)
114+
public IEnumerable<DCSADelegateCompletionStatus> GetDelegateCompletionStatus()
117115
{
118116
return connection.Query<DCSADelegateCompletionStatus>(
119117
@"SELECT DATEPART(month, caa.StartedDate) AS EnrolledMonth, DATEPART(yyyy, caa.StartedDate) AS EnrolledYear, ca.FirstName, ca.LastName, ca.EmailAddress AS Email, ca.Answer1 AS CentreField1, ca.Answer2 AS CentreField2, ca.Answer3 AS CentreField3, CASE WHEN (caa.SubmittedDate IS NOT NULL)
120118
THEN 'Submitted' WHEN (caa.UserBookmark LIKE N'/LearningPortal/SelfAssessment/1/Review' AND caa.SubmittedDate IS NULL) THEN 'Reviewing' ELSE 'Incomplete' END AS Status
121119
FROM Candidates AS ca INNER JOIN
122120
CandidateAssessments AS caa ON ca.UserID = caa.DelegateUserID AND ca.CentreID = caa.CentreID INNER JOIN
123121
JobGroups AS jg ON ca.JobGroupID = jg.JobGroupID
124-
WHERE (ca.Active = 1) AND (ca.CentreID = @centreId) AND caa.NonReportable = 0
125-
ORDER BY EnrolledYear DESC, EnrolledMonth DESC, ca.LastName, ca.FirstName",
126-
new { centreId }
127-
);
122+
WHERE (ca.Active = 1) AND (caa.SelfAssessmentID = 1) AND caa.NonReportable = 0
123+
ORDER BY EnrolledYear DESC, EnrolledMonth DESC, ca.LastName, ca.FirstName");
128124
}
129125
}
130126
}

DigitalLearningSolutions.Web/Controllers/TrackingSystem/Centre/SelfAssessmentReports/SelfAssessmentReportsController.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ public IActionResult Index()
4242
public IActionResult DownloadDigitalCapabilityToExcel()
4343
{
4444
var centreId = User.GetCentreIdKnownNotNull();
45-
var dataFile = selfAssessmentReportService.GetDigitalCapabilityExcelExportForCentre(centreId);
46-
var fileName = $"DLS DSAT Report - Centre {centreId} - downloaded {clockUtility.UtcToday:yyyy-MM-dd}.xlsx";
45+
var dataFile = selfAssessmentReportService.GetDigitalCapabilityExcelExport();
46+
var fileName = $"DLS DSAT Report - downloaded {clockUtility.UtcToday:yyyy-MM-dd}.xlsx";
4747
return File(
4848
dataFile,
4949
FileHelper.GetContentTypeFromFileName(fileName),

DigitalLearningSolutions.Web/Services/SelfAssessmentReportService.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
public interface ISelfAssessmentReportService
1313
{
14-
byte[] GetDigitalCapabilityExcelExportForCentre(int centreId);
14+
byte[] GetDigitalCapabilityExcelExport();
1515
byte[] GetSelfAssessmentExcelExportForCentre(int centreId, int selfAssessmentId);
1616
IEnumerable<SelfAssessmentSelect> GetSelfAssessmentsForReportList(int centreId, int? categoryId);
1717
}
@@ -34,10 +34,10 @@ private static void AddSheetToWorkbook(IXLWorkbook workbook, string sheetName, I
3434
table.Theme = XLTableTheme.TableStyleLight9;
3535
sheet.Columns().AdjustToContents();
3636
}
37-
public byte[] GetDigitalCapabilityExcelExportForCentre(int centreId)
37+
public byte[] GetDigitalCapabilityExcelExport()
3838
{
39-
var delegateCompletionStatus = dcsaReportDataService.GetDelegateCompletionStatusForCentre(centreId);
40-
var outcomeSummary = dcsaReportDataService.GetOutcomeSummaryForCentre(centreId);
39+
var delegateCompletionStatus = dcsaReportDataService.GetDelegateCompletionStatus();
40+
var outcomeSummary = dcsaReportDataService.GetOutcomeSummary();
4141
var summary = delegateCompletionStatus.Select(
4242
x => new
4343
{

0 commit comments

Comments
 (0)