Skip to content

Fix quiz feedback: re-retrieve sources for grading and validate feedback structure - #132

Open
jshuao wants to merge 1 commit into
georgia-tech-db:mainfrom
jshuao:quiz-mode-fix
Open

Fix quiz feedback: re-retrieve sources for grading and validate feedback structure#132
jshuao wants to merge 1 commit into
georgia-tech-db:mainfrom
jshuao:quiz-mode-fix

Conversation

@jshuao

@jshuao jshuao commented Aug 5, 2026

Copy link
Copy Markdown

Quiz feedback was often vague or incomplete because the source chunks were selected randomly for each question and then reused unchanged all the way through grading, with no re-retrieval based on the actual question or the student's answer.

Fixes this issue by implementing the FAISS similarity index that is used for regular chat, re-retrieving sources using the question and the answer. If this fails then it falls back to the original sources. validateQuizFeedback() also added to check that the feedback follows the correct format, and gets corrected before reaching the user if it is in the incorrect format.

Comment thread src/renderer/src/App.tsx

try {
const retrievedSources = quizState.currentSources
const feedbackQuery = `${quizState.currentQuestion}\n${answer}`

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since feedbackQuery combines the question with the full student answer, a long or vocabulary-rich incorrect answer may dominate the retrieval query and shift the retrieved chunks away from the question’s topic. This could cause grading to use irrelevant evidence. Would it be safer to retrieve primarily using the question, or preserve/merge quizState.currentSources rather than replacing them entirely?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants