Ilayda-j commited on
Commit
0875dac
1 Parent(s): 1ae5cb0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
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"],