Creating an Assignment

  1. Build the assignment locally on computer with nbgrader
    1. Build the assignment using nbgrader
      1. Create a <nbgrader_dir>/source/<assignment name> directory for the new assignment. For the assignment name, use only lowercase and no special characters
      2. Create the jupyter notebook and use nbgrader tools by selecting View -> Cell Toolbar -> Create Assignment
      3. Instructions for nbgrader at https://nbgrader.readthedocs.io/en/latest/user_guide/creating_and_grading_assignments.html
    2. Generate student version of the assignment in the <nbgrader_dir>/release directory:
        1. Cd to <nbgrader_dir>
        2. $ nbgrader generate_assignment <assignment name>
    3. Add any other needed files to the student version of the assignment (e.g. csv files), found in the <nbgrader_dir>/release folder
  2. Create the assignment template repo in GitHub master organization (so it can be reused later for additional classrooms / sections of the course you teach)
      1. Create new assignment template repo
        1. Cd out to <course-name> directory and run the following
          1. $ abc-new-template <assignment name> –github
        2. On GitHub
          1. Go to master-organization repo and navigate to assignment template repo
          2. In Settings:
            1. Check “Template repository”
            2. Change visibility to private repo
  3. Create assignment on classroom.github.com and link to template repo:
            1. Create new assignment and name it with same <assignment name>. Make sure the “custom repository prefix exactly matches the <assignment name>
            2. Add a deadline
            3. Select individual or group assignment
            4. Select “private repos”
            5. Click “add starter code” and link assignment to template repo you just created <master-course-organization>/<template-repo-name>
            6. Choose “template repository” as import method
            7. Send assignment link to students
              1. Students must pull assignment from GitHub repo, work on it, and push changes back to the repo before the deadline

How to Handle Large Data Files

  1. If your data files are too large to store on GitHub, you will want to locate them in cloud storage and obtain a public link to download them (e.g. Box or Google Drive)
  2. Add a code cell to the top of your Jupyter Notebook to download the files
  3. Add a .gitignore file into your <nbgrader_dir>/source/<assignment name> repository so that the data files do not get uploaded to GitHub (e.g. so when the students upload their solutions, it does not try to upload the large data files with them)

Editing an Assignment Before Distribution to Students

  1. Make your changes in the <nbgrader_dir>/source/<assignment name> directory
  2. Generate student version of the assignment in the <nbgrader_dir>/release directory:
    1. Cd to <nbgrader_dir>
    2. $ nbgrader generate_assignment <assignment name>
  3. Cd out to <course-name> directory and run the following
    1. $ abc-new-template <assignment name> –github –mode delete

 

Next: Collecting assignments