Automate repetitive tasks for grading submissions in Canvas
clone repository
create virtual environment
acquire API key from canvas
add "API_TOKEN" and "COURSE_ID" to virtual
re-activate virtual environment
install requests library
run auto_canvas
git clone https://github.com/WillWeatherford/canvas-automation.git
-
-
install virtualenv and virtualenv wrapper if needed
-
virtualenv wrapper ()
- mkvirtualenv
$ mkvirtualenv grading_101d2
-
default virtual env
- python -m virtualenviron
$ python -m virtualenviron grading_401f3
-
-
- navigate to Account > Settings
- Approved Integrations
- 'New Access Token'
- add description (e.g. grading_201d3) and expiration date (course ending date?)
- generate token
- copy token to clipboard
- DO NOT close window until you have added token to virtualenv activate script as token is not visible after closing window
-
-
open virtualenv activate script
- sublime:
$ subl ~/.virtualenvs/<venv>/bin/activate
- atom:
$ atom ~/.virtualenvs/<venv>/bin/activate
- if not using virtualenv wrapper:
$ sublime <venv>/bin/activate
or
$ atom <venv>/bin/activate
-
add API_TOKEN and COURSE_ID environment variables to activate
export API_TOKEN="" export COURSE_ID=""
-
-
- deactivate environment
$ deactivate
-
activate environment:
- if using virtualenv wrapper:
$ workon <virtual env>
- if using virtualenv:
$ source bin/activate
-
pip install requests
-
$ python auto_canvas.py