NavyDevilDoc commited on
Commit
1ca6074
·
verified ·
1 Parent(s): 1c2fd03

Update src/core/QuizEngine.py

Browse files
Files changed (1) hide show
  1. src/core/QuizEngine.py +18 -12
src/core/QuizEngine.py CHANGED
@@ -104,18 +104,24 @@ class QuizEngine:
104
  )
105
 
106
  def construct_grading_prompt(self, question, answer, context_text):
107
- return (
108
- f"You are a Board Examiner.\n"
109
- f"Reference Material: '{context_text}'\n\n"
110
- f"Question: {question}\n"
111
- f"Candidate Answer: {answer}\n\n"
112
- f"TASK: Grade the answer based strictly on the Reference Material.\n"
113
- f"1. If the answer is factually correct according to the text, grade PASS.\n"
114
- f"2. If it misses key details mentioned in the text, grade FAIL or PASS with Comments.\n"
115
- f"OUTPUT FORMAT:\n"
116
- f"**GRADE:** [PASS/FAIL]\n"
117
- f"**FEEDBACK:** [Brief correction or confirmation]"
118
- )
 
 
 
 
 
 
119
 
120
  def construct_acronym_grading_prompt(self, term, correct_definition, user_answer):
121
  return (
 
104
  )
105
 
106
  def construct_grading_prompt(self, question, answer, context_text):
107
+ """
108
+ Grades the answer using a composite context (Seed + RAG Results).
109
+ """
110
+ return (
111
+ f"You are a Board Examiner.\n"
112
+ f"Reference Material (Combined Sources):\n"
113
+ f"'''{context_text}'''\n\n"
114
+ f"Question: {question}\n"
115
+ f"Candidate Answer: {answer}\n\n"
116
+ f"TASK: Grade the answer based strictly on the Reference Material above.\n"
117
+ f"1. Search the Reference Material for the correct answer. The answer might be split across the Primary Source and Related Documentation.\n"
118
+ f"2. If the candidate's answer matches the facts found ANYWHERE in the text, grade PASS.\n"
119
+ f"3. If the candidate misses key details that ARE present in the text, grade FAIL or PASS with Comments.\n"
120
+ f"4. If the provided Reference Material does NOT contain the answer (i.e., retrieval failed), be lenient and grade based on general knowledge, but note 'Verified by General Knowledge' in the feedback.\n\n"
121
+ f"OUTPUT FORMAT:\n"
122
+ f"**GRADE:** [PASS/FAIL]\n"
123
+ f"**FEEDBACK:** [Brief correction or confirmation]"
124
+ )
125
 
126
  def construct_acronym_grading_prompt(self, term, correct_definition, user_answer):
127
  return (