Adjust All Assignment Dates on One Page

James
Community Champion
271
137394

Update March 15, 2020.

 

Version 2d is now available. The only changes were to remove the mute column (Canvas deprecated that functionality in January 2020) and add a points column to change the points on an assignment (you cannot change point values for classic quizzes).

There has been a lot of discussion about the need to . I created a Google Spreadsheet to attempt to address this feature request, but the announcement and instructions got lost among the almost 100 comments. This document is an attempt to pull the relevant information into one location so it's easier to find.

 

This document and script were written at a time when Canvas did not have a solution. In the April 2020, they released their own solution. It may be enough for most people and I recommend that you check it out to see if it will meet your needs. How do I bulk update due dates and availability dates as an instructor? 

 

Purpose

Below is the list of things this Spreadsheet will accomplish:

  • Change due dates/times
  • Change available from and until dates/times
  • Change quiz show and hide answer dates/times
  • Change the point values for discussions and assignments. The point values cannot be changed for classic quizzes.
  • Publish/Unpublish assignments

Instructions

  1. Open up the Google Spreadsheet: Course Due Dates
  2. This will open the spreadsheet in view-only mode, you need to make your own copy. Go to File > Make a Copy. Once you have made a copy, close the original and work with your copy instead. If the Make a Copy is disabled, then you need to log into your Google account before you can enable it.
  3. Check your locale and timezone settings under File > Spreadsheet Settings. There is a second place to set the time zone as well. Click on Tools and choose Script Editor. Once that window opens up, click on File and Choose Project Properties and set the timezone. Once you update it there, you can close the Script Editor window.

    Update: April 14, 2019. It turns out that there are two places where the time zone needs set. This only affects you if the difference between your timezone and Central Time (America/Chicago) is equal to the difference between when you set the due date and midnight. For example, if you are in Mountain Time (1 hour behind Central Time) and you set your assignment to be due at 11:00 pm (1 hour behind midnight). I will work on getting a fix for an upcoming version, but I want to do extensive testing first.

  4. There will be new Menu item called "Canvas" that will appear after 20 seconds or more. It contains the menu. The first thing to do is choose "Configure API Settings". Then put in the hostname of your Canvas instance and an API access token. See How do I manage API access tokens as an admin? for information about how to get your access token. See the "Specify Course"

    Note that the first time you use the script, Google will ask you for Authorization.

    1. At the "Authorization Required" prompt, click Continue.
    2. At the "Choose an account" prompt, select your Google account.
    3. You will be presented with a "This app isn't verified" prompt. I am not a Google developer and haven't gone through the necessary hurdles to configure this. Click Advanced to move forward.
    4. Click the Go to Course Due Dates (unsafe) link.
    5. After the list of what access the program needs, scroll down and click Allow.

    If the Canvas menu item does not appear, wait a few minutes and try a forced refresh (Shift+Reload) in the browser. Testing suggests intermittent timeout issues with Google services that fix themselves. I also updated the script on August 10, 2018, to help fix some of those issues, so making a new copy may help as well.

  5. After you configure that, go to the Canvas menu and choose "Specify Course".
  6. Then choose Load Due Dates from the Canvas menu.
  7. Watch the magic occur on a new sheet called "Dates"
  8. Change the dates and times to their desired values. See below for additional information.
  9. After you're happy, choose "Save Due Dates" from the Canvas API menu.
  10. Go into Canvas and hopefully things will be changed.

Notes

  • At some point, it will ask you to authorize Google Spreadsheets app to run. Be sure to grant access when it does or you won't get anything. I am not a professional developer so Google will make you jump through extra hoops to get it authorized.
  • It gets your timezone from Google, but can be adjusted to handle other time zones. If you need a different timezone or your times are coming out wrong when you save them back to Canvas, then see step 3 in the instructions.
  • The Show Answers and Hide Answers columns are only valid for quizzes and you must have the "Show Correct Answers at" item checked in Canvas.
  • If things don't happen like you think they should, it's probable than an error of some kind occurred. Go to Tools > Script Editor and press Ctrl-Enter after it loads to look for any error messages or warnings.

 

For additional help see the Videos and feature information below.

 

Videos

The following videos provide additional information and tips/tricks on how to get the most from this spreadsheet.

Setup and Configuration

This video shows how to make a copy of the master Google spreadsheet, configure the API settings, and get your list of course due dates.

 

Introduction and Basic Editing

This video provides a general introduction to how to use the spreadsheet and do basic editing.

 

User Interface

This video shows some of the nuances of using the user interface.

Changing the Dates

This video shows how to change the dates based on other dates. It uses the due date as the available until date and opens up the answers the next day after the assignment is due. It then hides the answers 2 weeks after the answers become visible.

Shifting Dates (Spring Break)

