Skip to content

Conversation

@ibrahimmunir14
Copy link
Contributor

@ibrahimmunir14 ibrahimmunir14 commented Jul 21, 2021

Supervisor: YES; Completed: NO; Assessed: YES; Attempts: NO; Custom fields: NO

Supervisor: NO; Completed: YES; Assessed: YES; Attempts: YES; Custom fields: NO

Supervisor: NO; Completed: NO; Assessed: NO; Attempts: NO; Custom fields: YES

Tablet

Mobile

Copy link
Contributor

@DanBloxham-sw DanBloxham-sw left a comment

Choose a reason for hiding this comment

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

Few minor things, might require some refactoring to use CustomPromptWithAnswer class.

add service method; write test; update view/vm/controller
simplify nullable date assignments; add empty actions dd to fix row separators; fix swapped field values; remove unneeded role=alert
Copy link
Contributor

@DanBloxham-sw DanBloxham-sw left a comment

Choose a reason for hiding this comment

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

Looks good. Minor comment about renaming a display field, but no need for reapproval from me.

I think the empty action on all the fields should fix the line issue, but it would be nice to have an updated screen shot as well.

…or ViewDelegate accessibility test to avoid timeout
Fix problem of lonely % sign when value is null, without needing an extra check in the view
INNER JOIN dbo.Applications AS ap ON ap.ApplicationID = cu.ApplicationID
WHERE (ap.CourseCategoryID = @categoryId OR @categoryId = 0)
AND cu.CentreID = @centreId
AND ap.ArchivedDate IS NULL
Copy link
Contributor

Choose a reason for hiding this comment

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

We should never need to pull archived courses to my knowledge - any reason for this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We decided to move these filters into the service.
CategoryId filter needed to be optional, so we added service methods to make it cleaner.
Then I wasn't sure whether or not archived courses were included in delegate courses, so pulled that filter out too for consistency. If it's more flexible than needed I can put the archived date filter back into the sql?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should keep the Archived filter in the SQL for now, we can always bring it back if we need to in the future, but it seems unlikely that we would want to show archived courses.

namespace DigitalLearningSolutions.Data.Services
{
using System.Collections.Generic;
using System.Linq;
Copy link
Contributor

Choose a reason for hiding this comment

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

This is getting quite long - I wonder if we could refactor this into two separate services, one for registration prompts and the other for admin fields.. Olivia is working on this too atm, so she could potentially do the refactor later.

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree with this, it's at a similar length to the UserDataService I've just split. @livzorn FYI, this split might come your way at the end of the admin fields work.

Copy link
Contributor

Choose a reason for hiding this comment

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

@AlexJacksonDS ah yeah thanks, I'll keep that in mind!

Comment on lines +227 to +228
@"SELECT COUNT(aa.Status) AS TotalAttempts,
COUNT(CASE WHEN aa.Status=1 THEN 1 END) AS AttemptsPassed
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if it makes sense pulling these two numbers together with other course data?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I thought it would make the query too complicated. Also these are not needed in many cases any where IsAssessed=0.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think there is a bit more refactoring needed in that case (also see my comment on the controller). If these aren't needed because IsAssessed=0, why are we still always calling it?

@ibrahimmunir14 ibrahimmunir14 requested a review from stellake July 26, 2021 13:11
Copy link
Contributor

@AlexJacksonDS AlexJacksonDS left a comment

Choose a reason for hiding this comment

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

A few things that I think need changing.

Comment on lines +227 to +228
@"SELECT COUNT(aa.Status) AS TotalAttempts,
COUNT(CASE WHEN aa.Status=1 THEN 1 END) AS AttemptsPassed
Copy link
Contributor

Choose a reason for hiding this comment

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

I think there is a bit more refactoring needed in that case (also see my comment on the controller). If these aren't needed because IsAssessed=0, why are we still always calling it?

INNER JOIN dbo.Applications AS ap ON ap.ApplicationID = cu.ApplicationID
WHERE (ap.CourseCategoryID = @categoryId OR @categoryId = 0)
AND cu.CentreID = @centreId
AND ap.ArchivedDate IS NULL
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should keep the Archived filter in the SQL for now, we can always bring it back if we need to in the future, but it seems unlikely that we would want to show archived courses.

Copy link
Contributor

@AlexJacksonDS AlexJacksonDS left a comment

Choose a reason for hiding this comment

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

Some remaining ArchivedDate to remove still.
I don't think an IEnumerable<(DelegateCourseInfo info, List prompts, (int, int) stats)> is a good idea really. Replace this with an IEnumerable of a new class
New CourseService method needs unit tests, unless I've missed them?

Copy link
Contributor

@AlexJacksonDS AlexJacksonDS left a comment

Choose a reason for hiding this comment

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

Looks OK to me now 👍

@ibrahimmunir14 ibrahimmunir14 merged commit 661d517 into master Jul 29, 2021
@stellake stellake deleted the HEEDLS-555-view-delegate-page-course-section branch August 11, 2021 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants