Chad commited on
Commit
2923823
·
1 Parent(s): f598bcc

quizabcdfgdhjhwd

Browse files
Files changed (1) hide show
  1. app.py +9 -6
app.py CHANGED
@@ -63,14 +63,17 @@ def generate_quiz(subject, num_questions, chat_history, language_state):
63
  try:
64
  if language_state == "english":
65
  prompt = f"Generate {num_questions} multiple-choice history questions about {subject}. "
66
- prompt += "For each question, provide the question text, four options labeled A, B, C, and D, "
67
- prompt += "and at the end of all questions, list the correct answers in the format: 'Correct Answers: X, Y, Z, ...'."
68
- prompt += "Try to have one quarter of the correct answers be a, one quarter be b, one quarted be c and one quarted be d"
 
 
69
  else:
70
  prompt = f"Générez {num_questions} questions à choix multiples sur l'histoire de {subject}. "
71
- prompt += "Pour chaque question, fournissez l'énoncé de la question, quatre options étiquetées A, B, C et D, "
72
- prompt += "et à la fin de toutes les questions, listez les bonnes réponses au format : 'Réponses correctes : X, Y, Z, ...'."
73
- prompt += "Essaye d'avoir un quart des bonnes réponses dans la position a, un quart dans la position b, un quart dans la position c et un quart dans la position d"
 
74
 
75
  response = client.chat.completions.create(
76
  model="llama3-70b-8192",
 
63
  try:
64
  if language_state == "english":
65
  prompt = f"Generate {num_questions} multiple-choice history questions about {subject}. "
66
+ prompt += "For each question, provide the question text, four options labeled A, B, C, and D. "
67
+ prompt += "At the end of all questions, list the correct answers in the format: 'Correct Answers: X, Y, Z, ...'. "
68
+ prompt += "Ensure that the correct answers are evenly distributed among A, B, C, and D. For example, if there are 12 questions, there should be roughly 3 correct answers for each letter. "
69
+ prompt += "Randomize their order so that they are not in a repeating pattern, but still evenly spread (e.g., B, A, C, C, A, B, D, D, B, A, D, C)."
70
+
71
  else:
72
  prompt = f"Générez {num_questions} questions à choix multiples sur l'histoire de {subject}. "
73
+ prompt += "Pour chaque question, fournissez l'énoncé de la question, quatre options étiquetées A, B, C et D. "
74
+ prompt += "À la fin de toutes les questions, listez les bonnes réponses au format : 'Réponses correctes : X, Y, Z, ...'. "
75
+ prompt += "Assurez-vous que les bonnes réponses sont réparties uniformément entre A, B, C et D. Par exemple, s'il y a 12 questions, il devrait y avoir environ 3 bonnes réponses pour chaque lettre. "
76
+ prompt += "Mélangez l'ordre de ces réponses pour éviter les modèles répétitifs, tout en maintenant une répartition équilibrée (par ex., B, A, C, C, A, B, D, D, B, A, D, C)."
77
 
78
  response = client.chat.completions.create(
79
  model="llama3-70b-8192",