This video shows how to shift dates based on the existing date. It shows adding 1 week to everything after spring break. The idea is to create a temporary column that holds the new date and then copy the temporary value back over the original one (be sure to Paste Special as Values).

 

Changing the Times

This video shows how to change the times on the dates.

 

The Canvas menu

There is a Canvas menu that is added to your Google Docs spreadsheet. It contains all of the menu items related to this spreadsheet.

Google Docs Canvas Menu

The Canvas menu takes some time to appear, about 20 seconds in my testing. If the Canvas menu item does not appear after more than a minute, it probably won't. There may be a intermittent issue with Google's spreadsheet services. Wait a couple of minutes and try a forced refresh (Shift + Reload) and see if the problem resolves itself. In some cases, you may need to come back later. If you are still running version 2 (v2), I did some tweaks on August 10, 2018, and that version seems a little more stable. You might download a new version (v2a) of the spreadsheet and try it.

Specify Course

Specify courses is used whenever you want to specify or change courses.

Specify Course ID

It will take either the Canvas course ID or a URL from a page within your course.

Locate Course ID

Locate Course URL

After you put in the Course ID, it will display a confirmation screen.

Confirmation Message

Click Yes if this is the right course or No if it is not. There may be error messages that occur as well. Be sure to read them to figure out what is going wrong.

Once you have specified your course, it will automatically run the Load Due Dates feature for you.

Load Due Dates

This command is ran when you specify a course for the first time. There may be times when you want to reload the information to either confirm that the changes have been made or to start over. This command will wipe out any existing information on the sheet.

The Load Due Dates also fetches the start and end dates for the course. You cannot change those within the spreadsheet, but if you change them through Canvas and reload the due dates, they will be reflected in the sheet as a validation rule.

Save Due Dates

This command will save any changes to Canvas. It compares what is in the Google Sheet with what is in Canvas and saves any changes. If you delete columns from the spreadsheet, they are ignored in the comparison and subsequent update.

Hide Times

This command will go through and hide the times for any date/time combinations that correspond to the start or end of the day. For the Due or Available Until columns, any times ending in 11:59 pm (23:59) will show just the date and not the time. For the Available From, Show Answers, and Hide Answers columns, any times ending in 12:00 am (00:00) midnight, it will show just the date and not the time.

If there are times in the middle of the day, then it will not hide them, but continue to show them.

Show Times

This is the counterpart to the Hide Times command. This will show the times for every date/time combination, including those that are at the start or end of the day.

This formats the date in "yyyy-MM-dd hh:mm" format, such as "2016-08-15 21:34". I thought about formatting it in the locale of the user, but getting the default format for the locale out of Google Sheets wasn't easy and so I decided on an unambiguous format.

Due at End of Minute

In September 2018, Canvas decided to fix a bug that broke documented behavior. The due_at time now adds 59 seconds, essentially giving the students to the end of the minute rather than the beginning of the minute to turn in material. This menu option sets the seconds for all due at and available until times to be 59 seconds. Note that Canvas does not default the available until time to 59 seconds, so you can have an available until date that is up to 59 seconds before the due at date.

Configure API Settings

This command should be ran first to authorize Google Sheets to talk to Canvas. If you try to specify the course before you configure the API settings, it will run this command to configure the API settings first and then you will need to re-run the specify course command.

Forget API Settings

Most people will never have a need to use this, but if you want to remove your access token from Google Sheets, then you can use this option to forget your configuration.

Show Help

This loads a help page that has an abbreviated version of the information contained in this document.

 

Configuring the API

If you have not previously authorized this Google Spreadsheet to execute, then it will ask you to grant the spreadsheet access to do what it is intended to do. Agree or you won't be able to use the spreadsheet.

After that, you will be presented with a Canvas API configuration screen.

 

API Configuration

Canvas Hostname

This is the name of your Canvas instance and can be specified in up to three ways.

  1. If your Canvas instance is hosted by Instructure and does not use a custom domain, then your hostname will be something like schoolname.instructure.com. If this is the case, then you can enter schoolname into the Canvas Hostname field and it will fill in the .instructure.com for you. If you are using a custom domain name, you cannot use the short form and must look at another option.
  2. If your Canvas instance uses a custom URL like canvas.myschool.edu, then you need to enter canvas.myschool.edu into the Canvas Hostname field. You can supply the full hostname even if you're not using a custom URL, but it is required if you are.
  3. You may also paste a URL for your Canvas instance into the box. This URL is given in the Location window of your browser. Note that the example below is from the dashboard, but it will recognize URLs from within a course as well. In fact, you could use the same URL here that you're going to use as your course URL when you specify the course.

Locate Canvas Hostname

Access Token

The access token is a string of characters that identifies you to Canvas. It is basically a username and password rolled up into one item and allows anyone who possesses it to do anything that you could do through the Canvas API. That's pretty extensive, so basically never share it with anyone.

