Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
129 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
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
2d83b17
Create auto-merge.yml
binon Nov 29, 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
869a1f0
Merge branch 'DLS-Release-v1.1.0' into DLS-Release-v1.1.1
kevwhitt-hee Dec 19, 2024
ec0350d
Resolving merge problem
kevwhitt-hee Dec 19, 2024
28f843b
Resolving merge problem
kevwhitt-hee Dec 19, 2024
76359f0
TD-5131 Self-assessment Manage Supervisor still displays the Supervis…
sherif-olaboye Dec 19, 2024
e25a178
TD-5135-Universal fix implemented for handling non-matching stored fi…
auldrinpossa Dec 19, 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
f7fcb4d
Merge pull request #3033 from TechnologyEnhancedLearning/Develop/Fixe…
rshrirohit Dec 30, 2024
9ed1154
Merge pull request #3034 from TechnologyEnhancedLearning/Develop/feat…
rshrirohit Dec 30, 2024
a2a2d61
Merge branch 'DLS-Release-v1.1.0' into DLS-Release-v1.1.1
rshrirohit Dec 30, 2024
08fdcc2
Merge pull request #3053 from TechnologyEnhancedLearning/DLS-Release-…
rshrirohit Jan 9, 2025
16c7fba
Merge branch 'master' into DLS-Release-v1.1.1
rshrirohit Jan 9, 2025
2d45b57
TD-5153 Implements page changes and starts to implement download actions
kevwhitt-hee Dec 19, 2024
ab16c75
Update FrameworkDataService.cs
kevwhitt-hee Dec 19, 2024
691ed40
TD-5153 Implements download competencies and templates functions and …
kevwhitt-hee Dec 20, 2024
f17218e
Update ImportCompleted.cshtml
kevwhitt-hee Dec 20, 2024
ea9ca79
Implements models for handling upload
kevwhitt-hee Dec 20, 2024
219ef3c
Formatter changes
kevwhitt-hee Dec 20, 2024
e84a5ed
Fixes form input id
kevwhitt-hee Dec 20, 2024
8a98bee
TD-5154 Implements basic pre-process logic and view and adds validati…
kevwhitt-hee Dec 23, 2024
bafd87a
TD-5154 Implements upload results page with validation errors
kevwhitt-hee Dec 23, 2024
445ecff
TD-5154 Adds always show description validation
kevwhitt-hee Dec 23, 2024
51fae04
Formatter changes
kevwhitt-hee Dec 23, 2024
f3c4b62
Fixes query to avoid reliance on new SQL 2017 STRING_AGG function
kevwhitt-hee Dec 23, 2024
219f274
TD-5216 Moves to import namespace and separates form data in viewmodel
kevwhitt-hee Dec 30, 2024
5443f3c
TD-5216 Load FALSE into AlwaysShowDescription field for downloaded te…
kevwhitt-hee Dec 30, 2024
6beba80
TD-5216 Adds competency vocabulary to views
kevwhitt-hee Dec 30, 2024
b914c50
TD-5216 Uses custom competency vocabulary in Excel file processing
kevwhitt-hee Dec 30, 2024
23b9570
IDE formatter changes
kevwhitt-hee Dec 30, 2024
7b7e2b9
TD-5155 Begins to implement add questions view model
kevwhitt-hee Dec 30, 2024
ee10005
TD-5155 Adds view model and constructor
kevwhitt-hee Dec 31, 2024
47543f7
TD-5155 Implements conditional preselected checkboxes for default que…
kevwhitt-hee Dec 31, 2024
549fbc8
TD-5155 Implements add assessment questions form view
kevwhitt-hee Jan 2, 2025
a33c4dc
Tweaks post data processing to handle storing false values
kevwhitt-hee Jan 2, 2025
e14e53e
TD-5158 Implements add questions to which competencies form
kevwhitt-hee Jan 2, 2025
b8c3b9c
Removes spurious usings
kevwhitt-hee Jan 2, 2025
d80826c
TD-5219 Improvements to pre-processing summary and errors
kevwhitt-hee Jan 3, 2025
cba6f1f
Adds missing @ to indicate inline code
kevwhitt-hee Jan 3, 2025
0ba85e5
TD-5220 Implements store competency ordering option form
kevwhitt-hee Jan 3, 2025
396297d
TD-5220 passes ids of uploaded competencies to get order of stored co…
kevwhitt-hee Jan 6, 2025
dcdc17b
TD-5220 Implements CancelImport method to clear down uploaded file an…
kevwhitt-hee Jan 6, 2025
d85bdbd
TD-5162 Implements import summary screen
kevwhitt-hee Jan 6, 2025
c3feb48
formatter changes
kevwhitt-hee Jan 6, 2025
5da1bdd
TD-5163 Process imported competencies
kevwhitt-hee Jan 7, 2025
91593d1
TD-5163 Implements the upload results view
kevwhitt-hee Jan 7, 2025
ea6d9ff
TD-5163 Fixes flag assignment during upload processing
kevwhitt-hee Jan 8, 2025
cd4e4db
TD-5163 General tweaks to improve wording of buttons and body text
kevwhitt-hee Jan 8, 2025
2d009b5
TD-5163 Corrects heading
kevwhitt-hee Jan 8, 2025
d956c16
TD-5163 modifies the insert competency group method to take an option…
kevwhitt-hee Jan 8, 2025
a47d2ca
TD-5163 Clears down the uploaded sheet after processing
kevwhitt-hee Jan 8, 2025
caa020c
TD-5163 Commits competency order changes if required
kevwhitt-hee Jan 9, 2025
daa9561
TD-5163 Reorders competency groups if needed
kevwhitt-hee Jan 10, 2025
3f3e2b4
TD-5163 Fixes navigation and titles
kevwhitt-hee Jan 10, 2025
65932d9
TD-5163 Fixes competency group reordering by reloading the committed …
kevwhitt-hee Jan 10, 2025
a73f76a
Applies BR DLSFW1 to standard insert competency group functionality
kevwhitt-hee Jan 10, 2025
4a65bac
Adds published framework warning to summary page
kevwhitt-hee Jan 10, 2025
58356fb
TD-5233 Add a limitations paragraph to the start page
kevwhitt-hee Jan 17, 2025
9151e7d
Emphasises cannot
kevwhitt-hee Jan 17, 2025
7e3fb52
Moves single line inset text to view component
kevwhitt-hee Jan 17, 2025
32aeea1
TD-5233 Indicates the number of competencies reordered in the upload …
kevwhitt-hee Jan 17, 2025
59a91c3
Update ApplyCompetencyOrdering.cshtml
kevwhitt-hee Jan 17, 2025
1ae3863
TD-5233 added flags to the list of things that can't be removed and u…
kevwhitt-hee Jan 17, 2025
bf2b2af
Formatting changes
kevwhitt-hee Jan 17, 2025
ad4b3b0
Merge pull request #3065 from TechnologyEnhancedLearning/Develop/Feat…
kevwhitt-hee Jan 17, 2025
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
@@ -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 @@ -542,7 +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 @@ -551,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
159 changes: 114 additions & 45 deletions DigitalLearningSolutions.Data/DataServices/FrameworkDataService.cs

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

