Quick overview
This workflow watches a Google Drive folder for new PDF submissions, extracts text and grades each assignment with OpenAI using a Google Docs rubric, logs results to Google Sheets, emails feedback via Gmail, and sends a daily summary to the teacher via Gmail and Telegram, with Slack error alerts.
How it works
- Triggers when a new PDF file is created in a specific Google Drive folder.
- Downloads the PDF from Google Drive and sends it to OpenAI to extract the full plain-text content.
- Parses student name, email, assignment title, and course from the filename and fetches the grading rubric from Google Docs.
- Sends the extracted assignment text and rubric to OpenAI to generate a JSON grade, per-criterion scores, and three feedback paragraphs.
- Parses the returned JSON (falling back to default values if parsing fails) and appends a complete record to a Google Sheets Gradebook.
- Sends the student a formatted Gmail message with the grade, score breakdown, and personalised feedback.
- Runs daily at 6 PM to read the Gradebook in Google Sheets, summarize today’s grading results, and sends the summary to the teacher via Gmail and Telegram.
Setup
- Connect credentials for Google Drive, Google Docs, Google Sheets, Gmail, Telegram, and Slack (for error alerts).
- Set the Google Drive folder ID to watch, the Google Docs rubric document URL, and the Google Sheets spreadsheet ID and Gradebook sheet name.
- Update the teacher email address for the daily summary and set your Telegram bot chat ID.
- Replace placeholder values like the rubric document ID in the metadata parsing step and ensure students follow the filename format
[email protected]__Assignment_Title__Course.pdf.