However, Google Sheets needs the access token to talk to Canvas and so we need to share it with Google Sheets. It is stored for future use, so that you only have to enter it once (unless it expires). The good news is that it is stored in the User Properties portion of Google Sheets, which means that each user of the spreadsheet has their own storage area and one user can't get access to another user's access token.If you share your spreadsheet with someone, the access token is not shared with it, they will still need their own access token.

For more information about access tokens, including how to obtain them and revoke them, see the Canvas documentation How do I manage API access tokens as an admin? 

Confirming the Canvas Hostname

Once you have entered your Canvas Hostname and Access Token, you'll be given a screen that confirms that it correctly interpreted the information.

First is confirms the host name.

Confirm Hostname

and then the user.

Success Message

Just click OK to confirm these.

If you don't get those, something went wrong and you should read the error messages to determine what it was. After correcting that, then try the process again.

 

The Spreadsheet

When you execute the Load Due Dates command, you'll get a spreadsheet that looks like this. My examples only contain quizzes because that's all I had in the class when I did these tutorials, but there will be assignments mixed in with the quizzes. Note that discussions are included as part of assignments.

Initial View

Load Due Dates Spreadsheet

After Hide Times

If most of your times are at the beginning or end of the day, then you may benefit by running the Hide Times command. Notice that most of the Available From times are still showing. This is because they are at 17:30 (5:30 pm) and I didn't want people to think they were the beginning of the day because the time wasn't showing.

Spreadsheet Hide Times Command

Custom Date-Time Formats

You may also choose your own date formats using functions built into Canvas. For example, if you prefer the day of the week and a short date, then you can highlight the cells and then go to Format > Number > More Formats > Custom Number Format.

 

For example, setting the custom number format to ddd, mmm d will give you the day of the week, the month, and the day of the month.

Custom number formats

Custom Date Formats Spreadsheets

Notice that this hides the times, but it does have the benefit of giving you the day of the week and stripping off the redundant year.

 

The codes are based off of the principle that each letter represents a piece of information and the more times you use the letter, the longer the information. For example, m represents the month. A single m gives you the month between 1-12 while mm gives you the month, padded with a 0 in front of single digit months: 01-12. Using mmm gives you the three letter month abbreviation, like Aug. Using mmmm (4 m's) gives you the full name of the month such as August. Providing mmmmm (5 m's) seems counterintuitive, but it provides the first letter of the month.

 

d is for day, m is for month or minute depending on context, y is for year, h is for hour, s is for second.

 

If this sounds terribly confusing, it is. Luckily, Google Sheets has a date-time format builder that you can use.

 

Go to Format > Number > More Formats > More date and time formats. Then click on the pull-down arrow next to the Apply button.

Format Numbers in Spreadsheet

Pick the item you would like from the menu and then repeat this for each piece of information you want to show.

 

Each of the items has a pull down menu that allows you to select the specific format or delete that item.

 

For example, if you want the AM/PM to show up as a single lowercase letter, you would first add AM/PM to the custom format, then click on the AM/PM button and choose Shortened lowercase (p).

Custom Date and Time Format

 

Here's what it would look like to have a 2-digit hour, 2-digit minute, and a single digit AM/PM identifier.

Custom Date and Time Example

Invalid Data

Some cells may have a small red triangle in the upper right-hand corner.

Invalid Data

This is an indicator that something is wrong. In this case, the dates 2016-12-21 and 2016-12-23 are after the class has ended. The spreadsheet gets that information about the course start and end dates from Canvas and you can't change it in the spreadsheet and have it take affect in Canvas. You'll need to go into Canvas Course Settings and change them, or have your Canvas Admin change them if they are locked down, and then reload the due dates.

 

All dates have that validation rule attached to them, but only the invalid dates show up with the red triangle. If you mouse over the current cell, then it will show you the validation rule.

Data Validation

Also note that these invalid content warnings are advisory in nature. Canvas will allow you to set the dates outside of the course start and end dates through the API. If you are inside the web interface, then the Due, Available From, and Available Until dates are required to be within the course dates.

 

The Published column has validation rules as well. It requires Boolean values, but typing in True and False is tedious for the user, so instead it uses 1 for Yes and 0 for No.

 

Information about Setting Dates

Dates are stored as floating point numbers, where the integer portion is the day and the decimal part is the time.

  • A minute is 1/60th of 1/24th of the day, so a minute is represented by 1/24/60 or 1/1440.
  • Midnight can be found by using the =FLOOR() function, which drops the time (decimal) part, just leaving the date (integer) portion.
  • Days are integers, so to add a day and keep the same time, just add 1. To add a week, add 7.

 

