Celebrate Excellence in Education: Nominate Outstanding Educators by April 15!
Found this content helpful? Log in or sign up to leave a like!
The Need:
Current module tracker has generic "Complete all items". This could be a handy completion tracker for students and teachers. The tracker keeps track of how many items in each module that the student has successfully completed.
My Custom Solution:
I "hacked" together a custom solution that looks for the green "completion check mark icon". It counts how many of those green checks there are in a module and uses that number for a completion tracker in the header of the module.
This tracker automatically updates as students complete items in the module.
Note:
For this to work, the items in your module must have some type of "completion criteria set". For example, if it's a quiz, it needs a passing grade assigned to it. If it's a content page item, you must have the "view" criteria set on it.
Installation:
You need access to your custom Javascript file. Paste the code below into that file.
Note: I have my instance of Canvas running on jquery 3.x+. Canvas by default runs on jquery 1.x. I'm not 100% sure at the moment if this would work on a default instance of Canvas. Can someone verify?
The code:
Module Completion Tracker · GitHub
Solved! Go to Solution.
If you modify it to the following it should make it so that it only finds rows that are set as a module requirement. However, I didn't test how accurate the count is if the module requirements are set-up to only require some and not all of the requirements.
var igRows = $(this).find("li.progression_requirement div.ig-row");
var totalItems = igRows.length;
As a side note, with how short this script is, it may be good to invest some time into converting it into using vanilla JavaScript to remove the dependency on jQuery based on recent recommendations. Updating jQuery in Canvas
This ought to be part of the native Canvas code. Make this an idea and you'll have my vote! A prior LMS had this option as part of its equivalent to the Modules tool. It was even better in that there was an option to turn on the equivalent of the "View" requirement for all items within a [module].
If this goes in as a feature idea I'll give it an up vote, too. Would like to see something like this for students to see progress.
Can you put the code in a downloadable format instead of an image?
Thanks
GitHub would be awesome.
Here you go John.
I added a bunch of comments, so hopefully that helps if you need to edit it.
Module Completion Tracker · GitHub
Just let me know if you need anything else.
Jeremy,
Absolutely love this, but...
Would there be a way to have it detect if something is actually required on a line, vice just a line existing?
Another way to put this -- could it determine the denominator of the fraction based on the logic in the requirements settings for a module (vice just counting lines)?
We have some courses that give the student an option: Complete 2 of 3 assignments, or view line 1/submit line 2/line 3 is optional (e.g., has no requirement). In each of these cases, the script returns x/3 when it really is x/2.
FWIW - I'm not a coder so I have no idea what would be required for this, but I concur that it should be part of the Canvas base code.
Thanks for what you do!
Could I customize this code so when the module is complete a notification will go to an email?
YES! Modules are woefully inadequate for tracking progress and signaling/ situational awareness within a course. This tracker plus changing breadcrumbs to follow the module path (vs. the tool) would go a loooooong way toward improving the functionality of modules.
Hola muchas gracias por tu trabajo, no sabes cuanto nos ayudara este código en la institución donde pertenezco.
@jbell0385 Might I suggest (request?) that you place this in the Ideas space so the Canvas LMS Community can vote on it for development? I would be very happy to implement your code, but am currently stretched too think to do that kind of custom dev in a subaccount.
I have come across this very late - 6 years to be precise. I am amazed that this has not been followed up and made part of the Module experience.
I installed this on our test account and perhaps due to various iterations, there is one thing in it that does not work so well. In making a count of the possible items that a student has to do, the code counts up every aspect of the module which includes any Text headers.
I am sure there must a be a straightforward change you can make to the javascript if oyu are familiar with such language.
Might anyone like ot step in and update?
Many thanks in advance
Gideon
Hey, @GideonWilliams based on a quick look at the code, these two lines have to be edited, as they seem to be counting up the total number of items in the module:
var igRows = $(this).find(".ig-row");
var totalItems = igRows.length
You'll need to find a way to count up anything that isn't a text header (or other items) -- I can read Javascript (programming languages have similar constructs :)) but I can't work jQuery very well. You'll have to do some kind of for loop over the actual module and then do a count of non-text header items.
If you modify it to the following it should make it so that it only finds rows that are set as a module requirement. However, I didn't test how accurate the count is if the module requirements are set-up to only require some and not all of the requirements.
var igRows = $(this).find("li.progression_requirement div.ig-row");
var totalItems = igRows.length;
As a side note, with how short this script is, it may be good to invest some time into converting it into using vanilla JavaScript to remove the dependency on jQuery based on recent recommendations. Updating jQuery in Canvas
James, you are a superstar - many thanks! Works brilliantly (for now) Thanks for the heads up about iQuery. Cross that bridge when it happens....! Gid
Many thanks for the heads up and helping me get closer to the answer.
To participate in the Instructure Community, you need to sign up or log in:
Sign In