Move Files to Class Folder

I added collaborative notes documents to Google Classroom as “Students can edit file.” I did not want to push out a copy of the document to each student since the students are working in groups. This means that the collaborative document does NOT show up in the Google Classroom class folder for the student.

Template

You can use my template to create a document that adds files to the students Google Classroom class folder or you can edit the script yourself.

Click Here for Template of Docs to Class Folder

Edit the template as you see fit. I press enter a LOT of times before distributing collaborative documents. This gives every student room to place their cursor.

Tip: Save this file in the folder you wish to organize it into in Drive. Copies of this document (using the makeCopies script) go into this folder.

Script Editor

In the Google Document you can go to the tools menu and choose “Script editor.” This allows you to set up what folder the document saves into.
Tools Script Editor

Edit the Script

There is ONE spot in the script that you have to edit. Scroll down to find ‘Folder Name’ under the addFolder function. Replace ‘Folder Name’ with the exact spelling of the desired destination folder. Make sure the folder name is enclosed in single quotations.
Change folder name

Under the “makeCopies” function you can edit the name of the copied document. This is optional. The document name is defaulted to

‘GROUP ‘+i + ‘ ‘+thisTitle

The i represents the group number, do not delete this.
The “thisTitle” is replaced with the name of the document, do not delete this.

Edit the word “GROUP “. Notice the single quotations around the text string, this is important if you edit the word “GROUP .” Also notice the presence of a space in the text string.

Press Save

Do not forget to save your edits in the script editor.

Close out of the script.

Make Copies

Using the Add-On menu “Add to Folder” in the document, click on the 2nd button “Create copies.” You will be prompted for how many groups you want to create a copy for.
create copies button

Attach Template in Classroom

Attach the collaborative group documents into Classroom as “Students can edit.” In the directions prompt students to use the Add-On menu to find “Add to Folder.” Pressing the button in the sidebar will add the collaborative document to their Google Classroom class folder (if you set that as the destination folder in the script.)
Add On Menu

 

Code it Yourself

If you have your own Google Doc that you would like to use this script for, here is the code.

function addFolder(){
var doc = DocumentApp.getActiveDocument();
var thisDoc = doc.getId();
var pickIt = DriveApp.getFileById(thisDoc);

//CHANGE FOLDER NAME TO THE NAME OF THE FOLDER IN GOOGLE DRIVE
var folder = DriveApp.getFoldersByName(‘Folder Name’);

while(folder.hasNext())
{
var classroom = folder.next();
Logger.log(‘folder name= ‘+classroom.getName());
}

classroom.addFile(pickIt);

}

Script Editor

Copy and paste the above script into the script editor of any Google Docs text document you have. Modify the script to adjust to your needs.

Digiprove sealCopyright secured by Digiprove © 2015