Skip to content

Grading Script that compiles and runs student submissions, uses the Grader Bot to get the scores, builds comments and uploads them back to the Canvas.

Notifications You must be signed in to change notification settings

devkapupara/Grading-Script-CS46B

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

Grading-Script-CS46B

Grading Script that compiles and runs student submissions, uses the Grader Bot to get the scores, builds comments and uploads them back to the Canvas.

NOTE: This script won't work on Windows due to unavailability of one specific command - unzip -p. You can get it to work on it by removing out the block mentioned in the script. It is safe because it was just a precaution implemented for my section where student were not following instructions and submitting .zip files. If you are sure that your section will always submit .jar files, you can remove it. If you are on a Mac, you should be fine either way.

Instructions:

  1. You need to have python 3.x to run this. I used 3.7 when developing it, so if some error occurs, please update your python setup to 3.7.

  2. The first thing you should do is generate a Token from Canvas. To do this, click on your Account in the top-left corner, choose Settings -> Under Approved Integrations, click on New Token. Give any name you want and leave the expire part empty. Note down the token it generates. You won't be able to copy this token once you close the window. Paste this token in the access_token variable in the script.

  3. Download the submissions from canvas, unzip it and note down its path. If you are on Mac, the easiest way to get the path is to left-click on the folder, press Command-C, open terminal, and press Command-V. It should paste the path of your submission folder.

  4. After copying the path, open up the grading.py file and paste that path in the variable base_dir.

  5. Fire up the terminal, navigate to where you saved the grading script and type the following command: python3 grading.py

  6. The second will ask you if you want to clean up the folder after the script ends, which basically cleans all the extracted folder and .class, .java files. Next one will ask you the package name, which is very essential. Last one will ask you for the class name containing the main function, which will basically be a tester file provided by Dr. Heller to test your code.

  7. Failure to do step 5 and 6 correctly will result in wrong results, possibly errors. I am counting on you so no error checking has been implemented.

  8. It will run and do its job, printing out the names of students as it finds.

  9. Once it finished grabbing id, scores and comments, it will ask you to enter the Assignment number. This is needed to fetch the assignment_id on canvas and upload the grades to the right destination. Please make sure about the number you enter here.

  10. Once it's done uploading, it will print out a confirmation message, and you should be good.

  11. A detailed_grades.txt file will be generated in your submission folder which contains detailed report of each student. It will mention the name of the student, points scored and the comments made for that submission.

Please email me at devkapupara@gmail.com for any clarification about the code or for reporting any bugs.

About

Grading Script that compiles and runs student submissions, uses the Grader Bot to get the scores, builds comments and uploads them back to the Canvas.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages