Inner GeekTechnologies for LearningWeb Design

Google Classroom Assignments to Calendar

Services such as “Show MyHomework” provide a calendar of homework allocated to pupils and classes by their teachers.  These simple tools allow files to be attached to homework but require the files to be download to be completed and printed in a traditional manner.  These tools do not integrate the allocation of assignments/tasks with the tools to carry out the work and depend on the learner having access to the required software to complete the task (and perhaps a printer to transfer it to paper for the teacher!).

It would be great if you could integrate the calendar of assignments with the tools to complete the task AND provide a publicly viewable calendar that parents could view to see the work allocated to their child’s classes in a service that would handle all of the complexity of sharing permissions, copying files etc. for you.

Recently, I’ve been working with Google Apps for Education and particularly Google Classroom.   I’ve received numerous requests for a public calendar of homework so I set about creating just that!  I started reviewing the work at Mr Caffery’s Blog which was a good start but actually contained a number of bugs and I have revised and improved his work.  This article is intended for Google Apps for Education Administrators but feel free to give it a go 🙂 .

Setting up Gmail, Apps Script and Calendar

  1. Create a user in your Google Apps Domain for the public calendar.  You need one user for each publicly viewable calendar.  If your domain covers a number of schools then create a user for each school (, etc.).
  2. This user needs to be added to every classroom that will be included in the calendar. Teacher’s can invite the user and then the user has to accept the invitation or the user can just join the class in the normal way with the class Joining Code.Go to and signup, using this user calendar user account, to your class / classes using the class code(s) or go to and accept the invitations to the classes.
  3. When assignments are set, an email is sent to each user in the classroom.  Our user account is going to filter these emails when they arrive and label them with a new label of “Classroom”.Go to  Sign in using your Calendar User Account.
    Click the settings cog (in the top left of the screen normally)  and choose settings.
    Click Filters and then Create new filter. The Filter pop-up will appear.

    When a email is received from Google Classroom it starts with the text “New Assignment…” in the subject line. Type New Assignment* into the Subject box – the * is a wildcard which means that anything can appear after the text New Assignment.

    Then click Continue.On the next page of the popup, tick the box “Apply the label” then click in the pull down menu and then click New label. A new popup will appear.  Under “Please enter a new label name:” enter Classroom then click Create.Screen Shot 2015-07-08 at 4.06.52 PMFinally, click Create filter.

    Any new email sent which starts with “New Assignment” in the subject line will be labelled with “Classroom”.  This is how we’ll pick out the Google Classroom emails from the others.
    Screen Shot 2015-07-08 at 4.07.49 PM

  4. Now to add the Google Apps Script.Still logged in as your Classroom Calendar user, go to and open up your Google Drive.In Google Drive, click New and then more > and then Google Apps Script.If you haven’t used Apps Script before you’ll have to add it using ” + Connect more apps”.

    If you are adding it, just enter Apps Script in the search box of the popup that appears when you click “+ Connect more apps” and it should be the top result.  Just click the + Connect to add it. Once added it will appear in the New menu as described above.

    Connecting Google Apps Script to your Google Drive


    Adding the Apps Script application to your Google Drive

    Start your Apps Script project with a new Blank Project (just double click Blank Project to start).  Click the Untitled project text in the top left and call it ClassroomToCalendar (just something to remember what it is!).  Then replace any code in the window with the following:

    NOTE: There is a US version of this code on GitHub

    Remember to click Save (in the file menu or the disc icon!).

    Click the triangular play button next to the image of a bug. The script will run and will request access to your drive, mail and calendar. Allow this or it will not work.

  5. You’ll want the script to run every hour to add new assignments to the calendar.  To do this we use the Resources menu. Click Resources and then All your triggers.  Click Add a new trigger and enter the following details.Screen Shot 2015-07-08 at 4.48.31 PMAnd then click Save.
  6. Making the calendar public.  Finally you’ll need to go to and choose the menu from your calendar user’s default calendar.Screen Shot 2015-07-08 at 4.52.32 PMClick calendar settings and then give the calendar a suitable name (something like “All School Homework”) and click Save.

    Now go back into the same calendar settings and click Share this Calendar.  Click the tick box for Make this calendar public and select the option See all event details.  Click Save to store this setting.

    Finally, you’ll want to embed the calendar or share it via a link.  Go back into the same calendar settings as before and there will be some code to Embed This Calendar in a web page and details of the Calendar Address – use the HTML one get a link to share with parents/carers (you could use a shortlink creator like to generate a short version of this link).

The final calendar embedded looks like:
Screen Shot 2015-07-08 at 5.03.14 PM

Screen Shot 2015-07-08 at 5.03.33 PMIt adds the name of the class followed by the activity to the Calendar entry and includes the name of the main class teacher in the Description. Job done 🙂

The beauty of this solution is that you only need the calendar user to be added to each classroom. Other than this initial setup there is no further complex technical stuff to do!

This code is available on Github at

  1. Sylvia

    HELP !
    I have tried setting up my google classroom to google calendar but it has an error on line 28 it says:-TypeError: Cannot read property “1” from null. (line 28, file “”)
    I confess I know nothing about computer code. Can you help

  2. luchsingerj


    I had this same issue. I was able to add this line after line 27 and it took care of the issue. I would delete spreadsheet and the emails if you can. It has worked ever since.

    new line 28: if (inst==null) {inst=”-“};

  3. davidbeaty

    Interesting idea but why not just create a class in Google Classroom for JUST the homework that you want to be public, then ask teachers to add the larger assignments (tests etc.) to that course. They just tick the box to add the assignment not only to their class but also to the “homework” class. Then you could just edit the share settings on that “homework class” calendar to be public. What am I missing?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.