markingpy
Tool for grading a directory of python submissions using a scheme file containing exercises. The grader supports multiple test cases and analyses code style using PyLint.
Read the full documentation at https://markingpy.readthedocs.io.
Installation
Markingpy should be installed using the pip installation tool.
pip install markingpy
Example usage
There are two steps to using markingpy. First is to create the marking scheme file, which should be of the following form:
from markingpy import mark_scheme, exercise, PyLintChecker
# If you want to use timing tests, use
from markingpy import TimingCase
# Initialise mark scheme configuration.
ms = mark_scheme(
linter=PyLintChecker(), # add a linter to the marking process
submissions_path='submissions' # Directory to search for submissions
)
@exercise(name='Exercise 1',
descr='Short description for feedback')
def ex_1_function(arg1, arg2):
"""
Model solution for exercise 1.
"""
pass
# Now add the call test components
ex_1_function.add_test_call((1, 1), marks=1)
ex_1_function.add_test.call((1, 2), marks=1)
# Add a timing test using the following
cases = [
TimingCase((1, 1), {}, 1),
TimingCase((10, 10), {}, 3),
]
ex_1_function.timing_test(cases, marks=2)
@ex_1_function.test
def custom_test():
"""
Define a custom test. This test determines whether the
submission function does any type checking during
execution. The test is passed if the function raises
a TypeError.
Custom functions should return True or False for success
or failure, respectively.
"""
# Use the function ex_1_function in the test
# this will be replaced by the submission function
# during testing
try:
out = ex_1_function(1.0, 2.0)
except TypeError:
return True
return False
Once the marking scheme has been created, in scheme.py or similar, use the command line tool to begin grading submissions:
markingy scheme.py run
The results and feedback will be generated and stored in a database, and can be retrieved using the command
markingpy scheme.py dump directory
which will dump feedback files (.txt) into directory for each submission.
Development setup
Clone the repository and run make install. Markingpy uses pipenv to handle its dependencies.
Additional Disclaimer
This is my first Python package that I have "released" (i.e. put on PyPI), and I would be grateful for any feedback and constructive criticisms. Contributions are certainly welcome in all forms; see below.
Contributing
- Fork it (https://github.com/inakleinbottle/markingpy/fork)
- Create your feature branch (
git checkout -b feature/name) - Commit your changes (`git commit -m 'Add some feature')
- Push to the branch (
git push origin feature/name) - Create a new Pull Request.
Release History
-
1.0.0
- Reworked grader system. Tests can now be run in separate processes to provide better isolation.
- Reworked command line interface.
- Reorganised and improved test suite.
- Greatly simplified marking scheme creation and exercise association.
-
0.2.0
- Added support to tests on arbitrary objects and their methods.
- Various improvements to the code base. Added descriptor support for test classes and exercise classes.
- Expanded the documentation.
- Implemented finder system for locating submissions, which currently supports loading submissions from directory (as before) and SQLite databases. Planned support for server loading.
-
0.1.0
- First release
Meta
Sam Morley - sam@inakleinbottle.com - https://inakelinbottle.com
Distributed under the GPLV3 license. See LICENSE for more information.
Metadata
Release files for markingpy 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| markingpy-1.0.0.tar.gz | 30.7 kB | Without provenance | Details for markingpy-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| markingpy-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for markingpy-1.0.0-py3-none-any.whl |
Total release size: 90.3 kB
Release files / markingpy-1.0.0.tar.gz
| Download URL | markingpy-1.0.0.tar.gz |
|---|---|
| Size | 30.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8ccc7ca127973c67b824ec9bae18312be50fe8e612fcd230f90afa860b01ba50
|
|
BLAKE2b-256 checksum How to use checksums |
0d4789de039d2a3cea322abda57691c84e567cdb39c36827d997ba08bd547090
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3+
|
Release files / markingpy-1.0.0-py3-none-any.whl
| Download URL | markingpy-1.0.0-py3-none-any.whl |
|---|---|
| Size | 59.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f808b36bb3ae8012a73f29dd8a75cc316c0f2792371e7912166c30d60b48101c
|
|
BLAKE2b-256 checksum How to use checksums |
44de21e0eb3c09dbc85f51acf0783276f09532e65bbe235ec1fc2fa905027f67
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3+
|
Security for markingpy 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.