maria355 commited on
Commit
d0e3fb3
·
verified ·
1 Parent(s): 16185d2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -16
app.py CHANGED
@@ -269,7 +269,6 @@ PROJECT_IDEAS = {
269
  "Object Detection Application"
270
  ]
271
  }
272
-
273
  # User session data store
274
  SESSION_DATA = {}
275
 
@@ -287,8 +286,8 @@ def load_session(session_id):
287
  """Load session data from SESSION_DATA global dictionary"""
288
  return SESSION_DATA.get(session_id, {})
289
 
290
- def recommend_learning_path(age, goals, knowledge_level, interests, learning_style):
291
- """Recommend personalized learning paths based on user profile including learning style"""
292
  paths = []
293
 
294
  # Simple recommendation logic based on profile
@@ -309,19 +308,7 @@ def recommend_learning_path(age, goals, knowledge_level, interests, learning_sty
309
  if not paths:
310
  paths = ["python_beginner"]
311
 
312
- # Get learning paths and add style-specific resources
313
- result_paths = []
314
- for path_id in paths:
315
- if path_id in LEARNING_PATHS:
316
- path_copy = LEARNING_PATHS[path_id].copy()
317
- # Add learning style specific resources
318
- if "resources" in path_copy and learning_style in path_copy["resources"]:
319
- path_copy["style_resources"] = path_copy["resources"][learning_style]
320
- else:
321
- path_copy["style_resources"] = path_copy.get("resources", {}).get("Combination", [])
322
- result_paths.append(path_copy)
323
-
324
- return result_paths
325
 
326
  def get_recommended_resources(interests):
327
  """Get recommended learning resources based on interests"""
 
269
  "Object Detection Application"
270
  ]
271
  }
 
272
  # User session data store
273
  SESSION_DATA = {}
274
 
 
286
  """Load session data from SESSION_DATA global dictionary"""
287
  return SESSION_DATA.get(session_id, {})
288
 
289
+ def recommend_learning_path(age, goals, knowledge_level, interests):
290
+ """Recommend personalized learning paths based on user profile"""
291
  paths = []
292
 
293
  # Simple recommendation logic based on profile
 
308
  if not paths:
309
  paths = ["python_beginner"]
310
 
311
+ return [LEARNING_PATHS[path] for path in paths if path in LEARNING_PATHS]
 
 
 
 
 
 
 
 
 
 
 
 
312
 
313
  def get_recommended_resources(interests):
314
  """Get recommended learning resources based on interests"""