Spaces:
Sleeping
Sleeping
Update src/core/QuizEngine.py
Browse files- 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 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 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 (
|