Dannyar608 commited on
Commit
8a19c8a
·
verified ·
1 Parent(s): 595772e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -6
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
- scores[ans] += 1
 
 
 
 
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()