You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.
Notifications You must be signed in to change notification settings
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Go to fileThis command-line tool is a software development toolkit to help instructional teams author asynchronous graders for Coursera (typically programming assignments). Coursera's asynchronous grading environment is based upon docker. While use of this tool is by no means required to develop the docker container images, we believe it is helpful in the endeavour. See below for brief descriptions of this tool's capabilities.
python3 -m pip install coursera-autograderUpgrade the coursera_autograder package by running:
pip install coursera-autograder --upgrade
If you've previously installed coursera_autograder from source, you can uninstall it by navigating to the directory where it is installed and running:
python setup.py develop --uninstallAlternatively, you may use the following commands to install from source:
git clone https://github.com/coursera/coursera_autograder.git cd coursera_autograder virtualenv -p python3 venv (Optional) source venv/bin/activate (Optional) python setup.py develop pip install -r test_requirements.txt pip install -e .
If you would like to separate your build environments, we recommend installing coursera_autograder within a virtual environment. pip is a python package manager. If you do not have pip installed on your machine, please follow the installation instructions for your platform found at: https://pip.pypa.io/en/latest/installing.html#install-or-upgrade-pip The tool includes its own usage information and documentation. Simply run:
coursera_autograder -h
coursera_autograder --help
for a complete list of features, flags, and documentation. Note: the tool requires docker to already be installed on your machine. Please see the docker installation instructions for further information.
In contrast to this local tester, Coursera's production system will also set these environment variables for internal purposes. In local testing, it is possible to specify these as well with the environment variable JSON, although it's completely up to the grading Docker you create to use them or not. In typical usage, you would not set or read these variables.
Allows an instructional team to upload their containers to Coursera without using a web browser. It is designed to even work in an unattended fashion (i.e. from a jenkins job). In order to make the upload command work from a Jenkins automated build machine, simply copy the ~/.coursera directory from a working machine, and install it in the jenkins home folder. Beware that the oauth2_cache file within that directory contains a refresh token for the user who authorized themselves. This refresh token should be treated as if it were a password and not shared or otherwise disclosed!
To find the course/branch id, item id, and part id:
/:courseSlug/author/outline/programming/:itemId/
The part id can be found in the authoring user interface for each part.
https://api.coursera.org/api/onDemandCourses.v1?q=slug&slug=developer-iot
The response will be a JSON object containing an id field with the value:
iRl53_BWEeW4_wr--Yv6Aw
https://api.coursera.org/api/authoringBranchProperties.v1?q=course&courseId=&fields=properties
Search for your version name (it'll be in the properties.name field), and find the associated id (it should look something like: authoringBranch~xxxxxxxxxxxxxxxxxxxxxx . (Please note that this form of branch id is only applicable for non-original versions of the course. For the original version, the id will be a twenty-two character long string with no prefix).
The uploaded grader can be linked to multiple (itemId, partId) pairs without making duplicate uploads by using the --additional_item_and_part flag.
This command can also be used to customize the resources that will be allocated to your grader when it grades learner submissions. The CPU, memory limit and timeout are all customizable.
Allows an instructional team to view the resource limits (vCPU's, MiB, timeout) allocated to the grader for a given programming assignment. It requires the instructor to provide the course id, item id, and part id to identify the specific programming assignment. Instructions on how to find these values can be found in the previous section for the upload command.
Allows an instructional team to update the resource limits (vCPU's, MiB, timeout) allocated to the grader for a given programming assignment. It requires the instructor to provide the course id, item id, and part id to identify the specific programming assignment. Instructions on how to find these values can be found in the previous section for the upload command. In addition, the instructor must provide the values they wish to update by using the parameter flags
If a certain parameter is not provided, then we will simply use the previously existing value. Note that there are restrictions on which combinations of CPU's and memory values are valid. These restrictions can be found in the upload section above.
Makes sure that the instructor is able to communicate with the coursera.org API servers with the correct authentication.
Lists all graders uploaded to the given course.
Gets the upload status of a grader given its executor id. The executor id can be found by using the list_graders command.
Please reach out to your partner support teams to file an enhancement request or report a bug. While we check in on the issues logged on this repository from time to time, reaching out to your partner support teams will likely provide you with a faster response. We appreciate your support and dedication to improving this tool for all Coursera partners!
Note: We do not have the bandwidth to officially support this tool on windows. That said, patches to add / maintain windows support are welcome!
We recommend developing coursera_autograder within a python virtualenv. To get your environment set up properly, do the following:
virtualenv venv source venv/bin/activate python setup.py develop pip install -r test_requirements.txt
To run tests, simply run: nosetests , or tox .
Code should conform to pep8 style requirements. To check, simply run:
pep8 coursera_autograder tests