Canvancements - Canvas Enhancements

kona
Community Coach
Community Coach
51
75454

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 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.

51 Comments
Stef_retired
Instructure Alumni
Instructure Alumni

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.

rconroy
Instructure Alumni
Instructure Alumni

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

sbeck1
Community Champion

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!!

cholling
Community Champion

Awesome resource  @James ‌. awesomeness meme

rmaynard
Community Explorer

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

kona
Community Coach
Community Coach
Author

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

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

tdelillo
Community Champion

 @James ‌ - 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  can remove the link from this resource? Just so we know this is the super, trustworthy source of all Canvancements?

James
Community Champion

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.

tdelillo
Community Champion

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.

James
Community Champion

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.

Shar
Community Champion

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

ken_cooper
Community Participant

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!!!

britain_woodman
Community Participant

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!

arnold_cassie
Community Participant

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

James
Community Champion

 @arnold_cassie ,

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.

ken_cooper
Community Participant

 @James , does that mean Instructure doesn't consult with you prior to making changes?  :smileyshocked:

In all seriousness, was great to see you and  @kona  @ 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.

James
Community Champion

 @ken_cooper , 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 , 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.

James
Community Champion

 @arnold_cassie 

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.

arnold_cassie
Community Participant

This is awesome. Thank you so much for updating!

dbrace
Community Coach
Community Coach

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

James
Community Champion

Thanks for that information,  @dbrace .

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.

dbrace
Community Coach
Community Coach

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?

James
Community Champion

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.

rmaynard
Community Explorer

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?

James
Community Champion

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.

rmaynard
Community Explorer

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.

saltman
Community Participant

@kona and @James Thank you for your never-ending work with Canvas!  I am looking for 3 things:

1) The canvancement that auto-opens a rubric in speedgrader.

2) Removing Missing and Late Labels (hyperlink isn't working today)

3) And a Canvancement that I don't think has been created... yet. (Growth mindset?) A way to auto-open or auto-preview multiple photo attachments like the list I have below.  Ideally, these would open in the preview pane with three across and form rows below to be scrolled through and clicked to enlarge.  After you enlarge one, you could click next to view the next one.  (Still cool, but less utopic, would be a NEXT button to  the next pic. Thoughts?

 

Screen Shot 2020-10-06 at 9.40.05 AM.png

 

saltman
Community Participant

Sorry the image didn’t save in the draft. Just imagine speedgrader open with a list of seven photos to open individually listed on the right hand side. 

alexfischer
Community Explorer

All of these links seem to now be broken.  Is there any way to get updated links?

ian10
Community Contributor

I must admit that I have installed several of these on my machine and got the other team members to install, at least, the import rubric enchancement.

What a time saver it has been.  Thanks

@alexfischer as of today, I went to the GitHub location for them, https://github.com/jamesjonesmath/canvancement and noticed that there has been 2 new ones in the lat month..

jmerriam
Community Contributor

OK, on the subject of needing to make multiple clicks on Discussions, here's my gripe (when students are not  in discussion groups): when a student posts an answer to my weekly question on the DB, I have to go through this cumbersome process just to post my reply:

  • Click on the student's name in SpeedGrader
  • Then when the DB comes up and shows the student's response, I have to click "View in full Discussion"
  • Then I have to put that person's name in the search box to open their comment
  • Then I have to hit "Reply"

Why on earth would Canvas designers create such a Rube Goldberg route for us to have to negotiate?

CWVasques
Community Member

I would like to second the request for an updated list. Really great stuff here! But links are broken. Thank you for all you do. 🙂

Ron_Bowman
Community Champion

@kona 

do you have any plans to redo this page because of the links no longer working - I am assuming when they changed the forum that the urls for the pages changed.

For others, just do a search in the new forum with the titles that Kona has listed and you should be able to find the post.

 

kona
Community Coach
Community Coach
Author

@Ron_Bowman -- Yes, we would definitely like to get this page cleaned up! In the previous community space, it was in good working order, but in the shift to the new community space, a number of things have gotten messed up. Unfortunately, the shift happened in the middle of a crazy time in all of our lives and between me and James, we haven't had a chance to make this a priority. Thank you for bringing this back to my attention and I'll see what I can do to get it updated. 🙂

Kona

Ron_Bowman
Community Champion

@kona 