That allows you to do things like this (the 10 in all of the examples is row 10, change it to match whichever assignment you want to change). My notation is this: E10=B10+1 means go to cell E10 and then type the formula B10+1

 

To have the show correct answers start at the beginning of the next day, I can put the formula E10=FLOOR(B10+1).

 

If you want the correct answers to be hidden 1 week after the due date (keeping the same due time), then put F10=B10+7.

 

Let's say you want the due date to be 1 minute before you show the correct answers (I would use this to put a whole number in for show answers for the start of the day and then back up one minute for the end of the previous day), use B10=E10-1/24/60 or B10=E10-1/1440

 

Let's say you want the due date to be at 5:00 pm on the third day after it becomes available at 7:00 am (Example: Opens Monday at 7:00 am, Due Wednesday at 5:00 pm). Use B10=C10+2+10/24 (that's 2 days and 10 hours later)

 

One note about show correct answers. If you don't set Show Correct Answers inside Canvas, it doesn't matter what you put in the spreadsheet. I think I could modify the code to automatically set the show correct answers if someone puts a value in there, but I was trying to get something functional out there quickly so I just went with the basics. The documentation was said show_correct_answers is only valid if hide_results=null and show_correct_answers_at is only valid if show_correct_answers=true. Then you've got show answers after last attempt, etc., and it was just spiraling in complexity.

 

CanvasLive Presentation

 @kona  gave a CanvasLive presentation on this tool on January 13, 2017.

 

Troubleshooting?

Canvas menu won't appear

Force a browser refresh

There were several people commenting that the Canvas menu would not come up. I made some tweaks (see "Update versions" below) and did some extensive testing and found that it seemed to be intermittent issues with Google not executing. I would make two copies of the file within a minute of each other and one would work and the other one wouldn't. If I waited a bit and forced a browser reload (hold down the shift key while pressing the reload icon), then it would work. I recommend waiting a few minutes and then trying the forced browser reload.

 

The first thing to try is all the normal stuff we tell people when there are browser issues. Clear the cache, reload the page, etc. I would not suggest switching to Firefox, though. Chrome really works better with Google Sheets.

 

Updated versions

On August 10, 2018, I updated the code to version 2a. There is no new functionality with this release and if your current spreadsheet is working you do not need to do anything. 

 

As part of the testing to see why there were loading issues, I put the code through a lint checker to look for problems. I found some where I had not declared a variable (making it global) or using a variable out of scope and fixed them, but since it was working before that doesn't seem to be the problem. I also found some people suggesting that having global variables was causing the (), which is what loads the menu, to not execute. I reorganized that part as well so that there are no global variables.

 

There is now a version v2a out there. That doesn't have any new functionality over version v2 and if your version v2 is working, you shouldn't need to do anything. However, if you're still struggling to get the menu to appear, try making a new copy using the same URL as before and then testing it. I was able to get the menu to appear every time with the new version while there were still some cases with the old v2 version that the menu would not appear no matter how many times I tried it.

 

Version v2b, released on October 12, 2018, now supports second resolution on all dates and times and sets the due date to end at 59 seconds after to match the behavior of Canvas. It also sets the available until date to end in 59 seconds, which is contrary to Canvas behavior, but it is the behavior that should occur when the due date is set to the end of the minute. Without doing this, the available until can be before the due date, which is normally disallowed. The adjustment was poorly implemented, had unseen ramifications, and is a big hack by Canvas. It's still not right, so look for this to change in the future. If you are using version 2a, there is no need to update unless you want the end of minute behavior.

 

Version v2c, released on December 25, 2018, changed the handling of the due at and available until dates. Canvas changed their rules to make it end at 59 seconds whenever the minute portion of the time ended in 59 and at the beginning of the minute for other times. This version now matches that behavior. It also removed the onEdit() function that I had added with version v2b that checked input as you enter it. It turned out that had some problems with copy/pasting information as well as slowing things down. It removed the option to adjust the seconds since it is no longer necessary. I also sped up the process by writing all of the information to the spreadsheet at once instead of one row at a time. If you wish to patch your version instead of starting over, the dueDates.gs and utils.gs files changed.

 

Make a new copy

Making a new copy sometimes fixes things as well. This happened with the old version v2, but I had one copy that would not run. I made a copy of that copy -- one known not to work -- and the new copy worked, even though the original one did not work, not even with a refresh. Perplexed? I can't explain it, either.

 

Manually run the script

We did find another work around if you are still having problems. This is kind of techy and it's received much less testing than the other stuff, so I would try downloading the new version first or reloading the page. This does appear, in limited testing, to be a one-time thing. Once the script works and you get the menu, you seem to be good.

  1. Click on Tools > Script Editor
  2. On the left side there is a list of modules. Click on DueDates.gs
  3. The editor has a toolbar with a dropdown called "Select function". Choose the  function from there.
  4. Click the Run button (arrow to the right). It won't be clickable until you select a function.

