Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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
|
| 60 |
|
| 61 |
def main(link, difficulty_level):
|
| 62 |
-
questions, options, correct_answers = YtToQuizz(link, difficulty_level)
|
| 63 |
-
return {
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 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=[
|