I completely understand about the craziness.  I figured because you have a grouping of all those posts in one article that it would be a good one to update.  I really appreciate all that you and James do for the community.   Unfortunately, the problem is with all the posts that had links in them to the pages on the old forum.  I figured out quickly that searching on the title was the best way to find the post on the new forum.  However, new people may not be aware of the change in the forum and think to do that.

 

dhulsey
Community Champion

@James and @kona , hey, I hope both of you are well! Is James taking requests for new projects? If so, the scheduler could use a ton of help. I made a video of what it is like now, hoping that James could do something to make it less tedious. Thanks!

James
Community Champion

Dallas ( @dhulsey ),

That is a nightmare. I don't use appointment groups and didn't know how not-efficient that was.

Between my classes and projects I'm working on for my school, I don't really have time for much  outside development. Kona is already pushing me to finish a project for her.

While I don't have time to develop a full-blown application, I think I can show you a way to duplicate an appointment group so that all you have to do is  copy/paste and then change the date. It's a trick I use with Classic Quizzes when creating a quiz question that I want repeated several times. It's a little techy, but it should save you time over having to retype it all.

I made a video showing how to use the Chrome Developer tools to repeat the request to duplicate the appointment group. You just need to go into the request and edit the dates (it's in there twice). At the end of the video, I don't show the appointments in the calendar (I was using the test instance and it was slow) but you will need to refresh the calendar to get them to show up.

 

 

dhulsey
Community Champion

The scheduler is pretty brutal, but I appreciate your quick reply and help, especially with your other obligations. I am going to watch the video and give this a try. Thank you!

dhulsey
Community Champion

@James the developer tools work pretty well for duplicating office hours, and I got fairly quick at it. Something in the code is sensitive to daylight savings, so my work around was to schedule an hour ahead to account for the change after that. Please leave that video up! I will likely have to review next semester. 😁

James
Community Champion

@dhulsey 

The fix is to manually complete one after the time changes and then repeat that process for all those after the time change. You could also go in and change the time that follows the date.

gramos
Community Participant

@James that developer trick for office hours is fantastic! Thank you so much for that (and your other Canvancements which I use a lot)!

 

thompsli
Community Champion

@dhulsey : You can add multiple slots to the same appointment group within Canvas as well (in that blank line it adds right below the previous timeslot), although if you restrict students to just one appointment that means they'll only be able to book one such slot for that group. (I set up an appointment group with all of my slots of that type for the week each week, and limit how many times students can book an appointment for that entire week, but what works for my situation may not work for yours.)

I'm excited to try out the developer tools workaround from @James , since I post roughly 20 hours of appointments a week divided into two different types of appointment groups and the structure is mostly the same week-to-week, and if I end up developing any scripts or processes to make my life easier when using it I'll let the rest of you know. 

TimJensenUSC
Community Explorer

@James , are any of your Canvancements connecting into the Canvas API? I'd love to make use of the API, but not sure how to get started.

James
Community Champion

@TimJensenUSC 

Many of my scripts connect to the Canvas API. You can visit the GitHub site and search for /api/v1 to get a list of ones that do. The newer ones use fetch(), which seems to be the new standard over the older XHR or getJSON.

The Canvas Developers Group here in the Community will have way more information than just looking at some of my code, though. They will have examples in other languages, while most of mine are JavaScript.

TimJensenUSC
Community Explorer

Thanks for that @James !

MattMe
Community Member

Thanks very much for this, James.

James
Community Champion

2022-04-03 update: I added Autofill Maximum Rubric Ratings that will let you assign maximum to all unscored criteria in a rubric with a single click.

I also went through and fixed most of the broken links related to the switch in Community software.

Ron_Bowman
Community Champion

@James -

This script will be a big help.  Thanks for the work you do on all of the Canvancements.

lgekeler
Community Participant

Has anybody implemented Google Analytics with GA4 yet? Universal Analytics only have a year left.
2022-07-05_UA_Deprecation.png

JosefinaTejedaF
Community Member

I completely understand about the craziness.  I figured because you have a grouping of all those posts in one article that it would be a good one to update.  I really appreciate all that you and James do for the community.   Unfortunately, the problem is with all the posts that had links in them to the pages on the old forum.  I figured out quickly that searching on the title was the best way to find the post on the new forum.  However, new people may not be aware of the change in the forum and think to do that.