Manually Run the Script

It then prompts you for authorization and you should go through with the authorization process.

271 Comments
Shar
Community Champion

Just a reminder to folks to set the time zone in the sheet and the script as per the instruction step 3.

As a long time user, I grabbed the new version, configured my API, and went off to the races and then noticed the dates/times were Central Time Zone (1:59am) and I'm Pacific (23:59pm previous day). :smileysilly: Hmm, but maybe 2am should be the due date after all, give those midnight oil students a little cushion. heh.

Thank-you for the updated version, James!
Cheers - Shar

grottofilms
Community Novice
bai18011
Community Novice

Hey James, great job with this script and tutorial. Is there a similar way I could edit "To do" dates. Thanks

James
Community Champion
Author

 @bai18011  

Do you mean on content pages, calendar events, appointment groups, or something else when you say "To Do" list.

Content pages are a completely different things than assignments, quizzes, or discussions. When I wrote the script, Canvas didn't support adding pages to the To Do list and when they came out with it, it was sufficiently different that I didn't update it to include it. I didn't want my hundreds of pages to cloud up the list of assignments.

There is a Pages API that will allow you to get a list of all of the pages. There is a "todo_date" property included when you do that. If you modify that date and send it back to Canvas, then you can change the dates on content pages.

It would probably be easier to modify my https://community.canvaslms.com/docs/DOC-5676 script to allow for dates than it would be to incorporate pages in here.

bai18011
Community Novice

Ok! I’m not great at coding, but I will probably use the framework you have set up. Thank you for your response and hard work on these.

Get Outlook for iOS<https://aka.ms/o0ukef>

mapigo234
Community Novice

Thank you for this time-saving gem! It worked for me in January 2020, but it isn't working now. I seem to be able to do all the steps until I get to "Load Due Dates". None of my due dates load. Any advice?

James
Community Champion
Author

 @mapigo234  

It worked for me two days ago. Do you have the latest version (updated March 15, 2020)? If you're not sure, the new one has a "Points" column and the old one has a "Muted" column. If you last used it in January, then chances are you're running an older version. Not much has changed -- the muted / points thing. Canvas deprecated the muted back in January so I removed it.

I've had a couple of people report problems and then come back with downloading a new copy and installing it fixed things.

If that doesn't work ...

Is the Access Token you're using still valid?

Try going to Tools > Script Editor to open up the code. Then switch tabs to the spreadsheet and run the Load Dates. Then switch back to the code and press Ctrl+Enter to open the logs. I don't think this will show anything, though. They used to have an execution log, but I switched JavaScript engines with the March 15 update and the new one doesn't appear to log much other than it ran a function. The old one used to show all of the API calls.

I would also add that Canvas has now, as of April 15, added their own bulk date adjustment. Your local Canvas admin needs to enable the feature before you can use it. It doesn't allow you to change times or point values, just dates, but it does support differentiated assignments. There are no date calculations, like if you need to add 7 days to everything like we did because the coronavirus extended your spring break. But it may be enough for most people, which is Canvas' target audience.

Once the Canvas Admin has enabled it, you can go to the Assignments page and open up the more options where there is an "Edit Assignment Dates" option.

346251_pastedImage_1.png

It looks like this:

346252_pastedImage_2.png

ProfessorBeyrer
Community Coach
Community Coach

I think you nailed it perfectly:  

But it may be enough for most people, which is Canvas' target audience

 @James , I am glad there are users like you who are willing to share your work beyond what is enough for most people and that there is a place like the Canvas Community where sharing can take place.

schroedert2
Community Novice

Thank you so, so much! This worked perfectly. You just saved me my entire day!

shadwin
Community Participant

I have used this script for the past 3 years, I love it.   I am having difficulty with the newest version 2d...  I have created an access token, but when I then try and Configure API settings from the Canvas drop down in the new file, I will go thru the Google approval process to accept an unsafe application, but I never see the prompts to load my access token.   After it returns back to spreadsheet, the Configure API Setting, the Forget API setting and the Help selection in the Canvas drop down, indicates an error that google.drive refused to connect.   What am I doing wrong?  Thank you

James
Community Champion
Author

 @shadwin  

I'm not able to understand this sentence: "After it returns back to spreadsheet, the Configure API Setting, the Forget API setting and the Help selection in the Canvas drop down, indicates an error that google.drive refused to connect."

I did make an updated video for the Setup and Configuration (first video) on the page that now incorporates the extra hurdles that Google makes you go through. Can you watch it and see if it answers your question?

I also added extra instructions for those who may not know how to jump through the authorization step and a note that Canvas now has their own solution that may work for most people.

shadwin
Community Participant

