AutoGrader: A Notebook for Automatic Grading of Moodle Assignments with Azure OpenAI
moodle_word_pdf.ipynb notebook can grade students’ assignments automatically by downloading them from Moodle LMS. It will unzip the assignment file from Moodle and create a folder for each student. If a student submits a zip file, it will also unzip it in their folder. The folder should contain either some Docx files or one PDF file. For Docx files, the notebook will extract and merge all the texts into one answer. For PDF files, it will only extract the text from the first page as the answer.
The notebook will then use a marking scheme as prompts and let Azure OpenAI ChatGPT evaluate the answer according to the rules. It will also estimate the probability that the answer is copied from the internet or generated by AI.
The notebook will use Azure OpenAI text-embedding-ada-002 to get the embedding of the answer. It will then use K-means clustering to group the answers based on their embeddings and show the teachers the different types of answers. It will also perform PCA on the embeddings and plot the first three principal components in 3D. This will help the teachers see how similar or different the answers are.
- Make a copy of this repository and create a new Codespace.
- Save your assignment from Moodle as submission.zip
- Move it to the “data” folder.
- Change the name of .env.template to .env.
- Enter your Azure OpenAI Endpoint and API key.
- Execute the entire notebook.
- Download final.xlsx.