Coder Social home page Coder Social logo

uaminghao / homeworkongoogledocs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from leticiawanderley/homeworkongoogledocs

0.0 0.0 1.0 45 KB

Script for creating and sharing Google Drive documents with students.

License: Apache License 2.0

Python 100.00%

homeworkongoogledocs's Introduction

Purpose

Creating and sharing documents on Google Drive to collect students homework for grading.

Command Line Parameters

  • -a or --affix: a mnemonic affix that will end the name of the document for the student (e.g., cmputXYZ-wTT-hwN)
  • -f or --folder: the name of the folder in drive where the documents are stored
  • -s or --students: JSON file with three fields per student: prename, surname, and email, which are used to name the document
  • -t or --type: type of artifact to be created (i.e., document, spreadsheet, or folder), document as default
  • -i or --instructors: JSON file with one email field per member of the instructional team, which is used to share the document

Sample JSON file with student list:

[
  {"prename": "Alice", "surname": "Wonderland", "email": "alice@wonderland"},
  {"prename": "Bob", "surname": "Builder", "email": "bob@builder"}
]

Sample JSON file with instructional team list:

[
  {"email": "white@rabbit"},
  {"email": "cheshire@cat"}
]

Initial Setup

  1. Enable the Drive API for the institutional account used on the course (follow the Python Quickstart)
  2. Download the credentials and put them on the same folder as the script.

Naming of Folders and Documents

Folders and files on Google Drive are accessed via internal identifiers (instead of paths). The program first searches for a directory (anywhere) in the Google Drive corresponding to the provided access token matching the parameter folder.

If the folder is found, the program creates a blank document for each student listed in the student file, naming each file with the prefix (so that the student knows what the document is about) followed by the student name and the provided student id in parenthesis.

Example:

python create_and_share_google_docs.py -f cmput391w19hw1 -a "cmput391 w19 hw1" -s students.json -t document

Would create documents Wonderland_Alice_cmput391 w19 hw1 and Builder_Bob_cmput391 w19 hw1 inside folder with name cmput391w19hw1.

It might be best to test everything with an empty student file.

Note

After downloading the namelist json file, remove the outermost square brackets of the code.

Running change_permissions.py for changing the permission so that only the own can edit it, after deadlines.

Legal

This code wad produced by modifying the Python Quickstart.

Copyright 2018 Denilson Barbosa

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

homeworkongoogledocs's People

Contributors

leticiawanderley avatar dmbarbosa avatar uaminghao avatar

Forkers

udituen

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.