When we Configure the API in Google, it asks us for permission to access the spreadsheet.   The part where you enter the token number and hostname does not materialize, it returns to spreadsheet view.  When I click on the Canvas menu, the three selections indicate that google.drive refused to connect..  Somehow it is bypassing the prompt window to enter the token information.  I will try it on another browser (IE, FireFox) to see if it is a Google.Chrome issue.

shadwin
Community Participant

Ran the script in IE and everything worked.   I assumed it being a google spreadsheet that it was preferred to run in Google Chrome.  It did not execute as intended in Google Chrome.  Thank you for steering me in another direction.

James
Community Champion
Author

Weird, but I'm glad you got it figured out. Normally Chrome does work better with Google Sheets.

jjones4
Community Member

Thanks so much for this tool, works great!  I have had issues with it using Firefox but fine on the other browsers.

If I may ask, is it possible to do something like this for announcements?

James
Community Champion
Author

It may be possible at the course level. Announcements at the course level are handled as discussion topics (at least they were) and so they may be more doable than global announcements. If you can create an announcement with the mobile app, then it can most likely be done.

Sorry for the vagueness there. I don't use announcements and haven't looked at them in earnest since 2017 (?) so I cannot give a definitive answer without more research.

At the time, I was looking at Global Announcements and wrote a script and even started writing documentation for it, just to find out that Canvas didn't make available what I needed. I just double checked and it's still done the same way. It's a non-API call that's used and with Google Sheets you really are limited to what they make available through the API. That's why I said it may work at the course level, but not at the admin level.

rmaynard
Community Explorer

James, the one thing on my Wish List for this sheet was to adjust point values. The external gradebook <cough><cough>Mastering<cough><cough> from which I import values doesn't always play nicely, so things like Available Dates (Always Available defaults to sometime in 1969) throws multiple errors, and the points get out of whack in the process. I've been using this sheet in some form for several years, but this update was an early Christmas present! Between this and the QuizWiz enhancements for Speedgrader, I actually get to put more time into teaching. Thank you so much!!

carolg
Community Member

Thank you so much for this!  I wondered if this (the newer version, anyway) would also let you rename an assignment in the google sheet, and it does!  So if you have a lot of settings you'd like to duplicate (restricted file type, assignment instructions, rubric, etc), it's quite easy to set up  HW1 in Canvas, use the duplicate feature to create 29 copies, and then rename them HW2, HW3, ..., HW30 in the google sheet.  There's even a spreadsheet shortcut that will rename a column of cells sequentially for you, so you don't have to type those (highlight 2 cells to establish your pattern and pull down the dot in the lower-right corner)

mkubek
Community Member

Is there a way to see multiple classes at once so that I can adjust do dates for 3 classes (same prep) at once?

LifeLearner
Community Member

Genius!  Thank you for saving me time!

g-Rad
Community Member

Is this still working for everyone? All I get is the script completed but no data is pulled from the course. Tried several courses all same results.

 

Nevermind. 

James
Community Champion
Author

@mkubek

You can have multiple sheets and rename them, but it will only actively work with the one that is named Dates. Fetch 1, rename it, fetch the second, rename it, fetch the third. Fix all of them and then play a rename game when you save them. 

montgomery1
Community Participant

Thank you for creating and sharing this, @James! It was driving me crazy to have to edit the assignment times one-by-one. Your setup instructions were easy to follow and I just changed all the due times in one of my courses! I'm so excited!!!

lewisbr
Community Member

James,

One of the major limitations I have found with this script is not being able to adjust due dates for different sections. I teach several multisession courses that meet at different times of the day, and assignments are due at class-time. 

Any hope of adding that?

James
Community Champion
Author

@lewisbr,

It's not going to happen with this version of the script. I want this one kept simple.

I started writing a new script last fall, that would have much more functionality, but would not have all of the assignments on a single page -- it would be split up by assignments, quizzes, discussions, pages, announcements, files, etc (maybe not all those). It's a major undertaking and hasn't progressed any since the fall 2019 /spring 2020 semester break.

Teaching online is a lot harder than teaching face to face and I do not have any spare time to spend working to do any programming or even be in the community much at all. This particular project is a very low priority for me.

Ssteed22
Community Member

I was able to do this in the spring and it worked flawlessly! Now I'm trying to use it again with a new API and everything. Once I specify my course the new tab with dates is not showing up at all. I've tried resetting the API, walking through the setup process again (like 3 times). I am pretty sure I'm just doing something wrong but for the life of me I can't figure out what. 

alanwang
Community Member

@Ssteed22 It worked for me this morning. So the scripts do work. You can check the error message in the script manager (under the Tools menu). Once in the script manager, click on dueDates.gs on the left, then choose the function getDueDates in the dropdown box next to the debug button in the toolbar. Click the Run button to execute the function. Check if there is any error message in the View menu - Execution transcript. 

