Dannyar608 commited on
Commit
44a2ea1
·
verified ·
1 Parent(s): 64fb9b0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -6
app.py CHANGED
@@ -62,7 +62,6 @@ learning_style_answers = [
62
  ["Remember faces", "Remember names or voices", "Remember what you wrote about them"]
63
  ]
64
 
65
- # Map answer positions to learning styles
66
  style_count_map = {0: "visual", 1: "auditory", 2: "reading/writing"}
67
 
68
  def learning_style_quiz(*answers):
@@ -75,8 +74,7 @@ def learning_style_quiz(*answers):
75
  index = options.index(ans)
76
  style = style_count_map[index]
77
  scores[style] += 1
78
-
79
- # Determine all learning styles that are tied for highest score
80
  max_score = max(scores.values())
81
  best_styles = [style.capitalize() for style, score in scores.items() if score == max_score]
82
 
@@ -130,7 +128,7 @@ def generate_learning_plan(info):
130
  def generate_learning_style_summary(style):
131
  return f"""
132
  🧠 **Learning Style Summary**
133
- You are a **{style}** learner. That means you learn best through {"visual aids like charts and images" if style == "Visual" else "listening and verbal instruction" if style == "Auditory" else "reading and writing-based methods"}.
134
  """
135
 
136
  def generate_motivation_section(responses):
@@ -201,7 +199,7 @@ with gr.Blocks() as demo:
201
  quiz_components = []
202
  for i, (question, options) in enumerate(zip(learning_style_questions, learning_style_answers)):
203
  quiz_components.append(gr.Radio(
204
- choices=["visual", "auditory", "reading/writing"],
205
  label=f"{i+1}. {question}"
206
  ))
207
 
@@ -224,4 +222,8 @@ with gr.Blocks() as demo:
224
  outputs=[output])
225
 
226
  if __name__ == '__main__':
227
- demo.launch()
 
 
 
 
 
62
  ["Remember faces", "Remember names or voices", "Remember what you wrote about them"]
63
  ]
64
 
 
65
  style_count_map = {0: "visual", 1: "auditory", 2: "reading/writing"}
66
 
67
  def learning_style_quiz(*answers):
 
74
  index = options.index(ans)
75
  style = style_count_map[index]
76
  scores[style] += 1
77
+
 
78
  max_score = max(scores.values())
79
  best_styles = [style.capitalize() for style, score in scores.items() if score == max_score]
80
 
 
128
  def generate_learning_style_summary(style):
129
  return f"""
130
  🧠 **Learning Style Summary**
131
+ You are a **{style}** learner. That means you learn best through {"visual aids like charts and images" if "Visual" in style else "listening and verbal instruction" if "Auditory" in style else "reading and writing-based methods"}.
132
  """
133
 
134
  def generate_motivation_section(responses):
 
199
  quiz_components = []
200
  for i, (question, options) in enumerate(zip(learning_style_questions, learning_style_answers)):
201
  quiz_components.append(gr.Radio(
202
+ choices=options,
203
  label=f"{i+1}. {question}"
204
  ))
205
 
 
222
  outputs=[output])
223
 
224
  if __name__ == '__main__':
225
+ demo.launch()
226
+
227
+
228
+
229
+