Student Self-Grading Assignment Part 3

A student self-checking, self-grading assignment provides students with immediate feedback to encourage additional effort and accuracy. When the Google Slides Presentation is copied (through Google Classroom or Drive), the Apps Script attached to the presentation is copied along with it. This is a three part project. This final part includes necessary functions and others that are helpful to complete the student self-checking assignment as well as a demonstration of how to easily create and format an assignment.

Create a Student Self-Checking Assignment.

  1. Open the Google Slides presentation from Part 2.
  2. Open the Script editor.
  3. Copy and paste the code into the Script editor.
  4. Save the script file
  5. Format the answer key table on slide 1 to hide it from view.
  6. Add assignment slides.
  7. Right-click response or position shape to set the alt text title to response or position.
  8. Copy response or position shapes to wherever the shapes are needed.
  9. Fill in the correct answers into the response shapes separating possible correct answers with a semicolon.
  10. Move position shapes to the correct position.
  11. Run the "main" function from the script editor.
  12. Move position shapes from correct position.
  13. Copy assignment to students.

    function setAlt() {
      var presentation = SlidesApp.getActivePresentation();
      var currentSlide = presentation.getSelection().getCurrentPage();
    
      currentSlide.getShapes().forEach(function setTitles(shape) {
        shape.setTitle("response");
      });
    }
    
    function fillVowels() {
      var presentation = SlidesApp.getActivePresentation();
      presentation.getSlides().forEach(function clearAll(slide) {
        slide.getPageElements().forEach(function clearAll(element) {
          if (element.getPageElementType() == SlidesApp.PageElementType.SHAPE && element.asShape().getTitle() == "response" && element.asShape().getText().asString().trim() == "") {
            element.asShape().getText().setText("a;e;i;o;u");
          }
        });
      });
    }
    
    function clearResponses() {
      var presentation = SlidesApp.getActivePresentation();
      presentation.getSlides().forEach(function clearAll(slide) {
        count = 0;
        slide.getPageElements().forEach(function clearAll(element) {
          if (element.getPageElementType() == SlidesApp.PageElementType.SHAPE && element.asShape().getTitle() == "response") {
            element.asShape().getText().setText("");
          }
        });
      });
    }
    
    function main() {
      fillVowels();
      buildKey();
      clearResponses();
    }
    
    function onOpen() {
      SlidesApp.getUi().createMenu("Other").addItem("Check Answers", "checkResponses").addToUi();
    }
Copyright © 2022 WhatEverItSaysIsFine privacy policyterms & conditions