Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -263,8 +263,9 @@ class LearningStyleQuiz:
|
|
| 263 |
}
|
| 264 |
}
|
| 265 |
|
| 266 |
-
def evaluate_quiz(self, answers
|
| 267 |
"""Evaluate quiz answers and generate results."""
|
|
|
|
| 268 |
if len(answers) != len(self.questions):
|
| 269 |
raise gr.Error("Not all questions were answered")
|
| 270 |
|
|
@@ -841,7 +842,7 @@ def create_interface():
|
|
| 841 |
)
|
| 842 |
|
| 843 |
quiz_submit.click(
|
| 844 |
-
fn=learning_style_quiz.evaluate_quiz,
|
| 845 |
inputs=quiz_components,
|
| 846 |
outputs=learning_output
|
| 847 |
).then(
|
|
@@ -945,9 +946,7 @@ def create_interface():
|
|
| 945 |
"How can I improve my grades in science?",
|
| 946 |
"What study methods match my learning style?"
|
| 947 |
],
|
| 948 |
-
title=""
|
| 949 |
-
retry_btn=None,
|
| 950 |
-
undo_btn=None
|
| 951 |
)
|
| 952 |
|
| 953 |
# Tab navigation buttons
|
|
|
|
| 263 |
}
|
| 264 |
}
|
| 265 |
|
| 266 |
+
def evaluate_quiz(self, *answers) -> str:
|
| 267 |
"""Evaluate quiz answers and generate results."""
|
| 268 |
+
answers = list(answers) # Convert tuple to list
|
| 269 |
if len(answers) != len(self.questions):
|
| 270 |
raise gr.Error("Not all questions were answered")
|
| 271 |
|
|
|
|
| 842 |
)
|
| 843 |
|
| 844 |
quiz_submit.click(
|
| 845 |
+
fn=lambda *answers: learning_style_quiz.evaluate_quiz(answers),
|
| 846 |
inputs=quiz_components,
|
| 847 |
outputs=learning_output
|
| 848 |
).then(
|
|
|
|
| 946 |
"How can I improve my grades in science?",
|
| 947 |
"What study methods match my learning style?"
|
| 948 |
],
|
| 949 |
+
title=""
|
|
|
|
|
|
|
| 950 |
)
|
| 951 |
|
| 952 |
# Tab navigation buttons
|