Kudos to the author of this tool. It saved a lot time for me. 

James
Community Champion
Author

@Ssteed22 

When you specify the course, do you get a dialog window that confirms the course information and ask if you would like to proceed?

If not, then did you get a confirmation screen when you put in the API information?

There are dialog boxes along the way to let you know what's happening and if those are not appearing, that's when something isn't going correctly and checking the logs may help.

Also note that Canvas added their own solution for a bulk date changer that may be sufficient for your needs. It's under Assignments and then choose the options (three vertical dots) and choose "Edit Assignment Dates"

tfilipiak1
Community Participant

This is so helpful.  Could the number of attempts also be included?  We switched to a newer version that now has this functionality for assignments.  It was only on quizzes before.

James
Community Champion
Author

@tfilipiak1 

The allowed_attempts property is part of the assignments API so it could be added fairly quickly to the headers at the top of the dueDates.gs file if someone wanted that functionality. You would also need to add it the list of fields to keep in the getDueDates function.

I don't think it's supported for discussions and it's a little bit harder for legacy quizzes (which are being deprecated) than just setting the number of attempts as you have several other options that go with it that need considered. For that reason, you should probably limit the location to "Assignments" as is done with Points.

Canvas has added a bunch of functionality since this script was originally written. When I wrote it, it was designed to handle the common functionality (plus show and hide dates for quizzes since I use those). There really needs to be a bulk edit page for each type that allows you to set all of the items for that particular type of assignment, but then it loses the ability to edit all of the dates at once.

lizardsofwar
Community Member

I love this tool! Thank-you for developing it. 

When the spreadsheet loads my assignments they show up all out of order. Can I sort by Title "Column A" or sort by other columns and then change and update the dates/times? Or would this rename the assignments and create a mess? Thank-you! 

James
Community Champion
Author

@lizardsofwar 

You can sort, but you will need to sort all of the columns, not just 1 of them. There is a column that contains a Canvas ID and that is what the script uses to match things up. Sorting some of them without including that one (really all of them) would definitely mangle things.

lalee24601
Community Explorer

This is great, James! Thank you so much for sharing. As a Canvas API newbie, I was wondering if you think it would be practical to learn then modify this script to sync calendar events to a Google Sheet? We're definitely willing to figure it out, but your nod to say it sounds reasonable would be really helpful. Thank you!

James
Community Champion
Author

@lalee24601 

Calendar events are handled differently than assignments or quizzes. It can still be accessed through the API and it refers to dates, but it would mean a lot of new code. It may be easier to make a spreadsheet that only looks at calendar events and then you can add the extra columns for events that you don't have with assignments.

In my long-term thoughts about a revised spreadsheet, it would have a sheet for each type of item that you could change the settings for those items. That breaks the point of having everything on one page, which is what the original intent was. That means that it would probably be a separate work, rather than a replacement for this one.

For example, I have another spreadsheet that manages content pages and just content pages. It might be easier to modify that to work calendar events than to modify this one. It may not be, either. The code to manage dates and times is in this one, but there's also a lot of overhead in this one that isn't needed.

lalee24601
Community Explorer

Wow, that was super fast, James. Thank you!

I'm working with someone else who is a real programmer rather than a dabbler, and the code will probably make more sense to her. Is the content page manager you refer to also a Canvancement? 

We already have Google script code to sync our assignment sheet spreadsheet to Google Calendars. Do you think it would make more sense overall to try to build something to read an ics file that we'd either build from the spreadsheet or let Google make? That's an extra step for us, presumably, but it would probably be more useful to the broader Canvas community.

When I looked, the import ics/sync to Google has been on the request list for over 5 years. I'd love an active sync, but just the ability to import would be fine.

Thanks again! As a newbie, I'm really impressed with the generosity and support of the Canvas Community. 

 

James
Community Champion
Author

@lalee24601 

Your first post didn't say anything about trying to put this into a Google Calendar, so I thought you were trying to get it into a spreadsheet to easily move dates around or make limited modifications like the adjust all due dates.

If you're trying to import them into a Google Calendar, then you're getting into things I haven't explored so I cannot comment on the best way to accomplish that.

The page manager Google sheet is a Canvancement. It's Bulk Publish / Delete Pages.

lalee24601
Community Explorer

Thank you! We'll take a look. It isn't that we're trying to put the Google Sheet Assignment Sheet into a Google Calendar - but that we already have Google scripting that does that, so I was wondering if it makes more sense to try to write code to import an ics (which Google can export) into Canvas because that would have wider use than just our specific application. 

What you've already done here is tremendously helpful.

James
Community Champion
Author

@lalee24601 

