Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
75d3633
Bump webpack from 5.90.3 to 5.94.0 in /DigitalLearningSolutions.Web
dependabot[bot] Sep 5, 2024
67f6053
Bump micromatch from 4.0.5 to 4.0.8 in /DigitalLearningSolutions.Web
dependabot[bot] Sep 9, 2024
56e3913
Bump braces from 3.0.2 to 3.0.3 in /DigitalLearningSolutions.Web
dependabot[bot] Sep 9, 2024
3a8ce1c
Bump Microsoft.Data.SqlClient in /DigitalLearningSolutions.Data.Tests
dependabot[bot] Sep 9, 2024
c333cf0
Bump dompurify from 2.4.7 to 2.5.4 in /DigitalLearningSolutions.Web
dependabot[bot] Sep 16, 2024
aebc2f8
TD-4881 Limit the supervisor My Staff view self assessment counts to …
sherif-olaboye Oct 29, 2024
4e3a37a
TD-4879 Limit the self assessments returned in Delegate Activities by…
sherif-olaboye Oct 24, 2024
108c416
TD-4879 Limit the self assessments returned in Delegate Activities by…
sherif-olaboye Oct 24, 2024
00121d9
TD-4882-RoleProfiles retrieved based on logged in supervisor category
Auldrin-Possa Oct 25, 2024
1ef51ab
TD-4878-Retrieved supervisor list based on Category ID
Auldrin-Possa Oct 24, 2024
090f6b7
TD-4883- Returning self-assessments for a supervisor delegate based o…
Auldrin-Possa Oct 29, 2024
8b71e51
TD-4887- SQL query modified to return supervisors based on self-asses…
Auldrin-Possa Oct 29, 2024
2b18b5c
TD-4887-code optimized
Auldrin-Possa Oct 30, 2024
ac97935
TD-4888-Removed unused parameter 'centreId' from the service method
Auldrin-Possa Oct 30, 2024
efab4f3
TD-4972-added comparison of supervisor CategoryID with self-assessmen…
Auldrin-Possa Oct 30, 2024
416c914
Update pull_request_template.md
kevwhitt-hee Oct 31, 2024
efeae28
TD-4974-Sign off supervisors list filtered based on category
Auldrin-Possa Oct 31, 2024
2984002
TD-4975-Todo items for requested signoffs/confirmation are filtered b…
Auldrin-Possa Nov 1, 2024
54c1545
TD-4889 When a supervisor promotes a learner to the Nominated supervi…
sherif-olaboye Nov 4, 2024
385fafb
TD-4973 Limit the list of supervisors in the Request proficiency conf…
sherif-olaboye Nov 5, 2024
4ee8462
TD-4884 Prevent supervisors from viewing/reviewing self assessments i…
sherif-olaboye Nov 6, 2024
00601d7
TD-4884 Resolved git build error
sherif-olaboye Nov 6, 2024
170c5e2
TD-5020 Resolving build failure
rshrirohit Nov 7, 2024
65d36c9
TD-4880- Prevent administrators from viewing Activity Delegates for s…
ABSinhaa Nov 7, 2024
43c8c53
TD-4880- undoing Sherif's change for the task TD-4879 since it was su…
ABSinhaa Nov 8, 2024
d524ddc
TD-4884 Prevent supervisors from viewing/reviewing self assessments i…
sherif-olaboye Nov 13, 2024
ab2a18a
Merge pull request #2942 from TechnologyEnhancedLearning/Develop/Feat…
kevwhitt-hee Nov 14, 2024
910e5e7
TD-4974-Appended table alias to 'CategoryID' field
Auldrin-Possa Nov 14, 2024
4210c3a
TD-4327-Supervisor delegate validation added
Auldrin-Possa Nov 14, 2024
5cbd72f
Merge pull request #2944 from TechnologyEnhancedLearning/Develop/feat…
kevwhitt-hee Nov 21, 2024
d836e4b
Merge pull request #2946 from TechnologyEnhancedLearning/Develop/Fix/…
kevwhitt-hee Nov 21, 2024
e859177
Merge branch 'release-v1.0.0' into DLS-Release-v1.1.0
kevwhitt-hee Nov 22, 2024
73acb59
Resolves merge conflicts in Resources.resx
kevwhitt-hee Nov 22, 2024
01259c3
Squashed commit of the following:
kevwhitt-hee Nov 25, 2024
d9c9b6b
Removes migration causing an error in production data during deployment
kevwhitt-hee Nov 27, 2024
49d6df1
Merge branch 'master' into DLS-Release-v1.1.0
kevwhitt-hee Nov 27, 2024
0a24e3a
TD-4973 Limit the list of supervisors in the Request proficiency conf…
sherif-olaboye Nov 27, 2024
3c09df3
TD-4889 Resolving internal server error when nominating delegate to s…
sherif-olaboye Nov 27, 2024
fbeaa0a
TD-4889 Resolving internal server error when nominating delegate to s…
sherif-olaboye Nov 27, 2024
79a7cc2
Merge pull request #2983 from TechnologyEnhancedLearning/master
binon Nov 29, 2024
dc5201c
Bump eslint-plugin-import in /DigitalLearningSolutions.Web (#2985)
dependabot[bot] Nov 29, 2024
7ca7306
Bump NUnit3TestAdapter from 4.5.0 to 4.6.0 (#2988)
dependabot[bot] Nov 29, 2024
23e3623
Bump core-js from 3.36.0 to 3.39.0 in /DigitalLearningSolutions.Web (…
dependabot[bot] Nov 29, 2024
2e76e69
Bump eslint-plugin-jasmine in /DigitalLearningSolutions.Web (#2986)
dependabot[bot] Nov 29, 2024
fbdb983
Bump rimraf from 5.0.5 to 5.0.10 in /DigitalLearningSolutions.Web (#2…
dependabot[bot] Nov 29, 2024
4bb395b
Bump babel-loader from 9.1.3 to 9.2.1 in /DigitalLearningSolutions.We…
dependabot[bot] Nov 29, 2024
f645616
Bump xunit from 2.6.2 to 2.9.2 (#2993)
dependabot[bot] Nov 29, 2024
59628e7
Bump Dapper from 2.1.24 to 2.1.35 (#2995)
dependabot[bot] Nov 29, 2024
d816ad8
Bump Selenium.Support and Selenium.WebDriver
dependabot[bot] Nov 29, 2024
96230a9
Bump Microsoft.Data.SqlClient from 5.1.5 to 5.2.2 (#2992)
dependabot[bot] Nov 29, 2024
a8e74f6
Merge branch 'Automatic_version_update_dependabot' into dependabot/np…
binon Nov 29, 2024
f32d515
Merge branch 'Automatic_version_update_dependabot' into dependabot/np…
binon Nov 29, 2024
32bcbb4
Merge branch 'Automatic_version_update_dependabot' into dependabot/np…
binon Nov 29, 2024
cec3d75
Merge pull request #2991 from TechnologyEnhancedLearning/dependabot/n…
binon Nov 29, 2024
5f304d6
Merge pull request #2829 from TechnologyEnhancedLearning/dependabot/n…
binon Nov 29, 2024
1311590
Merge branch 'Automatic_version_update_dependabot' into dependabot/np…
binon Nov 29, 2024
85585fc
Bump HtmlAgilityPack from 1.11.54 to 1.11.71
dependabot[bot] Nov 29, 2024
135c740
Bump Selenium.Axe and Selenium.WebDriver
dependabot[bot] Nov 29, 2024
f9b3a60
Upgraded the SqlClient manulaly to 5.2.2
binon Nov 29, 2024
db6eecb
Merge pull request #2826 from TechnologyEnhancedLearning/dependabot/n…
binon Nov 29, 2024
45ee60a
Merge pull request #2819 from TechnologyEnhancedLearning/dependabot/n…
binon Nov 29, 2024
81e9d14
Merge pull request #2997 from TechnologyEnhancedLearning/dependabot/n…
binon Nov 29, 2024
6405248
Bump Microsoft.AspNetCore.Mvc.Testing from 6.0.25 to 7.0.0
dependabot[bot] Nov 29, 2024
767807a
Merge pull request #2840 from TechnologyEnhancedLearning/dependabot/n…
binon Nov 29, 2024
3aa6c7c
Merge branch 'Automatic_version_update_dependabot' into dependabot/nu…
binon Nov 29, 2024
faf17c7
Merge pull request #2996 from TechnologyEnhancedLearning/dependabot/n…
binon Nov 29, 2024
7e30e2c
Merge branch 'Automatic_version_update_dependabot' into dependabot/np…
binon Nov 29, 2024
2a8ec3b
Bump nhsuk-frontend from 6.1.0 to 6.2.0 in /DigitalLearningSolutions.…
dependabot[bot] Nov 29, 2024
be597de
Bump eslint-plugin-jasmine in /DigitalLearningSolutions.Web (#3000)
dependabot[bot] Nov 29, 2024
9d58071
Bump input-range-scss in /DigitalLearningSolutions.Web (#3006)
dependabot[bot] Nov 29, 2024
10eb243
Merge pull request #2828 from TechnologyEnhancedLearning/dependabot/n…
binon Nov 29, 2024
ada5b3a
Bump @typescript-eslint/eslint-plugin in /DigitalLearningSolutions.We…
dependabot[bot] Nov 29, 2024
7111af2
Bump regenerator-runtime in /DigitalLearningSolutions.Web (#3002)
dependabot[bot] Nov 29, 2024
9ac23c0
Upgraded FluentMigrator and its dependencies manually
binon Nov 29, 2024
11c4522
TD-4787- Changed role from Educator/Manager to Assessor for nominated…
Auldrin-Possa Dec 2, 2024
a375ec9
Merge pull request #2980 from TechnologyEnhancedLearning/Develop/Feat…
kevwhitt-hee Dec 3, 2024
b31b0f1
Merge pull request #2981 from TechnologyEnhancedLearning/Develop/Feat…
kevwhitt-hee Dec 3, 2024
7a1b148
Merge pull request #2998 from TechnologyEnhancedLearning/dependabot/n…
kevwhitt-hee Dec 3, 2024
8fcc378
Merge pull request #3011 from TechnologyEnhancedLearning/Automatic_ve…
kevwhitt-hee Dec 3, 2024
399189b
TD-5095-SupervisorDelegateId check added along with CandidateAssessme…
Auldrin-Possa Dec 3, 2024
9cb7184
Merge pull request #3009 from TechnologyEnhancedLearning/Develop/Fix/…
kevwhitt-hee Dec 6, 2024
7949fa8
Merge pull request #3014 from TechnologyEnhancedLearning/Develop/Fix/…
kevwhitt-hee Dec 6, 2024
592898b
TD-4884 Prevent supervisors from confirm self assessments in a catego…
sherif-olaboye Dec 9, 2024
6b8006c
Merge remote-tracking branch 'origin/DLS-Release-v1.1.0' into Develop…
sherif-olaboye Dec 13, 2024
1f61456
TD-4884 Running of autoformatter to remove odd whitespace
sherif-olaboye Dec 13, 2024
c01bc93
TD-5026 Removing selfassessment that does not belong to course catego…
sherif-olaboye Dec 16, 2024
549d8ea
TD-5128 Manage Confirmation request - Outstanding request should disp…
sherif-olaboye Dec 16, 2024
e7ee824
Merge pull request #3020 from TechnologyEnhancedLearning/Develop/Feat…
kevwhitt-hee Dec 17, 2024
b0f7863
Merge pull request #3026 from TechnologyEnhancedLearning/Develop/Feat…
kevwhitt-hee Dec 17, 2024
185537c
TD-5128 Changing in to = in the query
sherif-olaboye Dec 17, 2024
457ce88
TD-4889 Resolving 500 error issue while trying to promote to nominate…
sherif-olaboye Dec 18, 2024
6e6f152
TD-5028 Supervise - Remove staff member doesn't remove the supervisor…
sherif-olaboye Nov 22, 2024
576fbef
Merge pull request #3028 from TechnologyEnhancedLearning/Develop/Fixe…
rshrirohit Dec 30, 2024
00856ce
Merge pull request #3032 from TechnologyEnhancedLearning/Develop/Feat…
rshrirohit Dec 30, 2024
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
23 changes: 13 additions & 10 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
### JIRA link
_DLSV2-XXXX_
[TD-####](https://hee-tis.atlassian.net/browse/TD-####)

### Description
_Describe what has changed and how that will affect the app. If relevant, add references to the resources you used. Use this as your opportunity to highlight anything odd and give people context around particular decisions._
_Describe what has changed and how that will affect the app. If relevant, add links to any sources/documentation you used. Highlight anything unusual and give people context around particular decisions._

### Screenshots
_Attach screenshots on mobile, tablet and desktop._
_Paste screenshots for all views created or changed: mobile, tablet and desktop, wave analyser showing no errors._

-----
### Developer checks
(Leave tasks unticked if they haven't been appropriate for your ticket.)

I have:
- [ ] Run the formatter and made sure there are no IDE errors (see [info on Text Editor settings](https://hee-tis.atlassian.net/wiki/spaces/TP/pages/3546185813/DLS+Dev+Process) to avoid whitespace changes)
- [ ] Written tests for the changes (accessibility tests, unit tests for controller, data services, services, view models, etc)
- [ ] Manually tested my work with and without JavaScript
- [ ] Tested any Views or partials created or changed with [Wave Chrome plugin](https://chrome.google.com/webstore/detail/wave-evaluation-tool/jbbplnpkjmmeebjpijfedlgcdilocofh/related) and addressed any valid accessibility issues
- [ ] Updated/added documentation in [Confluence](https://hee-tis.atlassian.net/wiki/spaces/TP/pages/3546939432/DLS+Code) and/or [GitHub Readme](https://github.com/TechnologyEnhancedLearning/DLSV2/blob/master/README.md). List of documentation links added/changed:
- [ ] Run the IDE auto formatter on all files I’ve worked on and made sure there are no IDE errors relating to them
- [ ] Written or updated tests for the changes (accessibility ui tests for views, tests for controller, data services, services, view models created or modified) and made sure all tests are passing
- [ ] Manually tested my work with and without JavaScript (adding notes where functionality requires JavaScript)
- [ ] Tested any Views or partials created or changed with [Wave Chrome plugin](https://chrome.google.com/webstore/detail/wave-evaluation-tool/jbbplnpkjmmeebjpijfedlgcdilocofh/related). Addressed any valid accessibility issues and documented any invalid errors
- [ ] Updated my Jira ticket with testing notes, including information about other parts of the system that were touched as part of the MR and need to be tested to ensure nothing is broken
- [ ] Scanned over my pull request in GitHub and addressed any warnings from the GitHub Build and Test checks in the GitHub PR ‘Files Changed’ tab
Either:
- [ ] Documented my work in [Confluence](https://hee-tis.atlassian.net/wiki/spaces/TP/pages/3461087233/Development), updating any business rules applied or modified. Updated GitHub readme/documentation for the repository if appropriate. List of documentation links added/changed:
- [doc_1_here](link_1_here)
- [ ] Updated my Jira ticket with information about other parts of the system that were touched as part of the MR and have to be sanity tested to ensure nothing’s broken
- [ ] Scanned over my pull request in GitHub and addressed any warnings from the GitHub Build and Test checks.
Or:
- [ ] Confirmed that none of the work that I have undertaken requires any updates to documentation
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@


namespace DigitalLearningSolutions.Data.Migrations
{
using FluentMigrator;

[Migration(202410231405)]
public class Alter_GetActivitiesForDelegateEnrolment : Migration
{
public override void Up()
{
Execute.Sql(Properties.Resources.TD_4878_Alter_GetActivitiesForDelegateEnrolment_Up);
}
public override void Down()
{
Execute.Sql(Properties.Resources.TD_4878_Alter_GetActivitiesForDelegateEnrolment_Down);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
namespace DigitalLearningSolutions.Data.Migrations
{
using FluentMigrator;

[Migration(202412020900)]
public class UpdateCandidateAssessmentSupervisorsTable : ForwardOnlyMigration
{
public override void Up()
{
Execute.Sql($@"UPDATE cas
SET SelfAssessmentSupervisorRoleID = (SELECT ID FROM SelfAssessmentSupervisorRoles
WHERE SelfAssessmentID = ssr.SelfAssessmentID and AllowDelegateNomination = 1)
FROM CandidateAssessmentSupervisors cas INNER JOIN
SelfAssessmentSupervisorRoles ssr ON cas.SelfAssessmentSupervisorRoleID = ssr.ID
AND cas.Removed IS NULL AND ssr.AllowDelegateNomination = 0 INNER JOIN
SupervisorDelegates sd ON cas.SupervisorDelegateId = sd.ID INNER JOIN
AdminAccounts aa ON sd.SupervisorAdminID = aa.ID
WHERE aa.IsSupervisor = 0 AND aa.IsNominatedSupervisor = 1
-- to exclude duplicate CandidateAssessmentID from update
AND cas.CandidateAssessmentID NOT IN (
SELECT CandidateAssessmentID FROM CandidateAssessmentSupervisors WHERE CandidateAssessmentID in (
SELECT Cas2.CandidateAssessmentID
FROM CandidateAssessmentSupervisors cas2 with (nolock) INNER JOIN
SelfAssessmentSupervisorRoles ssr2 with (nolock) ON cas2.SelfAssessmentSupervisorRoleID = ssr2.ID
AND cas2.Removed IS NULL AND ssr2.AllowDelegateNomination = 0 INNER JOIN
SupervisorDelegates sd2 with (nolock) ON cas2.SupervisorDelegateId = sd2.ID INNER JOIN
AdminAccounts aa2 with (nolock) ON sd2.SupervisorAdminID = aa2.ID
WHERE aa2.IsSupervisor = 0 AND aa2.IsNominatedSupervisor = 1
)
GROUP BY CandidateAssessmentID,SupervisorDelegateId
HAVING COUNT(*)>1
)"
);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Dapper" Version="2.1.24" />
<PackageReference Include="FluentMigrator" Version="3.3.2" />
<PackageReference Include="FluentMigrator.Extensions.SqlServer" Version="3.3.2" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.1.5" />
<PackageReference Include="Dapper" Version="2.1.35" />
<PackageReference Include="FluentMigrator" Version="6.2.0" />
<PackageReference Include="FluentMigrator.Extensions.SqlServer" Version="6.2.0" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.2.2" />
</ItemGroup>

<ItemGroup>
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 12 additions & 6 deletions DigitalLearningSolutions.Data.Migrations/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -448,19 +448,25 @@
<data name="TD_4634_Alter_GetCompletedCoursesForCandidate_UP" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Scripts\TD_4634_Alter_GetCompletedCoursesForCandidate_UP.sql;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-16</value>
</data>
<data name="TD_4950_Alter_GetAssessmentResultsByDelegate_DOWN" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Scripts\TD_4950_Alter_GetAssessmentResultsByDelegate_DOWN.sql;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-16</value>
</data>
<data name="TD_4950_Alter_GetAssessmentResultsByDelegate_UP" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Scripts\TD_4950_Alter_GetAssessmentResultsByDelegate_UP.sql;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-16</value>
</data>
<data name="TD-4950-dboGetOtherCentresForSelfAssessmentCreateOrAlter" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\TD-4950-dboGetOtherCentresForSelfAssessmentCreateOrAlter.sql;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
</data>
<data name="TD_4878_Alter_GetActivitiesForDelegateEnrolment_Down" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Scripts\TD-4878-Alter_GetActivitiesForDelegateEnrolment_Down.sql;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-16</value>
</data>
<data name="TD_4878_Alter_GetActivitiesForDelegateEnrolment_Up" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Scripts\TD-4878-Alter_GetActivitiesForDelegateEnrolment_Up.sql;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-16</value>
</data>
<data name="TD_4950_AlterGetCandidateAssessmentResultsById_DOWN" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\TD-4950-AlterGetCandidateAssessmentResultsById_DOWN.sql;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-16</value>
</data>
<data name="TD_4950_AlterGetCandidateAssessmentResultsById_UP" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\TD-4950-AlterGetCandidateAssessmentResultsById_UP.sql;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-16</value>
</data>
<data name="TD_4950_Alter_GetAssessmentResultsByDelegate_DOWN" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Scripts\TD_4950_Alter_GetAssessmentResultsByDelegate_DOWN.sql;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-16</value>
</data>
<data name="TD_4950_Alter_GetAssessmentResultsByDelegate_UP" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Scripts\TD_4950_Alter_GetAssessmentResultsByDelegate_UP.sql;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-16</value>
</data>
</root>
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<PackageReference Include="FluentMigrator" Version="5.0.0" />
<PackageReference Include="FluentMigrator.Runner" Version="5.0.0" />
<PackageReference Include="FluentMigrator.Runner.SqlServer" Version="5.0.0" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.1.2" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.1.3" />
<PackageReference Include="NBuilder" Version="6.1.0" />
<PackageReference Include="nunit" Version="3.14.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
Expand Down
18 changes: 9 additions & 9 deletions DigitalLearningSolutions.Data/DataServices/CourseDataService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ int EnrolOnActivitySelfAssessment(int selfAssessmentId, int candidateId, int sup

public IEnumerable<CourseStatistics> GetDelegateCourseStatisticsAtCentre(string searchString, int centreId, int? categoryId, bool allCentreCourses, bool? hideInLearnerPortal, string isActive, string categoryName, string courseTopic, string hasAdminFields);

public IEnumerable<DelegateAssessmentStatistics> GetDelegateAssessmentStatisticsAtCentre(string searchString, int centreId, string categoryName, string isActive);
public IEnumerable<DelegateAssessmentStatistics> GetDelegateAssessmentStatisticsAtCentre(string searchString, int centreId, string categoryName, string isActive, int? categoryId);

bool IsSelfEnrollmentAllowed(int customisationId);
Customisation? GetCourse(int customisationId);
}
Expand Down Expand Up @@ -541,9 +542,7 @@ LEFT OUTER JOIN UserCentreDetails AS UCD ON
new { candidateAssessmentId, enrolmentMethodId, completeByDateDynamic }
);
}

if (candidateAssessmentId > 1 && supervisorDelegateId !=0)

if (candidateAssessmentId > 1 && supervisorDelegateId != 0)
{
string sqlQuery = $@"
BEGIN TRANSACTION
Expand All @@ -552,17 +551,17 @@ BEGIN TRANSACTION

UPDATE CandidateAssessmentSupervisors SET Removed = NULL
{((selfAssessmentSupervisorRoleId > 0) ? " ,SelfAssessmentSupervisorRoleID = @selfAssessmentSupervisorRoleID" : string.Empty)}
WHERE CandidateAssessmentID = @candidateAssessmentId
WHERE CandidateAssessmentID = @candidateAssessmentId AND SupervisorDelegateId = @supervisorDelegateId

COMMIT TRANSACTION";

connection.Execute(sqlQuery
, new { candidateAssessmentId, selfAssessmentSupervisorRoleId, enrolmentMethodId, completeByDateDynamic });
, new { candidateAssessmentId, selfAssessmentSupervisorRoleId, enrolmentMethodId, completeByDateDynamic, supervisorDelegateId });
}

if (supervisorId > 0)
{

var adminUserId = Convert.ToInt32(connection.ExecuteScalar(@"SELECT UserID FROM AdminAccounts WHERE (AdminAccounts.ID = @supervisorId)",
new { supervisorId })
);
Expand Down Expand Up @@ -1976,7 +1975,7 @@ AND ap.DefaultContentTypeID <> 4
return courseStatistics;
}

public IEnumerable<DelegateAssessmentStatistics> GetDelegateAssessmentStatisticsAtCentre(string searchString, int centreId, string categoryName, string isActive)
public IEnumerable<DelegateAssessmentStatistics> GetDelegateAssessmentStatisticsAtCentre(string searchString, int centreId, string categoryName, string isActive, int? categoryId)
{
string assessmentStatisticsSelectQuery = $@"SELECT
sa.Name AS Name,
Expand Down Expand Up @@ -2006,11 +2005,12 @@ from CentreSelfAssessments AS csa
WHERE csa.CentreID= @centreId
AND sa.[Name] LIKE '%' + @searchString + '%'
AND ((@categoryName = 'Any') OR (cc.CategoryName = @categoryName))
AND (ISNULL(@categoryId, 0) = 0 OR sa.CategoryID = @categoryId)
AND ((@isActive = 'Any') OR (@isActive = 'true' AND sa.ArchivedDate IS NULL) OR (@isActive = 'false' AND sa.ArchivedDate IS NOT NULL))
";

IEnumerable<DelegateAssessmentStatistics> delegateAssessmentStatistics = connection.Query<DelegateAssessmentStatistics>(assessmentStatisticsSelectQuery,
new { searchString, centreId, categoryName, isActive }, commandTimeout: 3000);
new { searchString, centreId, categoryName, isActive, categoryId }, commandTimeout: 3000);
return delegateAssessmentStatistics;
}

Expand Down
Loading
Loading