cancel
Showing results for 
Search instead for 
Did you mean: 
kona
Community Coach
Community Coach

Macro help with the new Gradebook!

Jump to solution

Greetings amazing programmers and developers! I would like to humbly ask for some assistance with a problem stemming from the new gradebook. The full story can be found here - GET THE RED INK OUT OF MY GRADEBOOK. The Sequel, but the DL;DR is that there is no way other than student-by-student and assignment-by-assignment to turn off grade statuses (Late, Missing, Resubmitted, Dropped, Excused) in the new Gradebook. This means that without a lot of extra busy work, in courses where students can pick the assignments they submit or can submit late assignments with no penalty, the gradebook looks like a sea of red.

What I'd like: Some type of Macro or other amazing programming thing that would go through and automatically turn off the grade status for all students and for every assignment. So basically something that would imitate a global setting for grade status in the New Gradebook. Right now you can technically do this in Canvas, but it requires a lot of time mindlessly clicking.

Information I have about the issue:

  • The only way to turn off grade statuses is going to the Grade Tray and manually turning it off for each student and for each assignment. This guide explains how this works - How do I change the status of a submission in the New Gradebook? 
  • Once you access the Grade Tray, you can click through each student and each assignment. So you would never need to leave the Grade Tray to turn this off for an entire gradebook. This document explains more about how the Grade Tray works - Grade Detail Tray  
  • I have verified (from my overworked resident programming guru) that it's an API call that Canvas is making. He did not look at whether it is supported by the multiple updates version of the API call or not. 

What I can offer: Absolutely no technical assistance. I'm not a programmer and got a C in the only computer class I've ever taken. I can only barely talk the language and that's mostly stuff I've picked up on from being in the Community and around my (overly busy) tech guru.

