Search the Community
Print Canvas Quizzes is a script that will allow a user to print a quiz from the preview page.
- Features
- Adds a "Print Quiz" button below the question navigation pane
- Auto-page break: This will keep all question content on the same page and prevents a page break in the middle of a question
- The page is set to zoom to 74% to make it sized appropriately for printing
- Hides "This is a preview..." banner
- The print dialog will automatically pop-up for the user
- Adjusts certain question types for legibility and space efficiency
- Multiple Choice: Left aligns choices, all one column
- Matching: Removes drop-down menu and creates an "answer bank" at the bottom of the question box
- Multiple Dropdowns: Expands the dropdowns to width and height of content
- Limitations
- The quiz must be viewed from the "Preview Quiz" page
- All questions must be visible on the page, which means the "Show one question at a time" must be unchecked
- Currently, the zoom level of the page is not editable by the user, except through the printer dialog window
- Not usable in the Quizzez.next LTI
If you want to print canvas quizzes, do the following –
Install tampermonkey chrome extension
https://chrome.google.com/webstore/detail/tampermonkey/dhdgffkkebhmkfjojejmpbldmpobfkfo?hl=en
Then copy/paste or open this link in Chrome
https://github.com/sukotsuchido/CanvasUserScripts/raw/master/printCanvasQuizzes.user.js
A tampermonkey install page will pop up, click “install”
To Print – make sure “show one question at a time” is Unchecked in quiz settings
Click “Preview” on the quiz page
On the right side, there is now a “Print Quiz” button
If you want to deploy to all staff, copy the script into the custom Javascript folder.
As always, I welcome feedback and improvements. This is something our teachers were absolutely demanding and this was a rudimentary attempt at giving them something usable.
Enjoy!
@G_Petruzella has created a bookmarklet that also allows for printing quizzes. It was his post that reminded me I needed to share this out!
Comments from Instructure |
With the depreciation of Classic Quizzes in 2024, The Community Team would like to encourage Community Members to explore New Quizzes! Printing is included in the New Quizzes experience: How do I print a quiz in New Quizzes?
-
@DiquiLaPenta Instead of Chad's userscript, you can replace everything below `// ==/UserScript==` with what I p...
-
@dhensley, Userscript or Canvas themes?
-
...uizzes-UserScript/bc-p/601275/highlight/true#M1387
-
...he extension. The second link on this page sent me to github, where another single click installed the needed userscript...
Hi Devs - I've just started exploring the wonderful world of UserScripts (via Tampermonkey) to pull data from Canvas in a more meaningful and practical way for our small group of academic teaching staff.
There has been a request from one academics who would like to be able to view, for a specific assignment, a summary list of all students and each of their submissions to see how many re-submissions each has done as we have a limit on how many attempts a student can make (feedback-resubmission loop).
I'm wondering if anyone has already developed something similar, or may be able to help guide me in the right direction to create this..?
I have a working API URL that gives me all the data I need, but I want to be able to present this is a more usable way for the academics. My JS skills aren't up to much, although I've been able to modify some of the great scripts out there to start working toward what I want to achive - at the moment, however, it's just pulling single points of data, rather than from the muliple data points required.
An example of what I've created so far with the 'Access Submissions Data' pop-up window where I'd ideally like this information to display. Also included is a 'Grading Summary' widget for a quick view of how many students still need to complete the assignment.
- Tags:
- userscript
Here's a userscript that adds a status dropdown and late day input box:
canvas-tweaks/speedgrader_status at master · paulbui/canvas-tweaks (github.com)
- Labels:
-
status speedgrader
Recently, I've been creating all of my quizzes directly inside of canvas. Next semester, I will need to submit those quizzes in PDF format to other faculty, who will review my work. Is there a way to convert a canvas quiz to a PDF?
Hi, is there a way to print out a quiz please, for, for example, proof reading? Not environmentally friendly but I need to check the details against a second database and a printed version would make this much easier. Thanks
I am completely stuck on this one. I am an instructor. I have a mutli-section course. I need to limit students to only see students in their sections. I am tired of doing it for each user.
Does anyone know the API command (and where to send it?) to limit student privileges to their sections? I'm working with python here. I'm assuming it has to go to enrollments/:id but I'm not sure what to send there. I appreciate any help here.
...Or if anyone knows of a userscript that's a little more accessible that I could pass around to my colleagues. My last resort will be to write an autohotkey script to push the button for me.
- Labels:
-
Canvas Data
How can I sort the markbook by notes entries, please. to See ones I need to mark
- Labels:
-
Canvas
-
Instructor
One of our faculty needs a hardcopy of a student's exam results to talk with them about plagiarism.
I can see how to print just a quiz (no student interaction) from the Teacher perspective, but how to print the results of a quiz for an individual student, please?
Using "Save to PDF" or "Print Preview" only allows for one page at a time in both Chrome and Firefox.
Are quiz result pages purposefully made difficult to print?
Thank you for your help.
Bridget Irish
Curricular Technology Support | Canvas Admin
The Evergreen State College
Not sure if this is fixable, but when using chat my sent message is greyed out unless I refresh the page.
If you know how to fix this so the message always shows as a dark font please let me know. This is a contrast issue that impacts accessibility.
Instructor side image before refresh:
Student side:
December 8, 2018 - No Longer Needed
Canvas has released their own solution for sorting the dashboard course cards. You should remove this script and use their solution. Things should continue to work until you do, but the effort is being duplicated. Any customization to the sort order will be lost when you remove this script.
I'm leaving the documentation and script out here for institutions that self-host and have not updated to the December 8, 2018, release.
Original Documentation
I've written a script that will allow users to sort their dashboard course cards by dragging and dropping the cards into the proper order.
This seems to have been a popular request that Canvas has repeatedly said will take too much effort to develop.
- (archived with 180 votes and a September 2016 note from Canvas)
- (archived with 177 votes and a January 2016 note from Canvas)
- How do I reorder the course tabs on my Dashboard?
There are probably others that I'm missing, but that's a quick list.
The script was written as a user script, meant to be used by Greasemonkey with Firefox or Tampermonkey with Chrome or Safari. However, the exact same code can also be used in the custom JavaScript file for an institution.
What it does
The script runs on the dashboard for your Canvas installation. It checks to see if the user has sorted the course cards and arranges them in the order the user has specified.
If there is more than one course card, it allow the course cards to be sorted using a drag and drop capability. When cards are dragged to their new location, the current sort order is automatically saved.
If new courses are added to the favorites through the Courses navigation item, they are placed at the front of the existing course cards. The user will need to move them if they don't want them at the front.
The user's sort order can be removed and the ordering reset to the Canvas default by removing all but one course from the favorites and then loading the dashboard.
Video
The process is so simple and straight forward that coming up with a video that demonstrates what it does was challenging. I managed to stretch it out to 15 seconds.
Installation
As an institution for all users
If you are a Canvas Admin and would like to install this script in your Custom JavaScript file for the entire account, then obtain the source code from the Canvancement site.
The file is called dashcard_sorter.user.js. Normally, the *.user.js notation is reserved for user scripts, but in this case the code will work as either a user script or a custom JavaScript, so rather than create two identical files, I just used the one. You do not need to include the user script metadata (all the lines starting with //) at the top of the file.
Add this code to your existing custom JavaScript and re-upload it to your theme. Then save and apply the theme. I added it to the global JavaScript file as well as the global Mobile JavaScript file, although I'll admit I'm not clear on what the Mobile one does.
Of all the scripts I've written, this is actually the first one that we've installed in our custom JavaScript. It has been tested with the latest versions of Firefox, Chrome, Safari (Mac), and yes, even Internet Explorer and Edge.
As an individual for yourself
If your institution won't install this for all users, you can still use it by installing it yourself. If your institution later installs the script for all users, you will want to remove the version you installed.
Note that you will need to install this script on every browser that you want the course cards sorted.
The quick installation instructions are:
- Install a browser add-on: Greasemonkey for Firefox or Tampermonkey for Chrome/Safari.
- Install the Dashboard Card Sorter script
If your Canvas site has a custom domain that does not match *.instructure.com, then you will need to modify the // @include line to specify your Canvas installation.
Canvas apps aren't supported
I have tested this in various browsers, including Safari on an iPhone. It has worked in all those browsers that I tested.
However, it did not work within the Canvas iOS app and I can only assume that it will not work in the Android app either, but I don't have access to test it.
I don't know if this can be remedied or if we're just out of luck. I'm happy to hear from someone who is more knowledgeable with the apps and can tell me how to make it work or who can confirm that it never will.
Behinds the scenes (technical -- optional)
The script uses the jQuery sortable method, which enables the drag and drop feature. jQuery is included on each page by Canvas, so no extra libraries were needed. I used the browser's console to quickly add a .sortable() to the dashboard cards as a proof-of-concept before starting the project in earnest. That part was quick and relatively painless.
The first hurdle was waiting until the course cards were ready before acting on them. The course cards are available as an empty shell that is available as soon as the page is loaded, but all of the content of the cards is loaded after the initial load using JavaScript. That makes determining which course is associated with the card impossible until the cards are filled out. I guess that I could know the order of the cards based off the array that is included in the ENV.DASHBOARD_COURSES variable when the page is loaded, but I wasn't sure what else was going on behind the scenes so I decided not to risk manipulating it until Canvas had added the content. I used a MutationObserver to wait until the cards could be associated with a course and then begin the processing.
I've done a lot of work with MutationObservers with other scripts, so this was not as difficult as it seems. You just need to watch for the right thing to happen. It turned out that the first change that was made to the dashboard cards was sufficient to start the process.
A second hurdle was saving the sort order. When I originally contemplated this project, I thought about saving it using the local storage for the browser. That would have worked for people who use the same machine and browser every time, but it would not work for people who move around between computers or change browsers.
The solution to that problem was to use the Canvas User Custom Data API. It stores the preferred sort order within Canvas so that it can follow users from machine to machine and browser to browser. If an institution doesn't install the script in their global JavaScript, the user will still need to load the user script on the machines, but then they won't have to reconfigure it each time.
This was the first time I've used the custom user data, so I had to learn how that works. Here is some advice for those considering it:
- You need a namespace to separate your applications data from possible conflicts. Canvas recommends a reverse domain name, but I don't have a domain name for my Canvancements, so I just used "canvancement" as the namespace.
- You also specify a scope, which is a way to have multiple values within your namespace. I chose "/dashboard/order". These are specified near the top of the source code and you are free to modify them to something else.
- The actual data is stored under the field "data" within the namespace and scope. So, if you're expecting a comma separated list of course IDs, you don't just get that, but you get a JSON object with a property called "data" that contains the comma separated list of course IDs. That's okay once you know that's what it's doing, but I was expecting it to work like a cookie. Once you understand it, it makes sense, but it either wasn't clear or I missed it in the documentation so I mention it here.
- While developing this as a user script, it worked fine, but when I went to the global custom JavaScript file, my data was getting returned with a while(1); followed by the JSON object. I've seen that before when typing an API call directly from the browser, so I knew what it was. The trick to get rid of it was to force the dataType to be json. That can also be done by using the jQuery.getJSON() method instead of the jQuery.get() method.
A third hurdle was the timing issue. AJAX calls are asynchronous and so I had no idea whether the call to load the custom sort order would be done before or after the MutationObserver had detected it was ready to start sorting. I ended up using a couple of scoped variables to check and when the custom sort order was done loading, it checked to see if the cards were ready. The call that happened when the cards were ready checked to see if the sort order had been loaded. By the way, the sort order may not ever be loaded and won't be the user has never sorted the cards.
-
Okay, Tampermonkey works now. I pulled UserScript from a thing that was working (hid the annoying "Coming Up" list) a...
-
James: I made the Tampermonkey change as follows: // ==UserScript== // @name Dashboard Card Sorter // @n...
-
This is what I changed on your source code: / ==UserScript== // @name D...
-
...f Canvas. The userscript version is for people who can't get it installed at the global level and want to take things i...