Skip to content

Commit 9f8636c

Browse files
authored
Merge pull request #2744 from TechnologyEnhancedLearning/Develop/Fix/TD-4223-Last-access-date-IssueFix
TD-4223- 'Last access' date shouldn't be seen for the delegate record for the courses when enrolled by admin on 'Tracking system' & 'Learning Portal'
2 parents a21da3e + a27f116 commit 9f8636c

File tree

7 files changed

+123
-37
lines changed

7 files changed

+123
-37
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
namespace DigitalLearningSolutions.Data.Migrations
2+
{
3+
using FluentMigrator;
4+
using System.Diagnostics.Metrics;
5+
6+
[Migration(202407120905)]
7+
public class AlterConstraintForProgress : Migration
8+
{
9+
public override void Up()
10+
{
11+
Execute.Sql(@$"ALTER TABLE [dbo].[Progress] DROP CONSTRAINT [DF_Progress_FirstSubmittedTime];
12+
ALTER TABLE [dbo].[Progress] ADD CONSTRAINT [DF_Progress_FirstSubmittedTime] DEFAULT (GETDATE()) FOR [FirstSubmittedTime];");
13+
}
14+
public override void Down()
15+
{
16+
Execute.Sql(@$"ALTER TABLE [dbo].[Progress] DROP CONSTRAINT [DF_Progress_FirstSubmittedTime];
17+
ALTER TABLE [dbo].[Progress] ADD CONSTRAINT [DF_Progress_FirstSubmittedTime] DEFAULT (GETUTCDATE()) FOR [FirstSubmittedTime]");
18+
}
19+
}
20+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using FluentMigrator;
2+
namespace DigitalLearningSolutions.Data.Migrations
3+
{
4+
[Migration(202407121718)]
5+
public class UpdateProgressForEnrollmentMethod : Migration
6+
{
7+
public override void Up()
8+
{
9+
Execute.Sql(Properties.Resources.TD_4223_Alter_GroupCustomisation_Add_V2_Up);
10+
}
11+
public override void Down()
12+
{
13+
Execute.Sql(Properties.Resources.TD_4223_Alter_GroupCustomisation_Add_V2_Down);
14+
}
15+
}
16+
}

DigitalLearningSolutions.Data.Migrations/Properties/Resources.Designer.cs

Lines changed: 65 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

DigitalLearningSolutions.Data.Migrations/Properties/Resources.resx

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -388,18 +388,22 @@
388388
<data name="TD_3671_Alter_GetCurrentCoursesForCandidate_V2_proc_up" type="System.Resources.ResXFileRef, System.Windows.Forms">
389389
<value>..\Resources\TD-3671-Alter_GetCurrentCoursesForCandidate_V2_proc_up.sql;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
390390
</data>
391-
392-
<data name="TD_4223_Alter_uspCreateProgressRecord_V3_Down" type="System.Resources.ResXFileRef, System.Windows.Forms">
393-
<value>..\Scripts\TD-4223-Alter_uspCreateProgressRecord_V3_Down.sql;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-16</value>
394-
</data>
395-
<data name="TD_4223_Alter_uspCreateProgressRecord_V3_Up" type="System.Resources.ResXFileRef, System.Windows.Forms">
396-
<value>..\Scripts\TD-4223-Alter_uspCreateProgressRecord_V3_Up.sql;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-16</value>
397-
</data>
398-
399-
<data name="TD_4223_Alter_uspCreateProgressRecordWithCompleteWithinMonths_Quiet_V2_Down" type="System.Resources.ResXFileRef, System.Windows.Forms">
400-
<value>..\Scripts\TD-4223-Alter_uspCreateProgressRecordWithCompleteWithinMonths_Quiet_V2_Down.sql;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-16</value>
401-
</data>
402-
<data name="TD_4223_Alter_uspCreateProgressRecordWithCompleteWithinMonths_Quiet_V2_Up" type="System.Resources.ResXFileRef, System.Windows.Forms">
403-
<value>..\Scripts\TD-4223-Alter_uspCreateProgressRecordWithCompleteWithinMonths_Quiet_V2_Up.sql;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-16</value>
404-
</data>
405-
</root>
391+
<data name="TD_4223_Alter_uspCreateProgressRecord_V3_Down" type="System.Resources.ResXFileRef, System.Windows.Forms">
392+
<value>..\Scripts\TD-4223-Alter_uspCreateProgressRecord_V3_Down.sql;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-16</value>
393+
</data>
394+
<data name="TD_4223_Alter_uspCreateProgressRecord_V3_Up" type="System.Resources.ResXFileRef, System.Windows.Forms">
395+
<value>..\Scripts\TD-4223-Alter_uspCreateProgressRecord_V3_Up.sql;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-16</value>
396+
</data>
397+
<data name="TD_4223_Alter_uspCreateProgressRecordWithCompleteWithinMonths_Quiet_V2_Down" type="System.Resources.ResXFileRef, System.Windows.Forms">
398+
<value>..\Scripts\TD-4223-Alter_uspCreateProgressRecordWithCompleteWithinMonths_Quiet_V2_Down.sql;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-16</value>
399+
</data>
400+
<data name="TD_4223_Alter_uspCreateProgressRecordWithCompleteWithinMonths_Quiet_V2_Up" type="System.Resources.ResXFileRef, System.Windows.Forms">
401+
<value>..\Scripts\TD-4223-Alter_uspCreateProgressRecordWithCompleteWithinMonths_Quiet_V2_Up.sql;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-16</value>
402+
</data>
403+
<data name="TD_4223_Alter_GroupCustomisation_Add_V2_Down" type="System.Resources.ResXFileRef, System.Windows.Forms">
404+
<value>..\Scripts\TD-4223-Alter_GroupCustomisation_Add_V2_Down.sql;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-16</value>
405+
</data>
406+
<data name="TD_4223_Alter_GroupCustomisation_Add_V2_Up" type="System.Resources.ResXFileRef, System.Windows.Forms">
407+
<value>..\Scripts\TD-4223-Alter_GroupCustomisation_Add_V2_Up.sql;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-16</value>
408+
</data>
409+
</root>
Binary file not shown.
Binary file not shown.

DigitalLearningSolutions.Data/DataServices/SelfAssessmentDataService/CandidateAssessmentsDataService.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ GROUP BY
170170
public void UpdateLastAccessed(int selfAssessmentId, int delegateUserId)
171171
{
172172
var numberOfAffectedRows = connection.Execute(
173-
@"UPDATE CandidateAssessments SET LastAccessed = GETUTCDATE()
173+
@"UPDATE CandidateAssessments SET LastAccessed = GETDATE()
174174
WHERE SelfAssessmentID = @selfAssessmentId AND DelegateUserID = @delegateUserId",
175175
new { selfAssessmentId, delegateUserId }
176176
);
@@ -297,7 +297,7 @@ public void IncrementLaunchCount(int selfAssessmentId, int delegateUserId)
297297
public void SetSubmittedDateNow(int selfAssessmentId, int delegateUserId)
298298
{
299299
var numberOfAffectedRows = connection.Execute(
300-
@"UPDATE CandidateAssessments SET SubmittedDate = GETUTCDATE()
300+
@"UPDATE CandidateAssessments SET SubmittedDate = GETDATE()
301301
WHERE SelfAssessmentID = @selfAssessmentId AND DelegateUserID = @delegateUserId AND SubmittedDate IS NULL",
302302
new { selfAssessmentId, delegateUserId }
303303
);
@@ -314,7 +314,7 @@ public void SetSubmittedDateNow(int selfAssessmentId, int delegateUserId)
314314
public void RemoveEnrolment(int selfAssessmentId, int delegateUserId)
315315
{
316316
connection.Execute(
317-
@"UPDATE CandidateAssessments SET RemovedDate = GETUTCDATE()
317+
@"UPDATE CandidateAssessments SET RemovedDate = GETDATE()
318318
WHERE SelfAssessmentID = @selfAssessmentId AND DelegateUserID = @delegateUserId",
319319
new { selfAssessmentId, delegateUserId }
320320
);

0 commit comments

Comments
 (0)