Yet, what I can offer is...

  • I'm a great test user and would be happy to help test anything!
  • Moral support - I'm here for you and will be happy to encourage you along the way!
  • Immense gratitude by myself and laurakgibbs‌. In addition, Laura has been known to gift people points in the past and I've got a *few* points I would be happy to part with in exchange for assistance with this!
  • Lots of glory! Laura and I will sing your praises on the Community and Twitter. [If that's not your thing, then we will sing your praises quietly and in a way not to *overly* embarrass you.

Thank you in advance to anyone willing to look into this and take a stab at helping out!

Kona

1 Solution

Accepted Solutions
James
Navigator

I finally got to the point where the code works enough to release it. It's not pretty or elegant. It doesn't have add any buttons to Canvas and has to be pasted into the console of the developer tools in the browser. It doesn't bring world peace, but it may save laurakgibbs some time in her manually marking 18,000 submissions as no policy.

https://community.canvaslms.com/people/james 

I thought about adding buttons, but the logical place for in assignments and quizzes is different when it comes to discussions (since they've reworked discussions). Also, it really should have a button added for any discussion, assignment, or quiz individually since it can make the changes for just a single one instead of all of them. All that requires more time than I have right now and more work than I want to put into it -- thinking about what Canvas develops and doesn't develop, this doesn't seem like it will have a huge audience and it's a work-around not a cure.

View solution in original post

11 Replies
James
Navigator

He did not look at whether it is supported by the multiple updates version of the API call or not.

The grade or comment on a submission endpoint works, but the grade or comment on multiple submissions does not.

Setting the policy to "none" will get rid of the "missing" tag, but if a student submits it after the due date, then it resets the status and shows "late". 

I could live with just getting rid of the missing labels! Those are the ones that are really bad because the assignments are NOT missing in any way at all: they are optional.

The late label is ugly and I sure don't think students should have to see late labels when, as far as I am concerned, nothing is late if it is turned in by the "available-until" date... but at least it makes sense that there is a late label there.

The missing label just flat out does not make sense. 

If there's a way to use API magic that would flip the policy to "none" for all assignments and all students, I would be blissed out! Getting rid of the missing labels would make the Gradebook sane again (and me too!)

Only worrying about the missing label makes it quicker to write, although potentially less useful for others. It also means that it only needs ran once (or after any new assignments are added). I'm trying to balance things that have to be done for my work with helping out people in the Community. It might turn out to be a minimal but quick solution now in hopes that Canvas does something later on and it's no longer necessary.

I am SO GRATEFUL for any/all help,  @James ‌: you really are a miracle worker!!!

James
Navigator

 @kona , I know you made this request, but it was really for laurakgibbs, so I'm tagging her on this.

I've made some significant progress, but it's definitely a hack right now. By that, I mean it's functional in my testing but not pretty and doesn't do any robust error checking.

But it takes this:

301731_pastedImage_2.png

And turns it into this:

301732_pastedImage_3.png

Here's the log from the console:

301733_pastedImage_4.png

It did it in 3.534 seconds (that's with my DSL connection, it may be faster if you have a good internet connection). Now, that quick response is is in a sandbox course with just 91 assignments, only 13 of which could ever show missing assignments and only 3 students. In other words, it only had to make 44 API calls to accomplish that. The 5 is 1 to fetch the assignments and 4 to fetch the submissions and the 39 is the 3*13=39 changes it had to make.  Your course would be faster since it's not beta, but slower since there are lots of assignments like that could be missing.

If it times out or something goes wrong, you can just run it again. It fetches all of the submissions, but since none of the assignments need updated, it doesn't make any of the calls to update them. Here is what I get when I re-run it

301734_pastedImage_6.png

This time it finished in 1.241 seconds.

Like I said, it's not anything fancy right now and definitely not a user script that adds a button to the interface. Right now, it's something you where you go into the course, open up the developer tools (F12), switch to Console, paste it in, and press enter. Nothing to install right now.

In order to write the 'none' for the late_policy_status, the assignment has to be published, have a due date, and a submission type that is not 'none', 'not_graded', 'on_paper', 'wiki_page', 'external_tool'. That's what I found in the Canvas source code when I was searching for missing grades. Does that sound like what you want? I could make it process even if there was no due date, but I figured you were more planned out than I am so you would have all those set before the semester ever began.

When I opened it up to assignments that were published without due dates, it processed another 35 assignments and wrote 'none' 96 times. This time it took 14 seconds. In other words, timings may vary greatly.

The call I'm using to get the status doesn't work if the assignment isn't published and the call to get the submissions that will work if it's not published is much slower since I have to make a call for each assignment rather than being able to lump them together.

Here are the conditions ... can you verify that this is good or tell me which ones are problems?

  • assignments must be published
  • assignments must have a due date
  • assignment must NOT be none, not_graded, on_paper, wiki_page, or external_tool
  • students must be currently enrolled
  • it only changes items that do not have a late_policy_status manually set. That means that if someone had already overwritten it (like your manual clicking does), then it would keep that value.

If you publish assignments, set due dates when there were none, or have students add the course after this is ran, those won't be updated. The setting of the due dates is the only one I really have any control over.

kona
Community Coach
Community Coach

Even though this was for Laura, I’m still extremely grateful! Thank you!

Should there be (at least) three scripts (or at least a configuration option)?

  1. no_labels : resets everything, including lates
  2. no_missing: disables missing, but honors lates. Useful for people who invoke a late penalty but don't want missing to show up.
  3. no_lates: disables lates, but leaves missings. Useful for people who messed up an assignment and don't want to make it late for everyone but (for example) want to keep the original due date so when they copy it to next semester it's still in the same spot

At the beginning of the semester, the first two would be equivalent. 

Also, since beta and test are down today (Canvas is upgrading), I went into my sandbox on production and turned on a "None" for one assignment that wasn't flagged as late or missing to test something and now I can't turn off the new gradebook -- even though I went in through the API and reset it back to not have one. I mis-understood their warnings to be that if I actually set late penalties it wouldn't be reversible.

Wow, I am so excited to try this,  @James ‌!!!

This would be ideal for me:

  • all assignments ARE published
  • I removed the due dates from the extra credit because of the label problem... but I would like to put those due dates back if this works
  • all assignments are quizzes (I don't have any other types)
  • all students are enrolled BUT I will have student enrollments going on as late as Sunday, January 20

So, I can test this beforehand, but I will need to remember that it is a by-student thing, so the key timeframe for me to run it is at the end of the first week add/drop period. I am really glad you mentioned that about students being enrolled; I had not thought about that aspect of the timing.

James
Navigator

I finally got to the point where the code works enough to release it. It's not pretty or elegant. It doesn't have add any buttons to Canvas and has to be pasted into the console of the developer tools in the browser. It doesn't bring world peace, but it may save laurakgibbs some time in her manually marking 18,000 submissions as no policy.

https://community.canvaslms.com/people/james 

I thought about adding buttons, but the logical place for in assignments and quizzes is different when it comes to discussions (since they've reworked discussions). Also, it really should have a button added for any discussion, assignment, or quiz individually since it can make the changes for just a single one instead of all of them. All that requires more time than I have right now and more work than I want to put into it -- thinking about what Canvas develops and doesn't develop, this doesn't seem like it will have a huge audience and it's a work-around not a cure.

View solution in original post