Wednesday 9 January 2019

Student Feedback system - create student documents

The final stage of the student feedback system involved creating individual Google docs for each student, containing their feedback, to be archived on the network and linked to in the spreadsheet.

The following Google Apps Script does this by getting all of the data from the Group Feedback sheet, along with the ID of the template Google doc (config sheet) which will be copied and edited for each student (a process similar to this blog post). We will also need to access the master spreadsheet to create a link to each students' doc against their name, so we get this via 'openById' at the beginning of the script to be able to scan through and use it later on.

I wanted all of the documents to go inside a specific folder for each Group, so next I 'split' the filename (got via 'getName') and extract the first part of it (so 'A1', 'B1', 'C1' ...). I then use the 'DriveApp' to 'createFolder' inside of the main feedback Groups folder with the extracted Group name, descriptive text and a term time value acquired from the config sheet that administrator can update as necessary.

Now a loop is created to go through each student, create a copy of the template document, modify the contents and save it into the above folder. I use 'setFormula' to then create a clickable link to the document back in the spreadsheet (a process described in this blog post). Finally, we need to put a copy of this link in the master spreadsheet against the relevant student too, so we create a loop to search the master spreadsheet for the student and then create the link if a match is found.

No comments:

Post a Comment