TA repo for https://github.com/viega/applied_crypto_2022_spring/
➜ tree
.
├── <problem set>
│ ├── source # autograder stuff goes here
│ │ ├── artifacts.py # creates artifacts for grading
│ │ ├── input.py # either extracts input from artifacts or generates it from scratch
│ │ ├── solution.py # reference solution
│ │ └── tests.py # pytest unittests which power autograder
│ └── submission
│ └── ps # copied from ../source/ but can be created from clipboard for local testing
├── Pipfile | configuration files for autograder
├── ... | but also used to bootstrap local setup
├── conftest.py | for testing
└── setup.sh
brew install colordiff
Gradescope runs on py3.6 so its easier to reproduce similar env locally.
You can use pyenv
:
pyenv install 3.6.15
Pipenv manages local python deps:
python3 -m pip install pipenv
pipenv install
In order to use all deps locally you must activate pipenv envs via:
pipenv shell
Solutions should be importable from the shell:
➜ ptpython
>>> from ps2.source.solution import xor
>>> xor(b'hello', b'world')
b'\x1f\n\x1e\x00\x0b'
# runs diff between example output and output
# generated by solution given example input
make <problemset>/diff
# runs grading script
make <problemset>/grade
Same as above but requires PASTE=true
env var:
make PASTE=true <problemset>/diff
make PASTE=true <problemset>/grade
pdbpp is very useful to debug pytest failures
locally when working on the grading script. Simply add pdb
make target to
enable it:
make pdb <problemset>/grade
On any failure pytest will drop into pdbpp
sheell.
make <problemset>/source/grading.zip