When you read through the community, several have requested a calendar-to-Canvas import. I don't remember seeing a solution. That might be because it's too difficult or because there's no good way to tie things between the two systems.

Your spreadsheet can contain other information like IDs that aren't in the ics export that may be necessary to do a proper import. If you move something in your Google Calendar, how does it identify the item to move it in Canvas? Does the ics files contain a "move" or does it just do a sync? And if there is a sync, then there needs to be some way for Canvas to distinguish between items that the user added vs things that are synced with Google.

Experience says that it is often easier to have a definitive source and pull everything from that. In your case, it sounds like a Google Sheet is the master. Sometimes things get lost when you go from one source to another and then pull information from there. But again, I can't say for sure because I don't understand the whole process. It sounds like your programmer is capable though, so she can consider all my ramblings and come up with the best way.

lalee24601
Community Explorer

Thank you! If we do get things working, I'll definitely share! 🖖

mmtscn
Community Explorer

This is great! Thank you so much, @James.

patricia_lipsey
Community Participant

When I go to set the time in script editor- project properties, I do not have the menu at the top of

FILE EDIT VIEW   etc

 

so I can't proceed to the next step. 

 

Thanks for your help. 

James
Community Champion
Author

@patricia_lipsey 

I see that Google has changed their interface and file > properties is no longer an option.

It is a bit more convoluted now. I couldn't find it by poking around, so I had to research how to do it.

  1. Click on the settings button from the left menu.
    James_0-1628988116933.png
  2. In the General Settings section, select the button to Show "appsscript.json" manifest file in editor.
    James_1-1628988186666.png
  3. Now select the Editor < > button from the menu and select the appsscript.json file.
    James_2-1628988301096.png
  4. Edit the "timeZone" setting to match your timezone. Here is a list of the supported timezone names. The common ones for the United States are "America/New_York", "America/Chicago", "America/Denver", and "America/Los_Angeles".
  5. Save the appsscript changes by clicking on the disk icon at the top of the code or pressing Ctrl+s (Cmd+s on a Mac).

If you want to, you can go back to settings and stop showing the appsscript.json manifest file, but you're probably not going to edit the files anyway, so it doesn't matter much.

patricia_lipsey
Community Participant

Thanks so much!  That works great. 

Pat

martinacc
Community Member

Hi @James,

Thanks a lot for sharing this amazing tool.

I adjust used it to adjust two courses. It works great.

I have two things to ask.

1. The "Hide time" function does not work for me. I have set the due time to "23:59". It's not a big deal though. Has anything been changed on Google's part?

2. I do not see adjust timezone in the "appscript.json" file have any effect.

 - I did not know the existence of "appscript.json" until I saw your reply above. I did the edits and all went along very well. Am I missing something?

 

Thanks again!

James
Community Champion
Author

January 8, 2022 Instructions Update:

It appears that Google has changed the interface (again) and there is no longer a Tools > Script Editor. Instead, you go to Extensions and choose Apps Script.

This also affects setting the timezone as I describe in this message from August 21, 2022.

I went to update the original blog post and make the changes, but unfortunately, the new forum software imposes a 30,000 character limit and it wouldn't let me save my changes.

cornwall
Community Novice

Oh my gosh...THANK YOU for this tutorial and step-by-step instruction on how to change due dates within the Modules!!  Now, I hope I can remember how to do it in the Fall!!

James
Community Champion
Author

@cornwall, you're welcome.

Also be aware that for simpler needs, Canvas has a built-in page (Assignments > More Options > Edit Assignment Dates) that may work.

Buzz
Community Member

Hello James,

Let me say thank you so very much for this handy tool! I use it every semester. A couple things:

  • Do you take any donations? 
  • Could you incorporate "Submission Type" into future versions? This would be quite handy, as I can't seem to find a way to do that to multiple assignments en masse.

Cheers,
Buzz

James
Community Champion
Author

@Buzz 

My reward is knowing that people find it helpful. If I took donations, then it would be more like work instead of fun. That may change if I ever retire from teaching and go into consulting, but for right now, other people need help more than I do.

Submission Type doesn't really fit in as it only applies to assignments and not quizzes. It's also difficult because there are different options (that vary greatly) that are available depending on the submission type and that may be a multiple-select option.

What I do in a case like this is to write some JavaScript that will query the API to get the list of assignments, filter it (most likely by name) to get the items that need changed, and then make an API call to update the assignment type and set whatever things need changed.

But it really doesn't fit in with the purpose of this sheet.

scott_whitney1
Community Explorer

Thank you so much for this fantastic tool. I've been using it for about 3 years to bulk-edit my due dates and even change assignment names to use a consistent naming pattern.

I'm looking over the code and I see potential to use it for bulk editing quizzes as well. One example would be to switch a group of quizzes from "graded" to "practice"

Is there any copyright limitation on my repurposing the code?