public partial class SelfAssessmentDataService
{
public IEnumerable<CurrentSelfAssessment> GetSelfAssessmentsForCandidate(int delegateUserId, int centreId, int? adminCategoryId)
public IEnumerable<CurrentSelfAssessment> GetSelfAssessmentsForCandidate(int delegateUserId, int centreId, int? adminIdCategoryID)
{
return connection.Query<CurrentSelfAssessment>(
@"SELECT SelfAssessment.Id,
Expand Down Expand Up @@ -67,7 +67,8 @@ Competencies AS C RIGHT OUTER JOIN
CandidateAssessmentSupervisorVerifications AS casv ON casv.CandidateAssessmentSupervisorID = cas.ID LEFT OUTER JOIN
AdminAccounts AS aaEnrolledBy ON aaEnrolledBy.ID = CA.EnrolledByAdminID LEFT OUTER JOIN
Users AS uEnrolledBy ON uEnrolledBy.ID = aaEnrolledBy.UserID
WHERE (CA.DelegateUserID = @delegateUserId) AND (CA.RemovedDate IS NULL) AND (CA.CompletedDate IS NULL) AND (ISNULL(@adminCategoryId, 0) = 0 OR sa.CategoryID = @adminCategoryId)
WHERE (CA.DelegateUserID = @delegateUserId) AND (CA.RemovedDate IS NULL) AND (CA.CompletedDate IS NULL)
AND (ISNULL(@adminIdCategoryID, 0) = 0 OR sa.CategoryID = @adminIdCategoryId)
GROUP BY
CA.SelfAssessmentID, SA.Name, SA.Description, SA.IncludesSignposting, SA.SupervisorResultsReview,
SA.ReviewerCommentsLabel, SA.IncludeRequirementsFilters,
Expand All @@ -83,10 +84,87 @@ CandidateAssessments AS CA LEFT OUTER JOIN
(casv.Verified IS NOT NULL)
GROUP BY SelfAssessmentID,casv.SignedOff
)Signoff ON SelfAssessment.Id =Signoff.SelfAssessmentID",
new { delegateUserId, centreId, adminCategoryId }
new { delegateUserId, centreId, adminIdCategoryID }
);
}
public IEnumerable<CurrentSelfAssessment> GetSelfAssessmentsForCandidate(int delegateUserId, int centreId)
{
return connection.Query<CurrentSelfAssessment>(
@"SELECT SelfAssessment.Id,
SelfAssessment.Name,
SelfAssessment.Description,
SelfAssessment.IncludesSignposting,
SelfAssessment.IncludeRequirementsFilters,
SelfAssessment. IsSupervisorResultsReviewed,
SelfAssessment.ReviewerCommentsLabel,
SelfAssessment. Vocabulary,
SelfAssessment. NumberOfCompetencies,
SelfAssessment.StartedDate,
SelfAssessment.LastAccessed,
SelfAssessment.CompleteByDate,
SelfAssessment.CandidateAssessmentId,
SelfAssessment.UserBookmark,
SelfAssessment.UnprocessedUpdates,
SelfAssessment.LaunchCount,
SelfAssessment. IsSelfAssessment,
SelfAssessment.SubmittedDate,
SelfAssessment. CentreName,
SelfAssessment.EnrolmentMethodId,
Signoff.SignedOff,
Signoff.Verified,
EnrolledByForename +' '+EnrolledBySurname AS EnrolledByFullName
FROM (SELECT
CA.SelfAssessmentID AS Id,
SA.Name,
SA.Description,
SA.IncludesSignposting,
SA.IncludeRequirementsFilters,
SA.SupervisorResultsReview AS IsSupervisorResultsReviewed,
SA.ReviewerCommentsLabel,
COALESCE(SA.Vocabulary, 'Capability') AS Vocabulary,
COUNT(C.ID) AS NumberOfCompetencies,
CA.StartedDate,
CA.LastAccessed,
CA.CompleteByDate,
CA.ID AS CandidateAssessmentId,
CA.UserBookmark,
CA.UnprocessedUpdates,
CA.LaunchCount,
1 AS IsSelfAssessment,
CA.SubmittedDate,
CR.CentreName AS CentreName,
CA.EnrolmentMethodId,
uEnrolledBy.FirstName AS EnrolledByForename,
uEnrolledBy.LastName AS EnrolledBySurname
FROM Centres AS CR INNER JOIN
CandidateAssessments AS CA INNER JOIN
SelfAssessments AS SA ON CA.SelfAssessmentID = SA.ID ON CR.CentreID = CA.CentreID INNER JOIN
CentreSelfAssessments AS csa ON csa.SelfAssessmentID = SA.ID AND csa.CentreID = @centreId LEFT OUTER JOIN
Competencies AS C RIGHT OUTER JOIN
SelfAssessmentStructure AS SAS ON C.ID = SAS.CompetencyID ON CA.SelfAssessmentID = SAS.SelfAssessmentID LEFT OUTER JOIN
CandidateAssessmentSupervisors AS cas ON ca.ID =cas.CandidateAssessmentID LEFT OUTER JOIN
CandidateAssessmentSupervisorVerifications AS casv ON casv.CandidateAssessmentSupervisorID = cas.ID LEFT OUTER JOIN
AdminAccounts AS aaEnrolledBy ON aaEnrolledBy.ID = CA.EnrolledByAdminID LEFT OUTER JOIN
Users AS uEnrolledBy ON uEnrolledBy.ID = aaEnrolledBy.UserID
WHERE (CA.DelegateUserID = @delegateUserId) AND (CA.RemovedDate IS NULL) AND (CA.CompletedDate IS NULL)
GROUP BY
CA.SelfAssessmentID, SA.Name, SA.Description, SA.IncludesSignposting, SA.SupervisorResultsReview,
SA.ReviewerCommentsLabel, SA.IncludeRequirementsFilters,
COALESCE(SA.Vocabulary, 'Capability'), CA.StartedDate, CA.LastAccessed, CA.CompleteByDate,
CA.ID,
CA.UserBookmark, CA.UnprocessedUpdates, CA.LaunchCount, CA.SubmittedDate, CR.CentreName,CA.EnrolmentMethodId,
uEnrolledBy.FirstName,uEnrolledBy.LastName)SelfAssessment LEFT OUTER JOIN
(SELECT SelfAssessmentID,casv.SignedOff,MAX(casv.Verified) Verified FROM
CandidateAssessments AS CA LEFT OUTER JOIN
CandidateAssessmentSupervisors AS cas ON ca.ID =cas.CandidateAssessmentID LEFT OUTER JOIN
CandidateAssessmentSupervisorVerifications AS casv ON casv.CandidateAssessmentSupervisorID = cas.ID
WHERE (CA.DelegateUserID = @delegateUserId) AND (CA.RemovedDate IS NULL) AND (CA.CompletedDate IS NULL) AND (casv.SignedOff = 1) AND
(casv.Verified IS NOT NULL)
GROUP BY SelfAssessmentID,casv.SignedOff
)Signoff ON SelfAssessment.Id =Signoff.SelfAssessmentID",
new { delegateUserId, centreId }
);
}

