Skip to content

Latest commit

 

History

History
111 lines (81 loc) · 2.49 KB

README.md

File metadata and controls

111 lines (81 loc) · 2.49 KB

For Instructors

use Jupyter notebook

  1. Copy the submit.py file to the same folder as the Exercise Notebook.
  2. Install the requirements on this repo
cd nb-grades-collector
pip install -r requirements.txt
  1. Update the requirements of the LU you're working on
cd Week\ 00/SLU00\ -\ Jupyter\ Notebook/
pip freeze > requirements.txt
  1. To enable students to submit a LU you'll need to add 3 cells at the bottom of the notebook, as follows (dont forget to set the learning unit number!):

Finder

Cell 1 markdown, read-only

# Submit your work!

To submit your work, [get your slack id](https://moshfeu.medium.com/how-to-find-my-member-id-in-slack-workspace-d4bba942e38c) and fill it in the `slack_id` variable.

Example: `slack_id = "UTS63FC02"`

Cell 2 code, Autograded Answer

### BEGIN SOLUTION
slack_id = "UTS63FC02"
### END SOLUTION
# slack_id =

Cell 3 code, Autograded tests, 0 points (dont forget to set the learning unit number!)

from submit import submit

assert slack_id is not None
submit(slack_id=slack_id, learning_unit=0)

This serves to collect the student slack ids so that we know who has submitted the LU.

For Maintainers

use with curl

curl --header "Content-Type: application/json" \
  --request PUT \
  --data '{"learning_unit": 0,"slack_id":"UTS63FC02","grade": 0,"metadata":{}}' \
  http://localhost:8000/submit

curl --header "Content-Type: application/json" \
  --request PUT \
  --data '{"learning_unit": 0,"slack_id":"UTS63FC02","grade": 0,"metadata":{}}' \
  http://localhost/submit

curl --header "Content-Type: application/json" \
  --request PUT \
  --data '{"learning_unit": 0,"slack_id":"UTS63FC02","grade": 0,"metadata":{}}' \
  https://sub-nb-grades-collector.herokuapp.com/submit

gvnicorn local run

uvicorn main:app --reload

docker local run

docker build -t nb-grades-collector .
docker run --rm -it -p 80:80 nb-grades-collector

deployment

# first time
heroku stack:set heroku-20
heroku git:remote -a sub-nb-grades-collector
heroku stack:set container
heroku config:set DATABASE="wouldntyouliketoknow"
heroku config:set USER="wouldntyouliketoknow"
heroku config:set PASSWORD="wouldntyouliketoknow"
heroku config:set HOST="wouldntyouliketoknow"

# every time
git push heroku main

docs

https://sub-nb-grades-collector.herokuapp.com/docs

postgres connect

heroku pg:psql