Rehman1603 commited on
Commit
b0278fb
·
verified ·
1 Parent(s): 06e461d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -12
app.py CHANGED
@@ -51,21 +51,21 @@ def YtToQuizz(link, difficulty_level):
51
  response_text = response['text']
52
 
53
  # Extract MCQs, correct answers, and options
54
- questions = re.findall(r'Question: (.*?)\n', response_text)
55
- correct_answers = re.findall(r'Correct answer: (.*?)\n', response_text)
56
- options = re.findall(r'Options: (.*?)\n', response_text)
57
- all_options = [option.split(', ') for option in options]
58
 
59
- return questions, all_options, correct_answers
60
 
61
  def main(link, difficulty_level):
62
- questions, options, correct_answers = YtToQuizz(link, difficulty_level)
63
- return {
64
- "Questions": questions,
65
- "Options": options,
66
- "Correct Answers": correct_answers
67
- }
68
-
69
  iface = gr.Interface(
70
  fn=main,
71
  inputs=[
 
51
  response_text = response['text']
52
 
53
  # Extract MCQs, correct answers, and options
54
+ #questions = re.findall(r'Question: (.*?)\n', response_text)
55
+ #correct_answers = re.findall(r'Correct answer: (.*?)\n', response_text)
56
+ #options = re.findall(r'Options: (.*?)\n', response_text)
57
+ #all_options = [option.split(', ') for option in options]
58
 
59
+ return response_text
60
 
61
  def main(link, difficulty_level):
62
+ #questions, options, correct_answers = YtToQuizz(link, difficulty_level)
63
+ # return {
64
+ # "Questions": questions,
65
+ # "Options": options,
66
+ # "Correct Answers": correct_answers
67
+ # }
68
+ return YtToQuizz(link, difficulty_level)
69
  iface = gr.Interface(
70
  fn=main,
71
  inputs=[