Skip to content

Commit 52584de

Browse files
committed
refactor: update question generation logic to use QuestionGenerator and improve output format
1 parent ddd634a commit 52584de

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

app/ai/questionGenerator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def generateQuestions(self, number: int, topic: Topic, ageGroup: str, item: str
4343
f"and ensure there is only 1 correct answer, "
4444
f"include correct answer of multiple choice quiz question."
4545
f"Do not include any quotation marks in the output."
46-
f"Output in the format: "
46+
f"Output each question in the format: "
4747
f"Question:"
4848
f"ChoiceA:"
4949
f"ChoiceB:"
@@ -64,7 +64,7 @@ def generateQuestions(self, number: int, topic: Topic, ageGroup: str, item: str
6464
f"and ensure there is only 1 correct answer, "
6565
f"include correct answer of multiple choice quiz question."
6666
f"Do not include any quotation marks in the output."
67-
f"Output in the format: "
67+
f"Output each question in the format: "
6868
f"Question:"
6969
f"ChoiceA:"
7070
f"ChoiceB:"

main.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
# main.py
2-
from app.ai.questionGenerator import GenAI, Topics
2+
from app.ai.enums.topic import Topic
3+
from app.ai.questionGenerator import QuestionGenerator
34

45
if __name__ == "__main__":
56
# Initialize the question generator
67
print("Loading models")
7-
genAi = GenAI()
8+
genAi = QuestionGenerator()
89

910
# Generate questions
1011
print("Generating questions......")
11-
questions = genAi.generateQuestions(1, Topics.Business, "12-15", None)
12+
questions = genAi.generateQuestions(6, Topic.Business, "12-15", None)
1213
print("Finished generating questions!")
1314

1415
# Write questions to a CSV file

0 commit comments

Comments
 (0)