Skip to content

Commit 3c5b7e8

Browse files
authored
Merge pull request #2841 from TechnologyEnhancedLearning/Develop/Fixes/TD-4384-TestFailed-Correction
TD-4384 Correction for test failed
2 parents 9c8910d + 153847e commit 3c5b7e8

File tree

4 files changed

+47
-45
lines changed

4 files changed

+47
-45
lines changed

DigitalLearningSolutions.Web/Controllers/UserFeedbackController.cs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@ IMultiPageFormService multiPageFormService
3030
this._userFeedbackService = userFeedbackService;
3131
this._multiPageFormService = multiPageFormService;
3232
this._userFeedbackViewModel = new UserFeedbackViewModel();
33-
this.config = config;
33+
this.config = config;
3434
}
3535

3636
[Route("/Index")]
3737
public IActionResult Index(string sourceUrl, string sourcePageTitle)
3838
{
3939
ViewData[LayoutViewDataKeys.DoNotDisplayUserFeedbackBar] = true;
4040
_multiPageFormService.ClearMultiPageFormData(MultiPageFormDataFeature.AddUserFeedback, TempData);
41-
41+
4242
_userFeedbackViewModel = new()
4343
{
4444
UserId = User.GetUserId(),
@@ -51,13 +51,13 @@ public IActionResult Index(string sourceUrl, string sourcePageTitle)
5151
TaskRating = null,
5252
};
5353

54-
if(sourcePageTitle == "Digital Learning Solutions - Page no longer available")
54+
if (sourcePageTitle == "Digital Learning Solutions - Page no longer available")
5555
{
5656
var url = ContentUrlHelper.ReplaceUrlSegment(sourceUrl);
57-
_userFeedbackViewModel.SourceUrl = url;
57+
_userFeedbackViewModel.SourceUrl = url;
5858
_userFeedbackViewModel.SourcePageTitle = "Welcome";
5959
}
60-
60+
6161
if (_userFeedbackViewModel.UserId == null || _userFeedbackViewModel.UserId == 0)
6262
{
6363
return GuestFeedbackStart(_userFeedbackViewModel);
@@ -198,8 +198,6 @@ public IActionResult UserFeedbackTaskAttempted(UserFeedbackViewModel userFeedbac
198198
{
199199
ViewData[LayoutViewDataKeys.DoNotDisplayUserFeedbackBar] = true;
200200

201-
//set the source URL to the sequentially previous page route which is Task Achieved
202-
userFeedbackViewModel.SourceUrl ??= "/UserFeedbackTaskAchieved";
203201
userFeedbackViewModel = MapMultiformDataToViewModel(userFeedbackViewModel);
204202

205203
return View("UserFeedbackTaskAttempted", userFeedbackViewModel);

DigitalLearningSolutions.Web/Views/UserFeedback/UserFeedbackTaskAchieved.cshtml

Lines changed: 38 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
@using DigitalLearningSolutions.Web.ViewModels.UserFeedback
2+
@using Microsoft.AspNetCore.Http.Extensions
23
@using Microsoft.AspNetCore.Mvc.TagHelpers
34

45
@model UserFeedbackViewModel;
@@ -51,44 +52,45 @@
5152

5253
<p class="nhsuk-body-l">Step 1 of 4</p>
5354

54-
<form method="post" asp-action="UserFeedbackTaskAchievedSet">
55-
<input type="hidden" asp-for="SourceUrl" value="@Context.Request.Path" /> @* changing the value of source URL to the current route *@
56-
<input type="hidden" asp-for="SourcePageTitle" value="@Model.SourcePageTitle" />
57-
<div class="nhsuk-hint" id="task-achieve-hint">
58-
Did you achieve everything you came to do today?
59-
</div>
60-
<fieldset class="nhsuk-fieldset" id="feedback-achieved-form" aria-describedby="task-achieve-hint">
61-
<div class="nhsuk-u-margin-bottom-6">
62-
<div class="nhsuk-radios__item">
63-
<input class="nhsuk-radios__input"
64-
id="feedback-achieved-yes"
65-
asp-for="TaskAchieved"
66-
type="radio"
67-
value="true">
68-
<label class="nhsuk-label nhsuk-radios__label" for="feedback-achieved-yes">
69-
Yes
70-
</label>
55+
<form method="post" asp-action="UserFeedbackTaskAchievedSet">
56+
<input type="hidden" asp-for="SourceUrl" value="@Context.Request.GetDisplayUrl()" /> @* changing the value of source URL to the current route *@
57+
<input type="hidden" asp-for="SourcePageTitle" value="@Model.SourcePageTitle" />
58+
<div class="nhsuk-hint" id="task-achieve-hint">
59+
Did you achieve everything you came to do today?
7160
</div>
72-
<div class="nhsuk-radios__item">
73-
<input class="nhsuk-radios__input"
74-
id="feedback-achieved-no"
75-
asp-for="TaskAchieved"
76-
type="radio"
77-
value="false" />
78-
<label class="nhsuk-label nhsuk-radios__label" for="feedback-achieved-no">
79-
No
80-
</label>
61+
<fieldset class="nhsuk-fieldset" id="feedback-achieved-form" aria-describedby="task-achieve-hint">
62+
<div class="nhsuk-u-margin-bottom-6">
63+
<div class="nhsuk-radios__item">
64+
<input class="nhsuk-radios__input"
65+
id="feedback-achieved-yes"
66+
asp-for="TaskAchieved"
67+
type="radio"
68+
value="true">
69+
<label class="nhsuk-label nhsuk-radios__label" for="feedback-achieved-yes">
70+
Yes
71+
</label>
72+
</div>
73+
<div class="nhsuk-radios__item">
74+
<input class="nhsuk-radios__input"
75+
id="feedback-achieved-no"
76+
asp-for="TaskAchieved"
77+
type="radio"
78+
value="false" />
79+
<label class="nhsuk-label nhsuk-radios__label" for="feedback-achieved-no">
80+
No
81+
</label>
82+
</div>
83+
</div>
84+
</fieldset>
85+
<div class="nhsuk-u-float-right">
86+
<button class="nhsuk-button" type="submit">
87+
Continue
88+
<span class="feedback-chevron">
89+
<partial name="_NhsChevronRightOffset" class="feedback-chevron" />
90+
</span>
91+
</button>
8192
</div>
82-
</div>
83-
</fieldset>
84-
<div class="nhsuk-u-float-right">
85-
<button class="nhsuk-button" type="submit">Continue
86-
<span class="feedback-chevron">
87-
<partial name="_NhsChevronRightOffset" class="feedback-chevron" />
88-
</span>
89-
</button>
90-
</div>
91-
</form>
93+
</form>
9294
</div>
9395
</div>
9496

DigitalLearningSolutions.Web/Views/UserFeedback/UserFeedbackTaskAttempted.cshtml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
@using DigitalLearningSolutions.Web.ViewModels.UserFeedback
2+
@using Microsoft.AspNetCore.Http.Extensions
23
@using Microsoft.AspNetCore.Mvc.TagHelpers
34

45
@model UserFeedbackViewModel;
@@ -29,7 +30,7 @@
2930
</div>
3031
<div class="nhsuk-grid-column-two-thirds">
3132
<form method="post" asp-action="UserFeedbackTaskAttemptedSet">
32-
<input type="hidden" asp-for="SourceUrl" value="@Context.Request.Path" />
33+
<input type="hidden" asp-for="SourceUrl" value="@Context.Request.GetDisplayUrl()" />
3334
<input type="hidden" asp-for="SourcePageTitle" value="@Model.SourcePageTitle" />
3435

3536
<p class="nhsuk-body-l">Step 2 of 4</p>

DigitalLearningSolutions.Web/Views/UserFeedback/UserFeedbackTaskDifficulty.cshtml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
@using DigitalLearningSolutions.Web.ViewModels.UserFeedback
2+
@using Microsoft.AspNetCore.Http.Extensions
23
@using Microsoft.AspNetCore.Mvc.TagHelpers
34

45
@model UserFeedbackViewModel;
@@ -31,7 +32,7 @@
3132
<p class="nhsuk-body-l">Step 3 of 4</p>
3233

3334
<form method="post" asp-action="UserFeedbackTaskDifficultySet">
34-
<input type="hidden" asp-for="SourceUrl" value="@Context.Request.Path" />
35+
<input type="hidden" asp-for="SourceUrl" value="@Context.Request.GetDisplayUrl()" />
3536
<input type="hidden" asp-for="SourcePageTitle" value="@Model.SourcePageTitle" />
3637

3738
<div class="nhsuk-hint" id="feedback-difficulty-hint">

0 commit comments

Comments
 (0)