Git Product home page Git Product logo

canvas-code-correction's Introduction

Automated Correction Framework for Applied Programming at Univeristy of Copenhagen

Total Revamp!!!

This repo has been on hiatus for a long time, and since its inception, I have learned A TON. This means that I can finally see how to properly structure this project in an API-oriented way, integrating smoother with Canvas. For now the main branch will be locked for no changes and all development will happen on another branch.


Canvas Submission Correction aims to make it easier for course administrators to automate correction of assignments on a local machine by handling the download, unzipping and uploading of the corrections. What is left is for the user to supply the code needed to correct the assignment. That’s it!

Requirements

A few programs are needed in order for this framework to be functional

  • firejail
  • zip
  • unzip
  • python packages in requirements.txt
  • Install mossum with pip3 install git+https://github.com/hjalti/mossum@master

Setup

The following steps are needed before being able to easily use the framework as intended.

  1. Please setup the assignments on Canvas. This will make
  2. Install the requirements
  3. Run init-config.sh to initialize the config file.
  4. Run setup-assignment-folders.sh to initialize the assignment folders with names taken from Canvas.
  5. Each assignment folder has a folder called “code”. The code to correct the corresponding should be placed in here and a single main.sh should exists that initializes the test(s). The content of the code folder will be copied to each students submission. As such the code to correct has to be designed around this assumption.

Config variables

The variables in the `config.ini` are copied to the folders and can be sourced with `. .config_array` to be used in the `main.sh`. This loads a bash array called `config` to the shell, which can be called like `${config[<section>/<variable name>]}` The naming is exactly like in config, even with spaces if any e.g. retrieving the token `echo “${config[DEFAULT/TOKEN]}”`.

Example usage

Now you should be ready to run stuff!

Primary usage

The primary way to use the whole thing is to call the canvas-code-correction.sh as that does everything from downloading and extracting submissions to assignment folders, run the user provided correction code, zip comments and logs, and lastly upload grades and comments to Canvas.

If no arguments are provided the routine will be run only once, but a series of optional parameters may be passed to enable continuous check of submissions, time between checks and so forth. The documentation is as follows

usage:  canvas-code-correction.sh [...]
operations:
    {-h help}    shows this dialogue
    {-a all}     correct all assignments
    {-d daemon}  keep running until process is closed
    {-n number}  number of times to run the correction
    {-f failed}  correct failed assignment
    {-s skip}    skip checking requirements
    {-t time}    time to run as daemon. Given as HH:MM:SS
    {-v verbose} set verbosity
    {-w wait}    Pause for NUMBER seconds.  SUFFIX may be 's' for seconds (the default),
'm' for minutes, 'h' for hours or 'd' for days.  NUMBER need not be an
integer.  Given two or more arguments, pause for the amount of time
specified by the sum of their values.

Downloading submissions

download_submissions.py handles the downloading of submissions. There is a list of optional arguments which can be used to download submissions with specific states, specific students and so forth. Default is to download ungraded submissions from all assignments.

If you want to download all failed assignments from an assignment called `myAssignment` you call

python download_submissions.py --type failed --assignment myAssignment

The download speed can be increased by enabling parallel, though it might fail as time between calls are not considered (yet).

Manually correct submissions

If you have manually downloaded some assignments, they can be corrected using the process_submissions.sh [assignment name]. Default is correct all locally uncorrected submissions, but specifying the assignment name enabled correction of submission in just that assignment.

Uploading grades

The upload_grades.py finds submission folders with .zip and uploads them to the corresponding submission on Canvas. Moreover you can enable manual inspection before uploading when using optional argument python upload_grades.py --question

Plagiarism-check

plagiarism-check.sh <assignment name> uses moss to calculate the similarity between the local assignments by uploading files with the specified extension from the config.ini file, and lastly create a graph to easily inspect for groups of similarity.

Uploading comments

The upload_comments.py find submission folders which have a <submission name>_points.txt. The config.ini determines whether the actual score or a complete/incomplete is used on Canvas.

Contributing

We warmly welcome contributions from the community. If you’re interested in contributing, here’s how you can help:

  1. Fork the Repository: Start by forking this repository to your own GitHub account. This will create a copy of the repository that you can modify without affecting the original project.
  2. Clone the Repository: After forking, clone the repository to your local machine to start making changes.
  3. Create a New Branch: Always create a new branch for each feature or fix you’re working on. This keeps your changes organized and separated from the main project.
  4. Make Your Changes: Make your changes or additions to the project. Please ensure your code adheres to the existing style to maintain consistency across the project.
  5. Commit Your Changes: Once you’re satisfied with your changes, commit them with a clear and descriptive commit message.
  6. Push to Your Fork: Push your changes to the forked repository on your GitHub account.
  7. Submit a Pull Request: Finally, navigate to the original repository and submit a pull request. In the pull request description, explain your changes and why you believe they should be included in the project.

Before contributing, please read our Code of Conduct. This helps ensure a welcoming and respectful environment for all contributors. If you have any questions or need help with something, feel free to open an issue.

Donations

Maintaining and improving this project requires a significant amount of time and effort. If you find this project useful and want to show your appreciation, you can support us by buying us a cup of coffee!

Your donation will help us keep the project alive and thriving. It will also fuel our late-night coding sessions, which are often powered by caffeine.

To donate, simply click on the “Buy Me a Coffee” button below. Any amount, big or small, is greatly appreciated and will be put to good use.

Buy Me a Coffee

Thank you for your support and for being a part of our community!

canvas-code-correction's People

Contributors

jakob1379 avatar vulpesdk avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.