0

I teach high school using Google Classroom. I have students used Google Slides to keep track of their projects. I create one template Slides Presentation and GC automatically creates an identical version for every student and stores them in one folder.

It takes a long time to open each presentation and read through to find out how students have updated the template.

I would like to write a script that will work its way through the folder, opening each presentation one by one and comparing each slide of each presentation to the corresponding slide in the original template. If the slide in the student presentation has been changed (added texts or images) I would like that slide to be imported into a new presentation. At the end, I would like to have one presentation that contains slides that are copies of all slides that were updated in student presentations.

Can you help me make this happen? Please.

I have written a simple slides script that can go through and count number of slides in presentations, but I haven't been able to figure out how to compare what's actually on the slides and based on this comparison import the updated slides.

Would like a script that creates a presentation of slides that were extracted from a file of 120 student presentations all made from the same original template.

Here's the script I wrote that counts # of slides in each presentation:


var sourcefile = "0ByRdqL7-G6eXflBpUEIwa0tUcmFERDRMajNQMHZCbllPVHRlVDBzT0tJNVdjY1lDeE1MdE0"

var destination = "1tAGcxlcudN4ThNwjxG89d-Xr0eVUsLFXkhsIFrL2S7M"

function main() {  
  var files = getFiles(sourcefile)  
  var record = []  
  while (files.hasNext()) {  
    var file = files.next();  
    if (file.getMimeType() != "application/vnd.google-apps.presentation") {  
      continue  
    }  
    // (file.getMimeType())  
    record.push(countSlidesInFile(file.getId()))  
  }  
  writeToSheets(record,destination)  
}  

function getFiles(id) {  
  return DriveApp.getFolderById(id).getFiles() 
}  

function writeToSheets(matrix, SheetID) {  
  SpreadsheetApp.openById(SheetID).getSheetByName("Sheet1").getRange(1,1,118,2).setValues(matrix)  
}

function countSlidesInFile(id) {  
  var pres = SlidesApp.openById(id)  
  var slides = pres.getSlides()  
  var numSlides = 0  
  slides.forEach(function() { numSlides += 1 })  
  var presInfo = [pres.getName(), numSlides]  
  return presInfo  
}  
'''

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.