Canvancements - Canvas Enhancements

Surveyor
113 26 29.9K

Sometimes it's hard to find resources in the Canvas Community and often awesome things are overlooked due to the sheer volume of information. To make it easier for people, the following is a comprehensive list of Canvancements (Canvas Enhancements) james@richland.edu has developed for Canvas. James would never sing his own praises, but I have no problem doing so on his behalf. Enjoy! :smileycool:

List of Canvancements

Additional Documentation and Resources

Retired Canvancements

Questions about any of these resources should be added to that specific resources document or blog.

November 21, 2017: Greasemonkey 4 / Firefox 57 note

It appears that there is a bug with Firefox 57 that is keeping Greasemonkey 4 from working. It basically keeps any script from Github from installing, updating, or running and you can't create local scripts either. Github is where all of the source code for the Canvancements are stored. There is a way to temporarily disable a security protocol in Firefox that is provided in the bug report, but my recommendation at this point is to use Chrome or Safari or to install Tampermonkey for Firefox. Firefox will not be fixing this issue in Firefox 57 as it's not a security bug, Greasemonkey 3 no longer works after upgrading to Firefox 57, and it would completely change the way Greasemonkey injects and detects user scripts to fix (meaning I don't expect them to fix it).

Further investigation shows that existing Greasemonkey scripts may try to execute as I'm getting error messages that don't appear when Greasemonkey is disabled. Since they are loaded as content scripts, they get access to a cleaned version of the DOM and cannot see external JavaScript libraries like jQuery or variables like ENV or INST that Canvas provides as a page script. Early paranoia suggests that Greasemonkey may not be a viable solution once you upgrade to Firefox 57+. Although I've been moving towards avoiding jQuery (for no real reason at the time, but now I'm glad I did), I still use it when making AJAX calls to fetch data from Canvas.

October 1, 2019: Safari 13 note

Apple has changed the way extensions work and Safari 13 no longer supports user scripts. The initial release of Safari 13 allowed you to keep Tampermonkey installed if you already had it installed, but after I upgraded to Safari 13.0.1, it gave notice that Tampermonkey was being disabled and it was gone, although it sounds like the files may still be on the drive. See the Tampermonkey as 'Safari App Extension' thread for additional information and updates.

For the time being, if you upgrade your OS and need to use a user script, then I suggest using Chrome or Firefox.

October 20, 2019: Safari 13 update

