All threads / How do i track a course progress?

Ask A Question

Notifications

You’re not receiving notifications from this thread.

How do i track a course progress?

Jay Kapoor asked in General

Hey Chris,
I have been trying to build a onemonth like sample website.
How do i track the user's progress for each of his course.
Just like onemonth all these courses have multiple episodes, and i would like to display the progress bar indicating the progress made by a user.

So we use public_activity to track the views and completions of each step. You can complete a step a few times, so to calculate the progress, you count the number of unique steps completed by the user and the total number of published steps in the course and divide those. That's really all there is to it! The public_activity gem makes creating the activity records pretty easy so than all you'll have to do is grab a count after that.

Can you post a detailed tutorial here on how do achieve this?

I don't have time to at the moment, but might be able to next week.

Or even if you can post the steps to achieve the same, that would be quite helpful as well.

Join the discussion

Want to stay up-to-date with Ruby on Rails?

Join 37,629+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    logo Created with Sketch.

    Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

    © 2020 GoRails, LLC. All rights reserved.