Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding average learner data to course sidebar #1135

Merged
merged 10 commits into from
Dec 2, 2022

Conversation

hlashbrooke
Copy link
Collaborator

This PR adds the average learner data for a course to the sidebar on the single course page.

Some questions from my side that I'm uncertain about:

  • I did everything in the sidebar-course.php template file, but should the logic perhaps be added to a function elsewhere?
  • Should this instead be defined as a block that can be moved around as a widget?
  • Is the HTML semantic and accessible?

I'm happy to make changes accordingly but thought I'd get the initial PR up first for feedback.

Fixes #1089

@hlashbrooke hlashbrooke self-assigned this Nov 30, 2022
@hlashbrooke hlashbrooke added this to In Review in Website Development Nov 30, 2022
Copy link
Contributor

@adamwoodnz adamwoodnz left a comment

Choose a reason for hiding this comment

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

Great start!

I think it would nice to reuse the styling from Workshop Details for this:

Screen Shot 2022-12-01 at 3 04 23 PM

This is a block in the Learn plugin, so you could replicate that and pass in the Course data. Or if there isn't value in having this as a block you could move the logic to functions.php and use similar markup and style in the theme. What do you think?

@hlashbrooke
Copy link
Collaborator Author

Oh yeah - that styling would make a lot of sense - I'll update the markup for that.

This is a block in the Learn plugin, so you could replicate that and pass in the Course data.

I like that - I wasn't sure how we create those blocks, but that makes a lot more sense and allows us to position things more dynamically, so I would much rather we do it that way. I'll work on changing things up there.

@adamwoodnz
Copy link
Contributor

Cool, just took another look and the Lesson Plan Details block is a little simpler, I'd use that as a starting point

@hlashbrooke
Copy link
Collaborator Author

Add the new 'Course Data' block to the courses sidebar to test.

Copy link
Contributor

@adamwoodnz adamwoodnz left a comment

Choose a reason for hiding this comment

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

One change, otherwise LGTM!

@hlashbrooke
Copy link
Collaborator Author

Changes made - the CSS is no longer using !important and I removed the lp-details class from the sidebar markup. I confirmed that removing that class did not cause any layout issues with the existing sidebar blocks.

Copy link
Contributor

@adamwoodnz adamwoodnz left a comment

Choose a reason for hiding this comment

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

LGTM :shipit: 🚀

I'm temporarily removing the completion rate from this data (commenting it out rather than deleting it) as the completion rate metric is not actually helpful, given how quizzes and completions work in our courses.

There is a more helpful data point of "average progress" that is in the dashboard reports, however it isn't readily available for access on the frontend. I'm also not convinced it's a useful data point either way, so I'd like to get this update live and we can figure that out later on.
@hlashbrooke
Copy link
Collaborator Author

Commented out code has been removed - PR is ready to merge now.

@adamwoodnz adamwoodnz merged commit 3d09842 into trunk Dec 2, 2022
Website Development automation moved this from In Review to Done Dec 2, 2022
@adamwoodnz adamwoodnz deleted the add-frontend-course-data branch December 2, 2022 01:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants