Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -28,9 +28,9 @@ def interactive_quiz(file, answer=None, continue_quiz='yes'):
|
|
28 |
return "Please upload a txt file to start.", "", "hidden"
|
29 |
|
30 |
text_content = file.read().decode("utf-8")
|
31 |
-
|
|
|
32 |
if continue_quiz.lower() == 'yes':
|
33 |
-
question = generate_question(text_content)
|
34 |
if answer is not None:
|
35 |
is_correct = check_answer(question, answer, text_content)
|
36 |
feedback = "Correct!" if is_correct else "Incorrect."
|
@@ -40,6 +40,7 @@ def interactive_quiz(file, answer=None, continue_quiz='yes'):
|
|
40 |
else:
|
41 |
return "Thank you for participating!", "", "hidden"
|
42 |
|
|
|
43 |
iface = gr.Interface(
|
44 |
fn=interactive_quiz,
|
45 |
inputs=["file", "text", "text"],
|
|
|
28 |
return "Please upload a txt file to start.", "", "hidden"
|
29 |
|
30 |
text_content = file.read().decode("utf-8")
|
31 |
+
question = generate_question(text_content)
|
32 |
+
|
33 |
if continue_quiz.lower() == 'yes':
|
|
|
34 |
if answer is not None:
|
35 |
is_correct = check_answer(question, answer, text_content)
|
36 |
feedback = "Correct!" if is_correct else "Incorrect."
|
|
|
40 |
else:
|
41 |
return "Thank you for participating!", "", "hidden"
|
42 |
|
43 |
+
|
44 |
iface = gr.Interface(
|
45 |
fn=interactive_quiz,
|
46 |
inputs=["file", "text", "text"],
|