@@ -122,7 +122,7 @@ IEnumerable<CourseDelegateForExport> GetCourseDelegatesForExport(string searchSt
122122 int customisationId , int centreId , bool ? isDelegateActive , bool ? isProgressLocked , bool ? removed , bool ? hasCompleted , string ? answer1 , string ? answer2 , string ? answer3 ) ;
123123
124124 int EnrolOnActivitySelfAssessment ( int selfAssessmentId , int candidateId , int supervisorId , string adminEmail ,
125- int selfAssessmentSupervisorRoleId , DateTime ? completeByDate , int delegateUserId , int centreId , int ? enrolledByAdminId ) ;
125+ int selfAssessmentSupervisorRoleId , DateTime ? completeByDate , int delegateUserId , int centreId , int ? enrolledByAdminId , int ? adminUserId ) ;
126126
127127 bool IsCourseCompleted ( int candidateId , int customisationId ) ;
128128 bool IsCourseCompleted ( int candidateId , int customisationId , int progressID ) ;
@@ -442,7 +442,7 @@ public void RemoveCurrentCourse(int progressId, int candidateId, RemovalMethod r
442442 }
443443
444444 public int EnrolOnActivitySelfAssessment ( int selfAssessmentId , int candidateId , int supervisorId , string adminEmail ,
445- int selfAssessmentSupervisorRoleId , DateTime ? completeByDate , int delegateUserId , int centreId , int ? enrolledByAdminId )
445+ int selfAssessmentSupervisorRoleId , DateTime ? completeByDate , int delegateUserId , int centreId , int ? enrolledByAdminId , int ? adminUserId )
446446 {
447447 IClockUtility clockUtility = new ClockUtility ( ) ;
448448 DateTime startedDate = clockUtility . UtcNow ;
@@ -541,7 +541,9 @@ LEFT OUTER JOIN UserCentreDetails AS UCD ON
541541 new { candidateAssessmentId , enrolmentMethodId , completeByDateDynamic }
542542 ) ;
543543 }
544- if ( candidateAssessmentId > 1 && supervisorDelegateId != 0 )
544+
545+ if ( candidateAssessmentId > 1 && supervisorDelegateId != 0 )
546+
545547 {
546548 string sqlQuery = $@ "
547549 BEGIN TRANSACTION
@@ -558,6 +560,23 @@ BEGIN TRANSACTION
558560 , new { candidateAssessmentId , selfAssessmentSupervisorRoleId , enrolmentMethodId , completeByDateDynamic } ) ;
559561 }
560562
563+ if ( supervisorId > 0 )
564+ {
565+
566+ adminUserId = Convert . ToInt32 ( connection . ExecuteScalar ( @"SELECT UserID FROM AdminAccounts WHERE (AdminAccounts.ID = @supervisorId)" ,
567+ new { supervisorId } )
568+ ) ;
569+
570+ if ( delegateUserId == adminUserId )
571+ {
572+ connection . Execute (
573+ @"UPDATE CandidateAssessments SET NonReportable = 1 WHERE ID = @candidateAssessmentId" ,
574+ new { candidateAssessmentId }
575+ ) ;
576+
577+ }
578+ }
579+
561580 if ( candidateAssessmentId < 1 )
562581 {
563582 logger . LogWarning (
0 commit comments