Grass is a tool created to help support the Virginia Tech Computer Science department to support the investigations of honor code violations within their courses. Grass organizes student submissions, submits large groups of student submissions to MOSS, saves MOSS results, reads in MOSS results to identify potential academic integrity violations, and generates comprehensive reports of similar pairs or groups of students for instructor review.
In this section, you will install Docker which is required for running Grass.
The only things you will need on your machine is:
If you are using a newer version of Docker, Docker Compose is likely already installed. You can confirm that Docker is installed in the command terminal by running docker compose version or by opening Docker Desktop on your computer.
First, you must clone Grass. Here are the terminal instructions below:
git clone https://git.cs.vt.edu/alexthompson06/grass.git
cd grass
Then, we need to set up what local folders we want our student submissions, output, and other folders to live. For more information on the mounts and a recommended mount directory structure, see the mounts wiki page for Grass. Open the .env text file in the root of the repo and rename each of the file locations to places on your machine where your submission directory is, where you want your output to go, etc. For any variables you do not have (historical submissions, online submissions, templates), please fill in a path that leads to a blank folder. All variables need to have a path associated with them in order for compose to properly mount the Docker volumes.
If you would like to run on rlogin or do not have permissions for Docker, install Podman first. For more details on running on rlogin, see the rlogin wiki page for Grass.
pip install podman-compose
Now, we can build the container:
docker compose build
Please note the build step may take a few minutes to create the docker image with the install dependencies.
To run the container, enter in the following command:
docker compose run grass
To use Grass, a config.json file must be configured in the root of the submission directory. Please set up the config.json with the assistance of the config.json wiki page and make sure it is in the root of the submissions directory you had specified in the .env.
You can also set up a progress_config.json but it is not required and only necessary if you want to do one step of the workflow (unzip, send to MOSS, generate reports). A progress_config.json is created in the submissions directory during first time usage. Here is the wiki page for the specifications on progress_config.json.
If you have online submissions you would like to run, please include each online submission in the mount online-subs. Each online submission should be its own folder in the mount with the contents being the submission. Additionally, you can include a metadata.json file in the root of each online submission in order to automatically populate information about the submission in the reports. For details on the online submission metadata file, see the metadata.json wiki page.
Then, enter the following command to run the main workflow:
python ./grass/main.py
Upon a successful run, the folder specified as the output directory in .env will have two subfolders created: moss-output and report-output. moss-output creates a local copy of the MOSS reports generated for each m-value ran. report-output creates a report for each pair or group that was either automatically identified or specified in the config.json.
Creates a course roster (info_csv) by using the Canvas API. This is done through the report_generation/canvas_to_pid.py. Unfortunately, the only way to do this is changing a variable in the python file. TODO: Fix this! :)
Finds code snippets in a submission directory. Typically used for finding things commonly created in generative AI or looking up code snippets from prior semesters.
python grass/modular_scripts/find_sus.py [PathToCodeSnippetConfigFile]
Here is an example of the configuration json needed for code snippet detection:
{
"root_directory": "/home/ugrads/majors/azhang42/academic_integrity/project_submissions/Spring2024_p3", # directory containing all the submissions
"patterns": [
{
"regex": "@Test", # regex to search for in the directory
"label": "@Test" # label of the suspicious code snippet
},
{
"regex": "assertEquals\\(\\s*\".+?\"\\s*,\\s*.+?\\s*,\\s*.+?\\s*\\);",
"label": "assertEquals"
},
{
"regex": "<\\?>",
"label": "<?>"
}
],
"output_files": [
"/home/ugrads/majors/azhang42/academic_integrity/grass/grass/modular_scripts/test_snippets.json", # files to output the regex search results to
"/home/ugrads/majors/azhang42/academic_integrity/grass/grass/modular_scripts/assert_snippets.json",
"/home/ugrads/majors/azhang42/academic_integrity/grass/grass/modular_scripts/generic_snippets.json"
]
}
Visualizes groups of students that have similar submissions
mossum MossURL
More documentation can be found here https://github.com/hjalti/mossum
- Andrew Zhang (azhang42@vt.edu)
- Alexandra Thompson (alexthompson06@vt.edu)