public CurrentSelfAssessment? GetSelfAssessmentForCandidateById(int delegateUserId, int selfAssessmentId)
{
return connection.QueryFirstOrDefault<CurrentSelfAssessment>(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ public IEnumerable<Competency> GetResultSupervisorVerifications(int selfAssessme
INNER JOIN DelegateAccounts DA1 ON CA.DelegateUserID = DA1.UserID AND au.CentreID = DA1.CentreID AND DA1.Active=1
WHERE (LAR.Verified IS NULL) 
AND ((LAR.Result IS NOT NULL) OR (LAR.SupportingComments IS NOT NULL)) 
AND (LAR.Requested IS NOT NULL)
AND (LAR.Requested IS NOT NULL) AND (au.CategoryID = 0 OR au.CategoryID = (select CategoryID from SelfAssessments where ID = @selfAssessmentId))
ORDER BY SupervisorVerificationRequested DESC, C.Name",
(competency, assessmentQuestion) =>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ int competencyId

// CandidateAssessmentsDataService

IEnumerable<CurrentSelfAssessment> GetSelfAssessmentsForCandidate(int delegateUserId, int centreId, int? adminCategoryId);

IEnumerable<CurrentSelfAssessment> GetSelfAssessmentsForCandidate(int delegateUserId, int centreId, int? adminIdCategoryID);
IEnumerable<CurrentSelfAssessment> GetSelfAssessmentsForCandidate(int delegateUserId, int centreId);
CurrentSelfAssessment? GetSelfAssessmentForCandidateById(int delegateUserId, int selfAssessmentId);

void UpdateLastAccessed(int selfAssessmentId, int delegateUserId);
Expand Down Expand Up @@ -174,7 +174,6 @@ int GetSelfAssessmentActivityDelegatesExportCount(string searchString, string so
bool HasMinimumOptionalCompetencies(int selfAssessmentId, int delegateUserId);
int GetSelfAssessmentCategoryId(int selfAssessmentId);
}

public partial class SelfAssessmentDataService : ISelfAssessmentDataService
{
private readonly IDbConnection connection;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ int delegateUserId
return connection.Query<SelfAssessmentSupervisor>(
@$"{SelectSelfAssessmentSupervisorQuery}
WHERE (sd.Removed IS NULL) AND (cas.Removed IS NULL) AND (ca.DelegateUserID = @delegateUserId)
AND (ca.SelfAssessmentID = @selfAssessmentId)
AND (ca.SelfAssessmentID = @selfAssessmentId) AND (au.Supervisor = 1 or au.NominatedSupervisor = 1)
AND (au.CategoryID = 0 OR au.CategoryID IN (select CategoryID from SelfAssessments where ID = @selfAssessmentId))
ORDER BY SupervisorName",
new { selfAssessmentId, delegateUserId }
Expand All @@ -95,7 +95,7 @@ int delegateUserId
WHERE (sd.Removed IS NULL) AND (cas.Removed IS NULL) AND (sd.DelegateUserID = @delegateUserId)
AND (ca.SelfAssessmentID = @selfAssessmentId) AND (sd.SupervisorAdminID IS NOT NULL)
AND (coalesce(sasr.ResultsReview, 1) = 1)
AND au.Active = 1
AND au.Active = 1 AND (au.Supervisor = 1 or au.NominatedSupervisor = 1)
AND (au.CategoryID = 0 OR au.CategoryID IN (select CategoryID from SelfAssessments where ID = @selfAssessmentId))
ORDER BY SupervisorName",
new { selfAssessmentId, delegateUserId }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public interface ISupervisorDataService
DelegateSelfAssessment? GetSelfAssessmentByCandidateAssessmentId(int candidateAssessmentId, int adminId, int? adminIdCategoryId);
IEnumerable<SupervisorDashboardToDoItem> GetSupervisorDashboardToDoItemsForRequestedSignOffs(int adminId);
IEnumerable<SupervisorDashboardToDoItem> GetSupervisorDashboardToDoItemsForRequestedReviews(int adminId);
DelegateSelfAssessment? GetSelfAssessmentBaseByCandidateAssessmentId(int candidateAssessmentId);
DelegateSelfAssessment? GetSelfAssessmentBaseByCandidateAssessmentId(int candidateAssessmentId, int? adminIdCategoryId);
IEnumerable<RoleProfile> GetAvailableRoleProfilesForDelegate(int candidateId, int centreId, int? categoryId);
RoleProfile? GetRoleProfileById(int selfAssessmentId);
IEnumerable<SelfAssessmentSupervisorRole> GetSupervisorRolesForSelfAssessment(int selfAssessmentId);
Expand Down Expand Up @@ -594,7 +594,7 @@ FROM CandidateAssessmentSupervisors AS cas INNER JOIN
WHERE (ca.RemovedDate IS NULL) AND (cas.SupervisorDelegateId = @supervisorDelegateId) AND (cas.Removed IS NULL) AND (sa.ID = @selfAssessmentId)", new { selfAssessmentId, supervisorDelegateId }
).FirstOrDefault();
}
public DelegateSelfAssessment? GetSelfAssessmentBaseByCandidateAssessmentId(int candidateAssessmentId)
public DelegateSelfAssessment? GetSelfAssessmentBaseByCandidateAssessmentId(int candidateAssessmentId, int? adminIdCategoryId)
{
return connection.Query<DelegateSelfAssessment>(
@$"SELECT ca.ID, sa.ID AS SelfAssessmentID, sa.Name AS RoleName, sa.QuestionLabel, sa.DescriptionLabel, sa.ReviewerCommentsLabel,
Expand All @@ -611,7 +611,7 @@ FROM SelfAssessmentResultSupervisorVerifications AS sarsv
FROM CandidateAssessmentSupervisors AS cas INNER JOIN
CandidateAssessments AS ca ON cas.CandidateAssessmentID = ca.ID INNER JOIN
SelfAssessments AS sa ON sa.ID = ca.SelfAssessmentID
WHERE (ca.ID = @candidateAssessmentId)", new { candidateAssessmentId }
WHERE (ca.ID = @candidateAssessmentId) AND (ISNULL(@adminIdCategoryID, 0) = 0 OR sa.CategoryID = @adminIdCategoryId)", new { candidateAssessmentId, adminIdCategoryId }
).FirstOrDefault();
}
public DelegateSelfAssessment? GetSelfAssessmentBySupervisorDelegateCandidateAssessmentId(int candidateAssessmentId, int supervisorDelegateId)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,10 @@ bool isCentreManager
IsContentCreator = @isContentCreator,
IsContentManager = @isContentManager,
ImportOnly = @importOnly,
CategoryID = @categoryId,
CategoryID = CASE
WHEN @categoryID = 0 THEN NULL
ELSE @categoryID
END,
IsCentreManager = @isCentreManager
WHERE ID = @adminId",
new
Expand Down
Loading
Loading