{"id":18831538,"url":"https://github.com/ucbds-infra/ottr-sample","last_synced_at":"2025-04-14T04:16:31.015Z","repository":{"id":41132995,"uuid":"283109318","full_name":"ucbds-infra/ottr-sample","owner":"ucbds-infra","description":"Examples for R autograder ottr","archived":false,"fork":false,"pushed_at":"2024-02-20T06:38:52.000Z","size":372,"stargazers_count":8,"open_issues_count":1,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-14T04:16:25.448Z","etag":null,"topics":["autograder","jupyter-notebook","r","rmd"],"latest_commit_sha":null,"homepage":"https://otter-grader.readthedocs.io","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ucbds-infra.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-07-28T05:27:53.000Z","updated_at":"2024-06-13T20:43:46.000Z","dependencies_parsed_at":"2023-02-09T20:31:17.594Z","dependency_job_id":null,"html_url":"https://github.com/ucbds-infra/ottr-sample","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ucbds-infra%2Fottr-sample","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ucbds-infra%2Fottr-sample/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ucbds-infra%2Fottr-sample/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ucbds-infra%2Fottr-sample/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ucbds-infra","download_url":"https://codeload.github.com/ucbds-infra/ottr-sample/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248819410,"owners_count":21166477,"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":["autograder","jupyter-notebook","r","rmd"],"created_at":"2024-11-08T01:55:05.282Z","updated_at":"2025-04-14T04:16:30.984Z","avatar_url":"https://github.com/ucbds-infra.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ottr Sample Repo\n\nThis repository contains three example assignments to demonstrate how to use [Otter-Grader](https://github.com/ucbds-infra/otter-grader)'s R autograder ottr. This repo contains a master notebook and Rmd file for the same assignment. The workflow for each assignment is the same.\n\n## Installation\n\nTo use ottr, you need to install the package using `devtools::install_github`:\n\n```r\ndevtools::install_github(\"ucbds-infra/ottr@stable\")\n```\n\nThis will install the most recent stable release of ottr.\n\nTo create the grading configurations for Gradescope, you will need the Python package for Otter installed.\n\n```console\npip install otter-grader\n```\n\n## Using Ottr with Otter Assign\n\n### R Jupyter Notebooks\n\nOtter Assign is compatible with creating R Jupyter notebooks. The format is very similar to the regular assign format, and an example notebook is provided in `hw01.ipynb`.\n\nTo use Otter Assign, run\n\n```console\notter assign hw01.ipynb dist\n```\n\nAll configurations are taken care of in the assignment configuration in the notebook. We don't need to specify the `-l r` flag because Otter Assign will use the kernel information in the notebook to auto-detect the language of the assignment.\n\nLook through the files in the new `dist` directory. Otter Assign was also configured to generate an autograder configuration zip file, so you can also check that that works by grading the solutions notebook [locally](https://otter-grader.readthedocs.io/en/latest/workflow/executing_submissions/otter_grade.html) or on Gradescope.\n\nYou can find more information about the Otter Assign format for notebooks (both Python and R) [here](https://otter-grader.readthedocs.io/en/latest/otter_assign/notebook_format.html).\n\n### Rmd Documents\n\nOtter Assign is compatible with Rmd files as well. The `hw01.Rmd` file contains the same assignment as `hw01.ipynb` but as an Rmd document. Using Otter Assign with Rmd files is the same as normal Otter Assign:\n\n```console\notter assign hw01.Rmd dist\n```\n\nTake a look at the Rmd file to see what the format is like. Solution removal behaviors are the same as Otter Assign for Juptyer Notebooks as is the question metadata format.\n\nYou can find more information about the Otter Assign formats for R markdown [here](https://otter-grader.readthedocs.io/en/latest/otter_assign/rmd_format.html).\n\n## Running the Assignments\n\nAfter running Otter Assign, you'll end up with two versions of the notebook: one with solutions and one without solutions. You can play around with executing these and changing the code in each to see how the tests pass and fail.\n\n## Using Ottr for Other Assignments\n\nTo use ottr for your own assignments, you'll want to start by writing an assignment and test files like those found in the `dist/*` directories. Use the `ottr::check` function to run your test case files against the current R environment:\n\n```r\n. = ottr::check(\"relative/path/to/test/file\")\n```\n\nThe fact that the path is relative is **important** because the working directory when grading will be the directory containing the student's submission. Therefore, **all paths in the assignment should be relative to the directory containing the assignment file**.\n\nTest cases rely on error throwing. If a test case throws an error, it fails; if it throws no errors, it passes.\n\nYou can find more information about the R test file format [here](https://otter-grader.readthedocs.io/en/latest/test_files/r_format.html).\n\nOnce you have these components, you can use Otter Assign to generate your result directories, or just use [Otter Generate](https://otter-grader.readthedocs.io/en/latest/workflow/otter_generate/index.html) to create a zip file you can use to grade assignments.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fucbds-infra%2Fottr-sample","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fucbds-infra%2Fottr-sample","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fucbds-infra%2Fottr-sample/lists"}