{"id":24618282,"url":"https://github.com/ryanlinjui/cpgrader","last_synced_at":"2025-05-07T06:23:54.697Z","repository":{"id":237284551,"uuid":"793726662","full_name":"ryanlinjui/cpGrader","owner":"ryanlinjui","description":"A Python package that automatically grades programming assignments.","archived":false,"fork":false,"pushed_at":"2025-03-03T15:59:48.000Z","size":28423,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-01T12:05:36.164Z","etag":null,"topics":["automation","grader","module","package","programming-assignments"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ryanlinjui.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-29T18:50:20.000Z","updated_at":"2025-04-25T07:24:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"48b7e150-7d4c-491b-b43e-9c2f75087d42","html_url":"https://github.com/ryanlinjui/cpGrader","commit_stats":null,"previous_names":["ryanlinjui/cpgrader"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanlinjui%2FcpGrader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanlinjui%2FcpGrader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanlinjui%2FcpGrader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanlinjui%2FcpGrader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ryanlinjui","download_url":"https://codeload.github.com/ryanlinjui/cpGrader/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252825572,"owners_count":21809947,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automation","grader","module","package","programming-assignments"],"created_at":"2025-01-24T23:51:30.004Z","updated_at":"2025-05-07T06:23:54.653Z","avatar_url":"https://github.com/ryanlinjui.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cpGrader: A Python Package to Grade Programming Assignments Automatically\n\n\u003cdiv align=\"left\"\u003e\n\n[![Test](https://github.com/ryanlinjui/cpGrader/actions/workflows/tests.yml/badge.svg?branch=main\u0026event=push)](https://github.com/ryanlinjui/cpGrader/actions?query=event%3Apush+branch%3Amain)\n[![PyPI](https://img.shields.io/pypi/v/cpGrader.svg)](https://pypi.org/project/cpGrader)\n[![python-version](https://img.shields.io/pypi/pyversions/cpGrader.svg)](https://pypi.org/project/cpGrader)\n\n\u003c/div\u003e\n\n\u003e cpGrader is designed to be used with the course [\"NTNU CSIE Computer Programming I/II\"](https://sites.google.com/gapps.ntnu.edu.tw/neokent/teaching) by instructor [neokent (紀博文 Po-Wen Chi)](https://sites.google.com/gapps.ntnu.edu.tw/neokent/about-me).\n\n## Thanks for your Contribution 🌟\n\n\u003cdiv align=\"left\"\u003e\n\n[![41247001S-盧昱安](https://img.shields.io/badge/41247001S-盧昱安-important)](https://github.com/NaoCoding)\n![41247012S-吳振榮](https://img.shields.io/badge/41247012S-吳振榮-important)\n![41247024S-廖妤恩](https://img.shields.io/badge/41247024S-廖妤恩-important)\n![41247032S-吳俊廷](https://img.shields.io/badge/41247032S-吳俊廷-important)\n[![41247039S-韓欣劭](https://img.shields.io/badge/41247039S-韓欣劭-important)](https://github.com/mrfish233)\n![41247057S-陳育渝](https://img.shields.io/badge/41247057S-陳育渝-important)\n\n\u003c/div\u003e\n\n\n## Installation\n\n```bash\npip install cpGrader\n```\n\n# How does it works?\n\n![assets](https://github.com/ryanlinjui/cpGrader/assets/57468611/da57e04c-316b-46ce-a400-0cad8c00ff17)\n\n### Stage (You can enable/disable the stage)\n- `Extract`: Get all the students's source file from moodle submission folder.\n- `Build`: Copy the support files to the student's folder and Compile the student's program.\n- `Execute`: Run the student's program by the testcase and Generate output file by each testcase.\n- `Verify`: Compare the student's output with the correct plaintext output or the correct program's output.\n\n### Step\n1. Download all the student submissions from [Moodle](https://moodle3.ntnu.edu.tw).\n2. Think about the testcases and strategies that how to grade the student's assignment.\n3. Write a config file.\n4. Design the verify function.\n5. Run your grader.\n\n# Getting Started\n\n## TOML Config File\n\n- `global`: the global settings (Field below is just for global).\n    - `support [list]`: the files copied to the student's folder.\n- `case`: the testcase settings (Each case can be independent).\n    - `name [string]`: name of testcase.\n    - `file [string]`: filepath of testcase file.\n    - `pts [float | int]`: grading points.\n    - `correct [string]`: the correct file which is program file (`.c`, `.py`) or plain text file (`.txt`, `.out`).\n    - `command [string]`: the command to run student's program.\n\n## Basic Example\n\n### Config File\n```toml\n[global]\nsupport = [\"input.bmp\", \"assignment.h\"]\ncorrect = \"./correct.c\"\ncommand = \"./assignment\"\n\n[[case]]\nname = \"case1\"\nfile = \"./testcase/1.in\"\npts = 5\n\n[[case]]\nname = \"case2\"\nfile = \"./testcase/2.in\"\npts = 10\n```\n\n### Python Code\n```python\nfrom cpGrader import Grader\n\ngrader = Grader()\n\n@grader.setcase()\ndef verify(case_name: str, student_output: str, correct_output: str):\n    assert student_output == correct_output\n\ngrader.run(\n    moodle_submission_dir=\"/path/to/submissions_dir\"\n)\n```\n\n\u003e GO AND SEE MORE REAL [EXAMPLES HERE](./examples).\n\n# Pytest Testing\n\n### Run All Examples Test\n```bash\npytest\n```\n\n### Choose the Test to Run (Wildcard)\n```bash\npytest -k 2023-cp1-hw01\n```\n\n### Details and Muti-Threading\n```bash\npytest -vs -n auto\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryanlinjui%2Fcpgrader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fryanlinjui%2Fcpgrader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryanlinjui%2Fcpgrader/lists"}