Skip to content

feat(ai): Implement AI Essay & Assignment Grader - #90

Merged
MistryVishwa merged 2 commits into
MistryVishwa:mainfrom
rach-kanc:feat/essay-grader
Jul 10, 2026
Merged

feat(ai): Implement AI Essay & Assignment Grader#90
MistryVishwa merged 2 commits into
MistryVishwa:mainfrom
rach-kanc:feat/essay-grader

Conversation

@rach-kanc

@rach-kanc rach-kanc commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Description

This Pull Request introduces the AI Essay & Assignment Grader feature, providing students with immediate, structured, and actionable feedback on their writing.

Motivation: Students need a quick way to self-evaluate drafts and assignments before final submission to catch structural flaws and improve their writing quality.
Context:

  • Created a new essay_evaluations table in Supabase with RLS to securely store past submissions and feedback.
  • Implemented a structured prompt in lib/ai.ts using Gemini to return exact JSON matching an EssayFeedback interface (estimated grade, pros, cons, and actionable suggestions with direct quotes).
  • Added a new backend API endpoint that validates the request, consumes user credits, calls the AI, and saves the data.
  • Built a dashboard UI to submit essays (with optional grading rubrics) and a detailed results page to view the feedback.

Related Issue: Closes #79

Type of Change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

Note: This project does not currently have an automated test suite. The following manual verification was performed:

  • Backend/AI: Verified that the AI consistently returns valid JSON matching the strict required schema. Checked that consumeCredit accurately deducts 1 credit per evaluation.
  • Database: Confirmed that RLS policies prevent users from viewing evaluations belonging to other accounts.
  • UI Testing: Verified the form handles loading states properly and the results page renders Strengths, Weaknesses, and Suggestions clearly.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings/lint errors
  • I have checked that my branch is up-to-date with main
  • All tests pass locally with my changes (N/A - no local tests exist)

##Tags
ssoc26, hard

@vercel

vercel Bot commented Jul 9, 2026

Copy link
Copy Markdown

@rach-kanc is attempting to deploy a commit to the vishwamistrylearning-1037's projects Team on Vercel.

A member of the Team first needs to authorize it.

@rach-kanc

Copy link
Copy Markdown
Contributor Author

@MistryVishwa

@MistryVishwa MistryVishwa added enhancement New feature or request good first issue Good for newcomers ssoc26 Main tag identifying the repository for Social Summer of Code 2026 Hard 40 Points labels Jul 10, 2026
@MistryVishwa
MistryVishwa merged commit f555a1d into MistryVishwa:main Jul 10, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request good first issue Good for newcomers Hard 40 Points ssoc26 Main tag identifying the repository for Social Summer of Code 2026

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] AI Essay & Assignment Grader

2 participants