Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -68,11 +68,14 @@ style_count_map = {
|
|
68 |
2: 'reading/writing'
|
69 |
}
|
70 |
|
71 |
-
# Quiz logic to analyze learning style
|
72 |
def learning_style_quiz(*answers):
|
73 |
scores = {'visual': 0, 'auditory': 0, 'reading/writing': 0}
|
74 |
-
for ans in answers:
|
75 |
-
|
|
|
|
|
|
|
|
|
76 |
best = max(scores, key=scores.get)
|
77 |
return best.capitalize()
|
78 |
|
@@ -218,6 +221,4 @@ with gr.Blocks() as demo:
|
|
218 |
outputs=[output])
|
219 |
|
220 |
if __name__ == '__main__':
|
221 |
-
demo.launch()
|
222 |
-
|
223 |
-
|
|
|
68 |
2: 'reading/writing'
|
69 |
}
|
70 |
|
|
|
71 |
def learning_style_quiz(*answers):
|
72 |
scores = {'visual': 0, 'auditory': 0, 'reading/writing': 0}
|
73 |
+
for i, ans in enumerate(answers):
|
74 |
+
if i < len(learning_style_answers):
|
75 |
+
options = learning_style_answers[i]
|
76 |
+
if ans in options:
|
77 |
+
style = style_count_map[options.index(ans)]
|
78 |
+
scores[style] += 1
|
79 |
best = max(scores, key=scores.get)
|
80 |
return best.capitalize()
|
81 |
|
|
|
221 |
outputs=[output])
|
222 |
|
223 |
if __name__ == '__main__':
|
224 |
+
demo.launch()
|
|
|
|