Skip to content

Commit 9af1dd8

Browse files
committed
Merge branch 'Release-2024.32' into Release-2024.38
2 parents 9d07715 + 572af95 commit 9af1dd8

File tree

20 files changed

+242
-120
lines changed

20 files changed

+242
-120
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
namespace DigitalLearningSolutions.Data.Migrations
2+
{
3+
using FluentMigrator;
4+
5+
[Migration(202408141400)]
6+
public class Alter_uspCreateProgressRecord_V3_UtcDate : Migration
7+
{
8+
public override void Up()
9+
{
10+
Execute.Sql(Properties.Resources.TD_4436_Alter_uspCreateProgressRecord_V3_Up);
11+
}
12+
public override void Down()
13+
{
14+
Execute.Sql(Properties.Resources.TD_4436_Alter_uspCreateProgressRecord_V3_Down);
15+
}
16+
}
17+
}

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

Lines changed: 75 additions & 31 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: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,4 +412,10 @@
412412
<data name="TD_4243_Alter_GetCurrentCoursesForCandidate_V2_proc_up" type="System.Resources.ResXFileRef, System.Windows.Forms">
413413
<value>..\Resources\TD-4243_Alter_GetCurrentCoursesForCandidate_V2_proc_up.sql;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
414414
</data>
415-
</root>
415+
<data name="TD_4436_Alter_uspCreateProgressRecord_V3_Down" type="System.Resources.ResXFileRef, System.Windows.Forms">
416+
<value>..\Scripts\TD-4436-Alter_uspCreateProgressRecord_V3_Down.sql;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-16</value>
417+
</data>
418+
<data name="TD_4436_Alter_uspCreateProgressRecord_V3_Up" type="System.Resources.ResXFileRef, System.Windows.Forms">
419+
<value>..\Scripts\TD-4436-Alter_uspCreateProgressRecord_V3_Up.sql;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-16</value>
420+
</data>
421+
</root>
Binary file not shown.

DigitalLearningSolutions.Data/DataServices/CourseContentDataService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ FROM Sessions AS S1 WITH (NOLOCK)
251251
WHERE S1.CandidateID = Progress.CandidateID
252252
AND S1.CustomisationID = Progress.CustomisationID
253253
AND S1.LoginTime >= Progress.FirstSubmittedTime),
254-
SubmittedTime = GETDATE()
254+
SubmittedTime = GETUTCDATE()
255255
WHERE Progress.ProgressID = @progressId",
256256
new { progressId }
257257
);

DigitalLearningSolutions.Data/DataServices/SelfAssessmentDataService/CandidateAssessmentsDataService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ GROUP BY
171171
public void UpdateLastAccessed(int selfAssessmentId, int delegateUserId)
172172
{
173173
var numberOfAffectedRows = connection.Execute(
174-
@"UPDATE CandidateAssessments SET LastAccessed = GETDATE()
174+
@"UPDATE CandidateAssessments SET LastAccessed = GETUTCDATE()
175175
WHERE SelfAssessmentID = @selfAssessmentId AND DelegateUserID = @delegateUserId",
176176
new { selfAssessmentId, delegateUserId }
177177
);

DigitalLearningSolutions.Web.Tests/Controllers/Login/LoginControllerTests.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ namespace DigitalLearningSolutions.Web.Tests.Controllers.Login
1313
using DigitalLearningSolutions.Data.Models.User;
1414
using DigitalLearningSolutions.Data.Utilities;
1515
using DigitalLearningSolutions.Web.Controllers;
16+
using DigitalLearningSolutions.Web.Helpers;
1617
using DigitalLearningSolutions.Web.Models.Enums;
1718
using DigitalLearningSolutions.Web.Services;
1819
using DigitalLearningSolutions.Web.Tests.ControllerHelpers;
@@ -59,7 +60,7 @@ public void SetUp()
5960
config = A.Fake<IConfiguration>();
6061
apiClient = A.Fake<ILearningHubUserApiClient>();
6162

62-
63+
DateHelper.userTimeZone = DateHelper.DefaultTimeZone;
6364
A.CallTo(() => clockUtility.UtcNow).Returns(DateTime.UtcNow);
6465

6566
controller = new LoginController(

DigitalLearningSolutions.Web/Controllers/LearningMenuController/LearningMenuController.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ public IActionResult Section(int customisationId, int sectionId)
259259
courseContentService.UpdateProgress(progressId.Value);
260260
};
261261

262-
SetTempData(candidateId, customisationId);
262+
SetTempData(candidateId, customisationId, progressId.Value);
263263

264264
var model = new SectionContentViewModel(config, sectionContent, customisationId, sectionId);
265265
return View("Section/Section", model);
@@ -300,7 +300,7 @@ public IActionResult Diagnostic(int customisationId, int sectionId)
300300
courseContentService.UpdateProgress(progressId.Value);
301301
};
302302