Tampermonkey has been rewritten to work with Safari 13. Now Mac users can use Safari. The developer did decide to charge $1.99 for reasons explained in the announcement post. To install Tampermonkey for Safari, go to the App Store and search for Tampermonkey (here's a direct link to the Tampermonkey in the Apple Store). After purchasing it, you open Safari, go to Preferences, choose Extensions, and enable it. I had to restart Safari before it worked, but your experience may be different.

26 Comments
Navigator II

For anyone interested in this topic, be sure to RSVP to the CanvasLIVE event Adjust all assignment due dates on one page, which is coming up this Friday, January 13, 2017. RSVP “yes” if you will be there--and if you’re interested, but your schedule doesn’t allow you to attend in real time, RSVP "no" or "maybe" to receive all event updates. Your RSVP ensures that you will receive a notification should the event be cancelled or changed.

Instructure
Instructure

Instant bookmark! This is way cool. Thanks for compiling it, kona@richland.eduSmiley Happy 

Community Member

Kona, you are not the only one! Every time I think, "I wish Canvas could..." James has something in the Community or GitHub that is useful! Thank you, thank you, thank you!!

Community Member

Awesome resource james@richland.edu‌. awesomeness meme

Community Member

Kona, was great to hear you at InstructureCon. Thanks for sharing all the tricks of the trade that we might not have heard of otherwise! (I think you do have a direct line to those kind of improvements Smiley Happy)

Best,

Robert Maynard

Surveyor

Yeah... I'm *kinda* close to him... 😉

Glad you were able to attend the session and glad you found it helpful! 

Community Member

james@richland.edu‌ - Am I reading correctly over on the Course Roster Enhancements page that it doesn't currently work? I was trying it out and sure enough it wasn't, but I had to drill down to the comments to find out that Canvas changes broke it. Maybe kona@richland.edu can remove the link from this resource? Just so we know this is the super, trustworthy source of all Canvancements?

Navigator

No, you are not reading that page correctly. The PDF generating portions of that page do not work, but the sorting of the course roster within Canvas still works.

That said, Greasemonkey 4 has just been pushed out to Firefox users and I have not been able to get any of the scripts I've tried to work there yet. It's not completely Greasemonkey's fault as Firefox 57 changed the way that things work and required a complete rewrite of Greasemonkey, but I have not been able to figure out the new system yet. It shows every script that I have, despite saying that it can't access the file system, and doesn't show which ones are running on each page. It also doesn't automatically pick up the user.js extension to install. All this despite the description that most should work unless you're doing certain things that I'm mostly not doing.

I have not tried Tampermonkey on Firefox yet, but the sorting the course roster still works with Chrome.

Just so we know this is the super, trustworthy source of all Canvancements?

This is not my goal. Even if things break, I want to leave the source code out there so that people can take it and learn and hopefully fix it.  I did add headings this week and there may need to be one for "Orphaned" or "Broken", but it is not my intent to remove things from the list.

Community Member

Sorry, misunderstood. And I appreciate the fact that you're creating and sharing all these tools with the spirit of "Want it to do something different/better? Have at it!" Twas just my black-and-white brain getting in the way again.

Navigator

After more research, I modified the document with a note about Firefox 57 / Greasemonkey 4. It looks like Greasemonkey isn't going to work on Firefox 57 and people who want user scripts with Firefox 57 should switch to Tampermonkey. Of course, you can continue to use Tampermonkey with Chrome and Safari, too.

If I remember right, the PDF generation stuff on the Roster Enhancements never worked right with Chrome / Tampermonkey as they used some Greasemonkey specific hacks. I installed Tampermonkey on Firefox tonight and am going to miss Greasemonkey. My main reason, other than I discovered it first, was that I could edit the files with my favorite editor, but that has now been removed in the name of security.

Explorer III

Hi James,

I found it strange on Monday when my work browser updated to Firefox Quantum (57) that a Greasemonkey tab also opened along with the welcome to new Firefox tab. I popped over here to the community and didn't see anyone causing alarm about it so I figured it was just me. I still have old Firefox 56 on my home computer here so I'm going to enjoy my final days with Greasemonkey by running all the scripts all at once like a blow out sale -- just kidding. But I will delay the upgrade for as long as I can.

Tampermonkey, hmmmm... I'll give it a try at some future time--Dec 1 looks like a good random date in the future.

Thank-you for all your support, advice, and (tl dr) wisdom. Thank-you for making me look like a magician with Canvancements :smileygrin:

Cheers - Shar

Community Member

Thanks so much James.  I had just switched to Firefox Quantum yesterday morning and sent something out to our district about the change to browser extensions in Firefox 57.0+.  All of your Canvancements that I use regularly worked perfectly when I imported the scripts into Tampermonkey in Firefox (currently running 58.0b5).  A little bit of a pain to copy over but nowhere near how bad it would have been not to have the tools anymore.

I couldn't find anything on it in the community yesterday so am really happy that you added it so that there is something to reference rather than just trying to let people know ourselves what will happen if they upgrade.

As always, you are the best!!!

Instructure
Instructure

For what it's worth, another Firefox userscript manager, ViolentMonkey, also seems to install userscripts from Github just fine. And congrats to the ViolentMonkey developers for coming up with an even worse name than "TamperMonkey" -- I can't wait until I have to advise an instructor to install it on their PC!

Community Member

Question. Why for students who have been with us for multiple years am I seeing the "view all grades for student button" three times, but new students I only see it once? When I click all three buttons, they go to the same place.

Thanks,

Cassie

284291_Screen Shot 2018-08-01 at 11.07.14 AM.png

Navigator

arnold.cassie@blvs.org,

I noticed that just the other day, but I was getting ready to travel to InstructureCon and didn't get a chance to look at it. For now, let's consider it cosmetic and I'll put it on a list to look at. I've got a bunch of catching up and preparation for the fall semester so I don't have an ETA -- it comes down to when I have a few minutes and need a break.

Oh, and the answer is that Canvas changed something that I hadn't anticipated. I just have to figure out what they did and work-around it.

Community Member

james@richland.edu, does that mean Instructure doesn't consult with you prior to making changes?  :smileyshocked:

In all seriousness, was great to see you and kona@richland.edu @ InstCon last week.  You're always doing so much work for the community I just wanted to pop-in when I saw this and say thanks again for what you do.

Navigator

ken.cooper@losrios.edu, it was good to see you as well. If you consider "actively discouraging" the same as "consulting", then sure, they check with me first. They're making changes that are going to make it harder and harder for people use the custom global JavaScript, or the user scripts on a personal level.

This particular script was one of my earliest ones. I took work by codom@rhmail.org, cleaned it up a little, and packaged it into a user script. When I looked at it just now, I saw I was using jQuery, which will most likely get removed during a rewrite. I haven't used jQuery to do anything except for AJAX calls for a while and this one definitely doesn't need that.

Navigator

arnold.cassie@blvs.org

Canvas added some new buttons that were contained in divs, so changing the selector was all that was necessary to make sure it only appeared once. I did go ahead and rewrite it without the jQuery. I went ahead and updated it to run inside an enclosure and use strict mode while I was at it. I also shortened the text a little so it doesn't line wrap -- it now says "View All Grades" without the "for Student"

I've posted the new script to GitHub. The script in your browser will probably auto-update within a week, or you can go to the Tampermonkey menu and choose "Check for userscript updates". Either way, it will probably warn you of the changes that were made -- it's basically a complete rewrite. If you had to customize your //include line of the header, you may need to update that again.

I'm working on making changes to the companion script as well that displays the name on the grades page. I'm making it so that it doesn't base its decision about the heading based on text in the heading. That will make it work with internationalized text. I want to change the user's name in a couple of other places and remove the jQuery requirement.

Community Member

This is awesome. Thank you so much for updating!

Explorer

Hello James and everyone else,

I am not sure of what your roles are at your individual institutions and what systems you have elevated access to but a few moments ago I was forwarded an email from a System Administrator in my institution's IT Department because they received a notice from Google about Google Scripts.  A copy of the email is provided below.

---------- Forwarded message ---------
From: The G Suite Team
Date: Thu, Jul 18, 2019 at 6:20 AM ET
Subject: Restriction of Apps Script UserProperties Service

Dear G Suite Administrator,

We're writing to inform you of a change in behavior to the UserProperties service when called from either Apps Script or App Maker. Previously, properties written to the UserProperties service were scoped to a user yet, shared between all scripts belonging to the user. Starting July 16 2019, new properties stored in the UserProperties service will be scoped to the user writing them and to the script from which they were written. Accordingly, user-specific properties are no longer shared between scripts.

Properties written before the change on July 16, 2019 are no longer programmatically available, however, we've added a new page to the Apps Script editor where you may retrieve these properties. You may visit the new page by accessing File > Project properties > Deprecated user properties (read-only). As some scripts depend on the data stored in these properties, you may need to repopulate these script's properties via the UserProperties service.

To make the transition smooth, we've made an effort to maintain your script's access to properties they've used recently. Between April 1, 2019 and July 16 2019, if one of your scripts used a property from the UserProperties service, that property was copied and the copy remains available via the UserProperties service. These copied properties are not shared between scripts. For your convenience, we are including details on these scripts below:

Attached is a csv file which includes URL for the script and owner email address for the different Apps scripts that appear to make use of the UserProperties API. If you have any questions on the above message, please contact G Suite Support and reference issue number 136290968.

We appreciate your business and sincerely apologize for any inconvenience this may have caused.

Sincerely,

The G Suite Team

Our institution has only been a Canvas customer since January 2018 so our use of these scripts has been limited and I have only mentioned the existence of "Canvancements" to a few of our instructors.

I have used a few of these, not for anything "mission critical" and for experimenting with, but for me it appears the scripts that were flagged are associated with Bulk Publish / Delete Pages and How to list teachers who have published/unpublished courses.

I wanted to bring this to your attention in case (a) you are actively using them for anything important and (b) if there are any changes James (or others) need to make in order to allow the associated Google Sheets and Google Scripts to keep working.

James, did you receive a similar email and what are your initial thoughts related to it or what I shared above?

Doug

Navigator

Thanks for that information, dbrace@lccc.edu.

We do not use G-Suite and I did not get a copy of that.

Previously, properties written to the UserProperties service were scoped to a user yet, shared between all scripts belonging to the user.  Starting July 16 2019, new properties stored in the UserProperties service will be scoped to the user writing them and to the script from which they were written. Accordingly, user-specific properties are no longer shared between scripts.

I did not even know that was a thing.I thought you had to put in an access token for each script / sheet, not one that would work for all of them. That sounds like a security flaw (I write a script you're using, but someone else's script that you're running could access the data from my script). I don't know if that was specific to G-Suite or not. What they are saying they are changing to is the behavior I thought they had the entire time, so I'm perfectly okay with it.

I might mean that people running more than one Google Sheet that makes API calls may need to get a new access token (if they didn't save their old one somewhere) and re-enter it into the script like you're starting over. You can still use the same token in multiple scripts, but Google won't automatically share it from one to another. If you do generate a new token, you may want to go into Canvas and delete the old access token.

Explorer

You are welcome for the information. We all have different roles and ways that we incorporate tools (someone might be using a personal Google account while others might be using a G Suite account) so we all do not access to the same notifications about changes to products.

In short, based on what I have shared and your response, it seems that your Sheets and their associated scripts do not need to be changed.  Is that correct?

Navigator

Without firsthand knowledge, I think that's correct. It does not sound like anything impacting the actual script needs to change. There just may be an inconvenience for people where they stop working and they don't know why.

Community Member

Jim, thanks as always for some great work. You same me & my colleagues hundreds of hours every year!

For some reason, my QuizWiz stopped working. I'm running Firefox 69.0.1 with Tampermonkey 4.9.5941. I'm using the Rubric script. Any news on this?

Navigator

It's James, not Jim.

I do not have any news on this. I just opened up Firefox and Tampermonkey with the same versions you have and the Rubric script is working correctly for me. Well, I guess it depends on what you mean by "stopped working." I didn't actually use it to grade, but it loaded and the "update and advance" buttons are there and appear to work.

Intermittently, the content delivery network has issues that resolve themselves. It's ultimately hosted through cloudflare and I've had some issues with other sites that temporarily stop working with them recently. Usually it resolves itself within a couple of minutes for Cloudflare issues, but when the original site (gitcdn.link) has issues, it's been down for a couple of days in the past. The difference is that with the other site, it pops up an error message on the screen -- in the case of QuizWiz, it would only show up if you were looking at the Network tab of the browser's developer tools (can press F12 in your browser). If it comes up with an error, it just won't run, and QuizWiz won't work.

Another thing you can check is the Tampermonkey icon. Make sure that it's showing a red numbered badge indicating that a script is running. For example, here I have 7 scripts running on the SpeedGrader page.

324746_pastedImage_4.png

On Yahoo, I don't have any scripts running.

324747_pastedImage_5.png

Depending on whether or not Tampermonkey thinks there is supposed to be a script running will determine the next step in troubleshooting.

Before you do any of that, I would clear the browser cache (shift-ctrl-delete). Canvas put out a release this weekend and, at least in the past, it sometimes takes a little time to stabilize with the new versions of all the code. Clearing the cache normally helps speed that process along. I did clear my cache in my testing just to make sure I wasn't running some of the old code.

Community Member

First, deepest apologies, James. I was having a Star Trek moment Smiley Happy

It's all working fine at my office--same versions of all software. I was at home when I had the issue yesterday, so I hope it has resolved itself. As I've read through some of the other threads, things do have a tendency to sort themselves out.

About the Author
Kona Jones is the Director of Online Learning and Faculty Academy Coordinator at Richland Community College in Decatur, IL. She is responsible for the assessment of online courses and initiatives, providing instructional design and pedagogical support to faculty, development of faculty and student technology training materials, and overseeing faculty professional development. She serves as a technology resource for the College as well as an adjunct instructor of statistics. Her particular passion is student retention in online courses and more specifically on assessing how different initiatives can improve student retention. She has a M.S. degree in Quantitative and Cognitive Psychology, Undergraduate degrees in Biology, Psychology, & History, and is ABD in Curriculum & Instruction.