mohammed3536 commited on
Commit
af671a2
·
verified ·
1 Parent(s): 15bb706

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -78,17 +78,18 @@ def generate_question_with_chatgpt(context, topic):
78
  if 'message' in choice and isinstance(choice['message'], dict):
79
  message = choice['message']
80
  content = message.get('content')
81
-
82
  if content:
83
  options = message.get('options', [])
84
  correct_answer = message.get('correct_answer', "Unknown")
85
 
86
  generated_question['content'] = content
87
- generated_question['options'] = options
88
  generated_question['correct_answer'] = correct_answer
89
 
90
  return generated_question
91
 
 
92
  def main():
93
  # Title of the Application
94
  st.header("🤖CB Quiz Generator🧠", divider='rainbow')
 
78
  if 'message' in choice and isinstance(choice['message'], dict):
79
  message = choice['message']
80
  content = message.get('content')
81
+
82
  if content:
83
  options = message.get('options', [])
84
  correct_answer = message.get('correct_answer', "Unknown")
85
 
86
  generated_question['content'] = content
87
+ generated_question['options'] = options if isinstance(options, list) else []
88
  generated_question['correct_answer'] = correct_answer
89
 
90
  return generated_question
91
 
92
+
93
  def main():
94
  # Title of the Application
95
  st.header("🤖CB Quiz Generator🧠", divider='rainbow')