Skip to content
Open
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
@@ -0,0 +1,18 @@
namespace DigitalLearningSolutions.Data.Migrations
{
using FluentMigrator;

[Migration(202510221132)]
public class AddIncludeLearnerDeclarationPromptToSelfAssessmentsTable : Migration
{
public override void Up()
{
Alter.Table("SelfAssessments").AddColumn("IncludeLearnerDeclarationPrompt").AsBoolean().WithDefaultValue(false);
}

public override void Down()
{
Delete.Column("IncludeLearnerDeclarationPrompt").FromTable("SelfAssessments");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,8 @@ FROM SelfAssessmentSupervisorRoles AS SelfAssessmentSupervisorRoles_1
SA.ManageSupervisorsDescription,
CA.NonReportable,
U.FirstName +' '+ U.LastName AS DelegateName,
SA.MinimumOptionalCompetencies
SA.MinimumOptionalCompetencies,
SA.IncludeLearnerDeclarationPrompt
FROM CandidateAssessments CA
JOIN SelfAssessments SA
ON CA.SelfAssessmentID = SA.ID
Expand All @@ -248,7 +249,7 @@ GROUP BY
CA.LaunchCount, CA.SubmittedDate, SA.LinearNavigation, SA.UseDescriptionExpanders,
SA.ManageOptionalCompetenciesPrompt, SA.SupervisorSelfAssessmentReview, SA.SupervisorResultsReview,
SA.ReviewerCommentsLabel,SA.EnforceRoleRequirementsForSignOff, SA.ManageSupervisorsDescription,CA.NonReportable,
U.FirstName , U.LastName,SA.MinimumOptionalCompetencies, CA.SelfAssessmentProcessAgreed",
U.FirstName , U.LastName,SA.MinimumOptionalCompetencies, CA.SelfAssessmentProcessAgreed, SA.IncludeLearnerDeclarationPrompt",
new { delegateUserId, selfAssessmentId }
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public class SelfAssessment : CurrentLearningItem

public DateTime? EnrolmentCutoffDate { get; set; }
public string? RetirementReason { get; set; }
public bool IncludeLearnerDeclarationPrompt { get; set; }

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ public static CurrentSelfAssessment CreateDefaultSelfAssessment(
bool useDescriptionExpanders = true,
string vocabulary = "Capability",
string verificationRoleName = "Supervisor",
string signOffRoleName = "Supervisor"
string signOffRoleName = "Supervisor",
bool includeLearnerDeclarationPrompt = true
)
{
return new CurrentSelfAssessment
Expand All @@ -47,6 +48,7 @@ public static CurrentSelfAssessment CreateDefaultSelfAssessment(
Vocabulary = vocabulary,
VerificationRoleName = verificationRoleName,
SignOffRoleName = signOffRoleName,
IncludeLearnerDeclarationPrompt = includeLearnerDeclarationPrompt
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,10 @@ public IActionResult SelfAssessment(int selfAssessmentId)
);
return RedirectToAction("StatusCode", "LearningSolutions", new { code = 403 });
}

selfAssessmentService.IncrementLaunchCount(selfAssessmentId, delegateUserId);
if (selfAssessment.IncludeLearnerDeclarationPrompt)
Copy link
Collaborator

Choose a reason for hiding this comment

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

@kevwhitt-hee what was the intention behind checking this thing here? If it is that we don't want to increment the count if a learner just launches a SA, sees the challenge screen and decides not to proceed, then what happens if the SA is configured not to show the challenge screen? At that time we won't increment the count according to the code here. Could you please tell us in detail about the intended logic so that Sherif could correct this.

{
selfAssessmentService.IncrementLaunchCount(selfAssessmentId, delegateUserId);
}
selfAssessmentService.UpdateLastAccessed(selfAssessmentId, delegateUserId);
var supervisors = selfAssessmentService.GetAllSupervisorsForSelfAssessmentId(
selfAssessmentId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public void OnActionExecuting(ActionExecutingContext context)
context.Result = new RedirectToActionResult("StatusCode", "LearningSolutions", new { code = 403 });
return;
}

if (!selfAssessment.IncludeLearnerDeclarationPrompt) return;
var actionName = context.RouteData.Values["action"]?.ToString();
if (actionName == "AgreeSelfAssessmentProcess" || actionName == "ProcessAgreed")
{
Expand Down
Loading