303-
SetTempData(candidateId, customisationId);
303+
SetTempData(candidateId, customisationId, progressId.Value);
304304
var model = new DiagnosticAssessmentViewModel(diagnosticAssessment, customisationId, sectionId);
305305
return View("Diagnostic/Diagnostic", model);
306306
}
@@ -336,7 +336,7 @@ public IActionResult DiagnosticContent(int customisationId, int sectionId, List<
336336
courseContentService.UpdateProgress(progressId.Value);
337337
};
338338

339-
SetTempData(candidateId, customisationId);
339+
SetTempData(candidateId, customisationId, progressId.Value);
340340
var model = new DiagnosticContentViewModel(
341341
config,
342342
diagnosticContent,
@@ -385,7 +385,7 @@ public IActionResult PostLearning(int customisationId, int sectionId)
385385
courseContentService.UpdateProgress(progressId.Value);
386386
};
387387

388-
SetTempData(candidateId, customisationId);
388+
SetTempData(candidateId, customisationId, progressId.Value);
389389
var model = new PostLearningAssessmentViewModel(postLearningAssessment, customisationId, sectionId);
390390
return View("PostLearning/PostLearning", model);
391391
}
@@ -474,7 +474,7 @@ public async Task<IActionResult> Tutorial(int customisationId, int sectionId, in
474474
courseContentService.UpdateProgress(progressId.Value);
475475
};
476476

477-
SetTempData(candidateId, customisationId);
477+
SetTempData(candidateId, customisationId, progressId.Value );
478478
/* Course progress doesn't get updated if the auth token expires by the end of the tutorials.
479479
Some tutorials are longer than the default auth token lifetime of 1 hour, so we set the auth expiry to 8 hours.
480480
See HEEDLS-637 and HEEDLS-674 for more details */
@@ -608,7 +608,7 @@ public IActionResult CompletionSummary(int customisationId)
608608
courseContentService.UpdateProgress(progressId.Value);
609609
};
610610

611-
SetTempData(candidateId, customisationId);
611+
SetTempData(candidateId, customisationId, progressId.Value);
612612
var model = new CourseCompletionViewModel(config, courseCompletion, progressId.Value);
613613
return View("Completion/Completion", model);
614614
}

DigitalLearningSolutions.Web/Controllers/LoginController.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,16 @@ public IActionResult Index(string? returnUrl = null)
7070
}
7171

7272
[HttpPost]
73-
public async Task<IActionResult> Index(LoginViewModel model)
73+
public async Task<IActionResult> Index(LoginViewModel model, string timeZone = "Europe/London")
7474
{
75+
ModelState.Remove("timeZone");
7576
if (!ModelState.IsValid)
7677
{
7778
return View("Index", model);
7879
}
7980

81+
DateHelper.userTimeZone = timeZone ?? DateHelper.DefaultTimeZone;
82+
8083
var loginResult = loginService.AttemptLogin(model.Username!.Trim(), model.Password!);
8184

8285
switch (loginResult.LoginAttemptResult)

0 commit comments

Comments
 (0)