jamesjonesmath / canvancement Goto Github PK
View Code? Open in Web Editor NEWEnhancements to the Canvas LMS
License: ISC License
Enhancements to the Canvas LMS
License: ISC License
Good morning,
We use the Quiz Whiz: All or nothing to grade our select all that applies. It is not working, nor even showing up on our computers. Please help!
Hello,
First, thanks for creating these tools! Canvas should really hire you or at least pay a consulting fee.
Second, I found a minor issue with the Sort a Rubric tampermonkey script. You point out that we will need to modify the // @include for domains that don't fit the expected pattern, but we may also need to modify the regexp in the opening function that checks for compatible pages. For some reason, my school's canvas domain doesn't include the 'rubrics' part of the URL. I was able to get it working, though, by changing the include and regexp to cut out that part of the URL.
Hi James
Here is the results for running the program today.
# MySQL script to create database for Canvas Data schema version { DROP DATABASE IF EXISTS canvas_data; CREATE DATABASE IF NOT EXISTS canvas_data; USE canvas_data; SET NAMES utf8; DROP TABLE IF EXISTS versions; CREATE TABLE IF NOT EXISTS versions ( table_name VARCHAR(127) PRIMARY KEY NOT NULL COMMENT 'Name of Canvas Data table', version BIGINT DEFAULT NULL COMMENT 'Latest version downloaded', incremental TINYINT DEFAULT NULL COMMENT 'Incremental (1) or complete (0)?' ) ENGINE = MyISAM DEFAULT CHARSET=utf8 COMMENT = "Used by import script"; INSERT INTO versions (table_name, incremental, version) VALUES ('schema',-1,0);
There is no problem with the schema file fetched from Canvas Data, it seems there is something wrong with the "create_mysql_schema" function. But I am not sure. Hope you may take a look at that when you have time.
Thanks so much for your great work!
Best,
Mu
Hi James,
The sort-roster filtering is a great little enhancement to Canvas! I've just tried this for a course set to non-US English (UK or Australian) and these languages format dates differently - this breaks the shortDateTime regex.
A simple fix for Australian English is to remove all of the logic around am/pm (as times are displayed in 24 hour time).
var tm = '';
var matches = shortDateTimeRegex.exec(s);
if (matches) {
var month = months.indexOf(matches[1]) / 4;
var day = parseInt(matches[2]);
var year = parseInt(matches[3]) || thisYear;
var hour = parseInt(matches[4]);
var min = parseInt(matches[5]);
tm = new Date(year, month, day, hour, min, 0).toISOString();
}
It looks like UK English formats their dates differently (dd MMM). I'm not sure whether this could be differentiated based on the lang html tag ($('html').attr('lang');
) or whether it is just worth adding as a known issue?
Thanks,
Greg
It would be very nice if the button next to the "Update Scores" & "submit" link in quizzes to advance to the next user could be larger. It will save time to get the mouse cursor within the button area. It would be even nicer if a keybinding could be added for "Update Scores and advance to the next user". Thanks!
Sorry if this isn't the best way to communicate, but is it possible to create a word count tool for speedgrader? This feature has been requested for some time (https://community.canvaslms.com/ideas/3454-word-count-for-speedgrader-docviewer-grading) but they don't show any signs of implementing it.
https://github.com/eligrey/FileSaver.js has updated their file structure, so your userscript does not work any more. Any chance of an update?
James, Rubrics stopped working some time in the last week (not used since last Sunday). Short answer is still working fine but rubrics, specifically the ability to enter grade at the end of a long essay, no longer appears. Tried in Firefox (my main browser) and Chrome (just to double check) both are no-go. Thanks.
My script no longer works and the original post from Canvas, etc is not available anymore.
I'm trying to get the awesome functionality you created for the roster under people, but to use it in the grades tab.. Is this possible?
Hi James -
I want to thank you again (probably done in the forum somewhere) for canvancements. I find them very useful. I need to figure out how to write these or browser extensions to attempt a few ideas on my own.
In any case, one of your old canvancements 95 years since last update: show_question_names
in the quizzes canvancement is not working properly for me. I figured you were suppose to see something like
Question 1: Find the current
where your script would pull the name I assigned to the first question which in this example would be "Find the current"
Instead what I see is Question 1: Question 1
If I am correct in that the script no longer works the way it was intended, it is because in 5 years Canvas has changed some internal naming that the script is no longer accessing correctly.
Just in case it matters, this is with Classic Quizzes and not New Quizzes.
Ron
The partial credit script gives extra points if the student didn't check the correct number of answers. For example, on a 1 point question, if the student was supposed to choose two answers, and they only chose one - the correct one - Canvas scores them with a 0.5 (the only time Canvas will provide partial credit because they didn't choose any incorrect answers.)
The script adds an extra 0.25 points to the student's score.
Is this something that is able to be fixed?
Thanks!
First off, this script is excellent. It has saved me much time when I have needed to create complex rubrics. Thank you!
However, as with most technology I use, it is great until it doesn't work... ๐
Recently, I have experienced this script just go dead for a bit. It only happens occassionaly and I am not sure what it could be due to because there is no error kicked out. Recently, I tried importing this rubric. After trying to use the script a few times, I removed tampermonkey, let it sit for a day, and reinstalled it. After this, things worked just fine.
I am wondering if there are any best practices I am missing or if there is an issue with the script. Please let me know.
Sincerely,
Nick
HW7-Rubric.xlsx
Thank you SO much for this script. It's made my life MUCH easier for a couple of years now. But, today when I went to pull my reports, I noticed that the TamperMonkey icon didn't show the little red 1 that indicates the script is running. I checked and the script had disappeared from Safari. So, I reinstalled it, closed the browser and reopened. Now it shows the script is there, but it doesn't appear to be running. No red 1 on the TamperMonkey icon and no "Access...." on my Canvas menu. So, tried it in Firefox, which often works when Safari doesn't. Same sequence: no installed scripts, reinstalled, now shows up as installed, green button on but no red 1 on the icon and nothing in Canvas. I've reached the upper limit of my trouble shooting ability here and would very much appreciate some help. Thanks!
More of a question than an issue.
I'm working with teachers on assigning partial credit for multiple answer style questions. I think the closest I can get is setting ma_correct
to enabled
, but if they have set a multiple answer question to multiple points, it enters the percentage (as designed). Here's an example:
Multiple answer question with three items worth two points (two correct answers).
The teachers would like this scored as 1 out of 2 instead of 0.67. I thought the ma_difference
method would work instead, but it subtracts for incorrect answers, scoring as 0. Is there a way to work around this without a full rewrite?
Hey, I am very excited about this script. I don't know a ton about js but I usually feel competent enough to copy-paste JS from the internet and tweak it make it work for my needs.
I got the script running on the page using Tamperish (instead of Tamper Monkey) and the new button Import Rubric appears on the Rubrics page, but when I click it nothing happens. Here's some info from console (not totally sure which is relevant except the last bit).
[Log] [Tamperish] Injecting canvas-rubric-importer.js (script.js, line 84, x3)
[Log] Registration succeeded. Refresh page to proxy Inst-FS requests through ServiceWorker. (main-entry-c4bc4f466cfd3697.js, line 2439)
[Error] FetchEvent.respondWith received an error: TypeError: Load failed
[Error] Fetch API cannot load https://gmu.instructure.com/images/thumbnails/5114/N4JCaA7hXge0wpAdxmiGwVavp9qVC1NSI0YHGcvj.
[Error] Failed to load resource: FetchEvent.respondWith received an error: TypeError: Load failed (N4JCaA7hXge0wpAdxmiGwVavp9qVC1NSI0YHGcvj, line 0)
[Log] ReferenceError: Can't find variable: $
openDialog
I think I've seen that reference error before when using jQuery and not importing it correctly, so I added // @require http://code.jquery.com/jquery-latest.js
to the header but still got the same error.
Thanks for making this, it's really useful!
I have started using this script only very recently with a combination of up-to-date Firefox & Tampermonkey.
I am able to download the Access Data Report as csv file, however, in the data there are students missing. For example, I have 81 students in a course, but only 57 end up in the report. The students that are missing are active in the course and I can't find something obvious that leaves them out (for example, they are all in the same section in the course).
Am I doing something wrong or is there something I can do to check whether the script comes up with errors or something?
UPDATE: Every time I export the data, the number of students that is included is different (e.g. 51, compared to 57 previously).
Thanks for your time :D
Oscar
For the past week or so, I've had an issue with QuizWiz when grading quizzes in speedgrader: upon loading, it works fine for the first student, but after I click 'Update Scores' and advance to the next student's quiz, the button no longer works. Whether I advance using the blue arrow to 'Update and advance to the next user' or use the built-in speedgrader advance button, the Update scores button ceases to have any effect. I have to shift-reload the page to get it working again.
I may try installing the tampermonkey addon in Chrome or Edge and getting that set up to try and see if this is a Firefox-specific issue or what, but I thought I would check in to see if this is a known issue caused by some update to Tampermonkey or canvas, etc.
My canvas was set up for me where all of my classes (per subject) are in a single canvas course, and students are split into sections. One of my subjects is on both A days and B days at my school, so one section needs to have one due date while the other four sections need a different due date. I was hoping to use this as it would make it super simple so I don't have to edit the same 40 assignments to set every due date correctly (I would rather not have to manually edit the due dates of 120 assignments)
Is there any way to do assignments with multiple due dates in canvancement?
Right now in the spreadsheet it sets the earliest of the five availability dates as the "Available until" time and the latest of the five due dates as the "Due" time
Hi,
First, thank you so much for developing and sharing these user scripts. These are extremely helpful!
I'd like to ask if you could help out with changing the width of the DB text book in the grading mode. As shown below, in the Elements tab of my Safari browser, I've IDed the code, as highlighted.
This is a Zoom in look of the code sectoin:
My goal is to change the width, say, from '600px' to '800px'. This is my code:
var div = document.querySelector("#content > div");
div.style.width = "800px";
The problem I'm encountering:
I can successfully make the change when I paste this code to the console of the browser. However, when I make it into a userscript, it won't work. And I found out that when I go to the "Sources" tab of Safari, the HTML code is different from the code in the "Elements" tab above. I've also located the parent div
whose id = "content
". However, what follows is different! It is no longer the div
whose "style โ width" = "600px".
See the screenshot below:
I'm very puzzled and cannot understand why the code in the "Elements" tab, which accurately reflects the content of the webpage, is different from the "Sources" page. And the userscript seems to be working on the "Sources" page when I enter the speedgrader mode. (I believe this probably explains why the userscript does not work.)
I tried to search for '600px' in the code of the "Sources" tab, I couldn't find it.
It would be extremely helpful if you could make a userscript or point me to a direction for a fix.
Thank you very much!
Hi James,
Thanks again for developing and sharing the scripts. I'm using some of them regularly now.
I'm wondering if more customizations could be added to the "QuizWiz : Math Whiz" user script?
He are the settings offered:
var config = {
// Regrading methods may be 'disabled', 'enabled', or 'autorun'
'methods' : {
'unanswered' : 'autorun',
'full_points' : 'autorun',
'ma_allnone' : 'disabled',
'ma_correct' : 'disabled',
'ma_difference' : 'disabled',
'fill_in_blanks' : 'disabled',
'dropdowns' : 'disabled'
},
// Speed enhancements may be true or false
'autoExpandComments' : true,
'duplicateQuestionHeader' : true,
'showButtonCounts' : true,
'nextAfterUpdate' : false,
'nextAfterComment' : false,
'nextAfterRubric' : false,
'nextRubricExpanded' : false
};
It is very nice that it could handle multiple functions at one place. As I'm using it, I'm having two issues:
I'd like to increase the height. I know that I can install the user script at https://github.com/jamesjonesmath/canvancement/tree/master/quizzes/comments and do customizations with this stand alone script. But since it is already integrated in "QuizWiz : Math Whiz", I thought I'd just mention it here.
Let me explain why I need to remove this button:
I have another program to automate clicking "Update Scores".
In most of the quizzes, the last question is the proctor information question. It has a "0" point value, but I need to skim the question to see if the students has provided this information. I usually have enough time to skim the content while the page is being "updated". However, when the duplicated "Update Scores" button is present, this button, rather than the button at the bottom of the page, is clicked. As a result, the page immediately returns to the top and I don't have enough time to skim the content of the proctor info question.
Currently, I solved this problem by simulating an "end" keystroke to scroll back to the bottom of the web page. It is ok, but not ideal.
Is it possible to remove the "Update Scores" button?
Thanks!
I've been using this script for a while, without issue (I think). I noticed today that all top-level posts are left off. All replies are counted, but anybody who started a discussion is not being listed (and if there are no replies, the entire discussion won't show up). Is there anything I could be doing wrong that would cause this?
Hi,
It's not reordering. I've double checked everything. It could be something else is interfering perhaps?
Can you add a browser button to search the tsv file?
James, wow! I just discovered your site through the sort-rubric extension and I'm thrilled! Thanks for bringing these features to the Canvas community.
A quick note of feedback from me: at my institution, the Canvas URL is https://canvas.msstate.edu
instead of the expected pattern of https://*.instructure.com/courses/*/rubrics/*
. Changing this to /^https:\/\/(canvas\..*\.edu|.*\.instructure\.com)\/courses\/[0-9]+\/rubrics\/[0-9]+/
here made the script work (via Tampermonkey) for me. (FYI, I use https://regex101.com/ to create a regex...that helps me check and refine my regex very easily.)
Can you tag an official release, so that it's easier to see versioning and use this project as a dependency?
I would like to request that the update-and-advance and the submit-and-advance buttons be larger (maybe closer to the size of the Canvas update button and submit button). They are currently a pretty small target to hit with a mouse and especially so with a trackpad.
Do you have a version of the script that will allow setting dues dates for individual students? There is a huge gap in Canvas for custom, self-paced learning.
Thanks
Great job, BTW. It is a much needed utility.
Do you know if any recent changes in Canvas or Tampermonkey might have broken quizwiz? I usually use the math version to automatically give full credit to all the answers on quizzes, but this semester I'm having trouble with it. Some quizzes still work as before, but most of them, I click the update scores button and nothing happens.
Update: If I keep reloading the quiz page, clicking the update button each time, it seems like it eventually goes through.
Your sort-rubric.user.js is no longer working in Tampermonkey. The JS still loads in Tampermonkey when I go to the rubric page, I just can't drag anything.
Tampermonkey shows two errors in the JS:
Line 10 - 'waitForKeyElements' is not defined
Line 12 - '$' is not defined
I saw the $ problem in the other issue that is posted about QuizWhiz, but there wasn't enough info there for me to figure out how to fix it.
I recently updated my operating system to Mac OS Sonoma. Since then, I have to install and reinstall Tampermonkey to get the scripts to work. This is happening with all the Canvancements that I installed onto my browser. The scripts are not loading and the widget on Safari does not indicate that a script is running.
Source discussion: https://community.canvaslms.com/t5/Idea-Conversations/Override-Late-Policy-in-Speedgrader/idi-p/376224
This is another 'quirk' in Canvas' workflow that seems to have an obvious fix, but I'm assuming it may not be possible to easily access the status flags in the gradebook from speedgrader, at least as it's currently implemented. I'm wondering if you've already looked into this in the past?
It seems like every time I get frustrated about the workflow in Canvas, I wonder whether James Jones has created a canvancement to solve it. Once again, you've saved my bacon. Thank you sincerely for creating and sharing these with fellow teachers.
Tampermonkey keeps crashing
This is not a issue. But more of a enhancement to this script.
I do not know if this is possible, but is it possible to download the report between two dates? Also, can it include what the instructor did as well?
I am looking for some detailed report on all user activity in a course. I am used to using Blackboard user report for everyone in specific date and this script shows most of what I need except for picking the two dates and instructor's report.
Thank you,
Ra
I've installed the script. Our all courses url is:
https://*.instructure.com/courses
Your other scripts do work for us. I tried running it at home just in case we had something blocked on campus. Your script simply does nothing. Did a recent Canvas update break it?
I'm using the Rubrics script with Firefox and Tampermonkey since 10/2017 without any issue. Stopped working in the last week. Noticed a red "notification" symbol on Tampermonkey but never actually found the notification. Removed the script and reinstalled but no luck. I do see all the features (points box below the answer for example as you would expect with the script) but the box is non-functional. If I put anything in the lower box and advance to next student the grade is not entered. I've checked for an update but it says it is up-to-date. My domain is: https://olympic.instructure.com. Thanks for any help you can offer. I am lost without the script.
I was unable to get the switch to discussion part to work although the rest of the script works fine for me.
The issue was
const groupLinks = document.querySelectorAll('div#left-side > ul > li a');
resulting in 0 being returned for groupLinks.length
Changing the above line to:
const groupLinks = document.querySelectorAll('div#sticky-container > ul > li a');
solved the problem.
Thanks for a very useful script!
Starting on 6-8-2019 The rubric version of Quiz Wiz stopped loading for me in Chrome version 75.0.3770.80 (Official Build) (64-bit) on Windows 10. I tried updating Quizwiz (there wasn't one), restarting my browser, and restarting my computer. It is still not loading in Speedgrader. Tampermonkey is enabled and reports that Quizwiz is on. I do not know what else to try. ๐คทโโ๏ธ Any suggestions, James?
I am having trouble getting this script to run. It ran beautifully on a different course last November.
Maybe the course is too big? The current course has 2,400 students enrolled while the November course only had 250. The script isn't showing on the dropdown menu under People,
Hi James,
I have QuizWiz: Standalone
. When I use it on the grading page, it shows:
This webpage was reloaded because it was using significant memory.
Any way to find out what is causing it?
I had edited the autoExpandeComment section:
function autoExpandComments() {
if (typeof config.autoExpandComments !== 'undefined' && !config.autoExpandComments) {
return;
}
var nodes = D.querySelectorAll('div#questions > div.question_holder > div.display_question > div.quiz_comment');
for (var i = 0; i < nodes.length; i++) {
var t = nodes[i].querySelector('textarea');
if (t) {
if (t.value.length > 0) {
resizeComment(t);
}
t.addEventListener('input', watchComment, false);
t.addEventListener('paste', pasteComment, false);
}
}
}
function pasteComment(e) {
if (e.target.value.length === 0) {
var divElement = e.target.parentNode;
divElement.style.display = 'block';
e.target.style.width = '98%';
e.style.height = '40px';
}
}
function watchComment(e) {
if (e.target.value.length >= 1) {
resizeComment(e.target);
} else {
e.target.style.height = '40px';
}
}
function resizeComment(e) {
var divElement = e.parentNode;
if (e.value.length > 0) {
divElement.style.display = 'block';
e.style.width = '98%';
// e.style.height = '40px';
e.style.height = (e.scrollHeight)+"px";
} else {
divElement.style.display = 'inline-block';
e.style.width = 'auto';
e.style.height = '40px';
}
}
And this is my setting:
var config = {
// Regrading methods may be 'disabled', 'enabled', or 'autorun'
'methods' : {
'unanswered' : 'autorun',
'full_points' : 'autorun',
'ma_allnone' : 'disabled',
'ma_correct' : 'disabled',
'ma_difference' : 'disabled',
'fill_in_blanks' : 'disabled',
'dropdowns' : 'disabled'
},
// Speed enhancements may be true or false
'autoExpandComments' : true,
'duplicateQuestionHeader' : true,
'showButtonCounts' : true,
'nextAfterUpdate' : true,
'nextAfterComment' : true,
'nextAfterRubric' : true,
'nextRubricExpanded' : true
};
var QuizWiz = function(config) {
'use strict';
if (typeof config === 'undefined') {
// Each regrading method has three possible options:
// disabled -- do not use this method
// enabled -- use this method
// autorun -- use this method and automatically run it
config = {
'methods' : {
'unanswered' : 'autorun',
'full_points' : 'disabled',
'ma_allnone' : 'disabled',
'ma_correct' : 'disabled',
'ma_difference' : 'disabled',
'fill_in_blanks' : 'disabled',
'dropdowns' : 'disabled'
},
// Speed enhancements may be true or false
'autoExpandComments' : true,
'duplicateQuestionHeader' : true,
'showButtonCounts' : true,
'nextAfterUpdate' : false,
'nextAfterComment' : false,
'nextAfterRubric' : false,
'nextRubricExpanded' : false
};
}
Thanks!
The HMAC generator in api.php has this:
$parms = explode( '&', $u['query'] );
ksort( $parms );
$query = join( '&', $parms );
However, ksort
is the wrong sort function to use here, because the explode
function returns an array with numeric keys. Sorting by keys will just "sort" the array to be in the order it's already in.
The code should be this:
$parms = explode('&', $u['query']);
sort($parms);
$query = implode('&', $parms);
sort
is used instead of ksort
, which fixes it.
(implode
should also be used instead of join
everywhere). Anyone using PHP's coding standards will see a warning for using join
, because it's a function alias.)
Hi James,
This is an awesome project.
Canvas allows multiple assignment dates. When you load dues dates it seems like you only get one for each assignment. Could you add an option to bring every unique due date for each assignment with some identifier?
The identifier could just be the canvas key for each unique due date (there must be one). If you could add the students associated with each unique due date that would be even more awesome. That would allow us to assign specific students different due dates.
We have a three year set of project based learning courses in engineering that really all follow a single sequence of assignments. The assignments are typically a series short learning tasks followed buy a project That pattern repeats twice each year or that is our hope. Student work at different paces and by the third year there is a lot of variation on where students are in the sequence. It would be great to batch upload who is assigned what and when.
Thanks for considering.
Dave
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.