bparrino commited on
Commit
88b363c
Β·
verified Β·
1 Parent(s): d94586e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +97 -18
app.py CHANGED
@@ -127,7 +127,8 @@ TRAINING_FORMATS = {
127
  "engagement": "High",
128
  "scalability": "High",
129
  "interaction": "Low",
130
- "sample_link": "https://youtu.be/HPUWGE9B_UQ?si=a4vr6BL43eMCR9Th"
 
131
  },
132
  "powerpoint_presentations": {
133
  "name": "PowerPoint Presentations",
@@ -138,7 +139,8 @@ TRAINING_FORMATS = {
138
  "engagement": "Low",
139
  "scalability": "High",
140
  "interaction": "Low",
141
- "sample_link": "https://motivace.sharepoint.com/sites/FileStorage/Shared%20Documents/CreativeSP/Other-Clients/NewClient_Samples/PPT_Samples/202312PD-CoreUltra.pdf"
 
142
  },
143
  "microlearning_modules": {
144
  "name": "Microlearning Modules",
@@ -149,7 +151,8 @@ TRAINING_FORMATS = {
149
  "engagement": "Medium",
150
  "scalability": "Very High",
151
  "interaction": "Medium",
152
- "sample_link": "http://www.motechhq.com/contentdemos"
 
153
  },
154
  "elearning_courses": {
155
  "name": "E-Learning Courses",
@@ -160,7 +163,8 @@ TRAINING_FORMATS = {
160
  "engagement": "Medium",
161
  "scalability": "Very High",
162
  "interaction": "Medium",
163
- "sample_link": "http://www.motechhq.com/contentdemos"
 
164
  },
165
  "simulation_training": {
166
  "name": "Simulation Training",
@@ -170,7 +174,8 @@ TRAINING_FORMATS = {
170
  "production_time": "Very High",
171
  "engagement": "Very High",
172
  "scalability": "Medium",
173
- "interaction": "Very High"
 
174
  },
175
  "gamified_learning": {
176
  "name": "Gamified Learning",
@@ -180,7 +185,8 @@ TRAINING_FORMATS = {
180
  "production_time": "High",
181
  "engagement": "Very High",
182
  "scalability": "High",
183
- "interaction": "High"
 
184
  },
185
  "mobile_learning": {
186
  "name": "Mobile Learning",
@@ -191,7 +197,8 @@ TRAINING_FORMATS = {
191
  "engagement": "Medium",
192
  "scalability": "Very High",
193
  "interaction": "Medium",
194
- "sample_link": "http://www.motechhq.com/contentdemos"
 
195
  },
196
  "blended_learning": {
197
  "name": "Blended Learning",
@@ -201,7 +208,8 @@ TRAINING_FORMATS = {
201
  "production_time": "High",
202
  "engagement": "High",
203
  "scalability": "Medium",
204
- "interaction": "High"
 
205
  },
206
  "webinar_series": {
207
  "name": "Webinar Series",
@@ -211,7 +219,8 @@ TRAINING_FORMATS = {
211
  "production_time": "Low",
212
  "engagement": "Medium",
213
  "scalability": "Very High",
214
- "interaction": "Medium"
 
215
  },
216
  "pdf_guides": {
217
  "name": "PDF Guides & Manuals",
@@ -222,12 +231,13 @@ TRAINING_FORMATS = {
222
  "engagement": "Low",
223
  "scalability": "Very High",
224
  "interaction": "Very Low",
225
- "sample_link": "https://www.motechhq.com/contentdemos/BunzleBrochure_SinglePg_Digital_Abbreviated.pdf"
 
226
  }
227
  }
228
 
229
  # Scoring algorithm
230
- def calculate_format_scores(audience_type, budget, objectives, goals, timeline, interaction_level):
231
  scores = {}
232
 
233
  for format_id, format_data in TRAINING_FORMATS.items():
@@ -254,6 +264,17 @@ def calculate_format_scores(audience_type, budget, objectives, goals, timeline,
254
  else:
255
  score -= (format_production - user_timeline) * 5
256
 
 
 
 
 
 
 
 
 
 
 
 
257
  # Audience type matching
258
  audience_matches = {
259
  "Corporate employees": ["elearning_courses", "webinar_series", "blended_learning", "mobile_learning", "powerpoint_presentations"],
@@ -329,7 +350,7 @@ with col1:
329
  "External customers",
330
  "Field workers"
331
  ],
332
- help="Select the primary audience for your training content"
333
  )
334
 
335
  # Budget
@@ -340,6 +361,19 @@ with col1:
340
  help="Consider development, production, and deployment costs"
341
  )
342
 
 
 
 
 
 
 
 
 
 
 
 
 
 
343
  # Timeline
344
  timeline = st.selectbox(
345
  "When do you need this deployed?",
@@ -365,7 +399,7 @@ with col1:
365
  "Behavior change",
366
  "Knowledge sharing"
367
  ],
368
- help="Select all that apply (you can choose multiple)"
369
  )
370
 
371
  # Goals
@@ -379,7 +413,7 @@ with col1:
379
  "Better retention",
380
  "Measurable results"
381
  ],
382
- help="What outcomes are most important to you?"
383
  )
384
 
385
  # Interaction Level
@@ -456,7 +490,7 @@ with col2:
456
 
457
  # Calculate scores
458
  scores = calculate_format_scores(
459
- audience_type, budget, objectives, goals, timeline, interaction_level
460
  )
461
 
462
  # Sort by score
@@ -472,6 +506,7 @@ with col2:
472
  "objectives": objectives,
473
  "goals": goals,
474
  "interaction": interaction_level,
 
475
  "context": additional_context
476
  }
477
  }
@@ -483,8 +518,11 @@ with col2:
483
 
484
  st.markdown('<div class="results-container">', unsafe_allow_html=True)
485
 
486
- # Show top 5 recommendations
487
- for i, (format_id, score) in enumerate(recommendations["formats"][:5]):
 
 
 
488
  format_data = TRAINING_FORMATS[format_id]
489
 
490
  st.markdown(f'<div class="format-card">', unsafe_allow_html=True)
@@ -496,6 +534,10 @@ with col2:
496
  st.markdown(f'<a href="{format_data["sample_link"]}" target="_blank" style="color: #1f77b4; text-decoration: none;">πŸ”— View Sample</a>', unsafe_allow_html=True)
497
  st.markdown("<br>", unsafe_allow_html=True)
498
 
 
 
 
 
499
  # Show key details
500
  st.markdown(f"""
501
  <div class="format-details">
@@ -506,8 +548,38 @@ with col2:
506
  </div>
507
  """, unsafe_allow_html=True)
508
 
 
 
 
 
 
 
 
 
 
509
  st.markdown('</div>', unsafe_allow_html=True)
510
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
511
  st.markdown('</div>', unsafe_allow_html=True)
512
 
513
  # Show analysis summary
@@ -516,6 +588,7 @@ with col2:
516
  st.write(f"- **Audience:** {recommendations['params']['audience']}")
517
  st.write(f"- **Budget:** {recommendations['params']['budget']}")
518
  st.write(f"- **Timeline:** {recommendations['params']['timeline']}")
 
519
  st.write(f"- **Objectives:** {', '.join(recommendations['params']['objectives'])}")
520
  st.write(f"- **Goals:** {', '.join(recommendations['params']['goals'])}")
521
  st.write(f"- **Interaction Level:** {recommendations['params']['interaction']}")
@@ -523,7 +596,7 @@ with col2:
523
  st.write(f"- **Additional Context:** {recommendations['params']['context']}")
524
 
525
  # Action buttons
526
- col_b1, col_b2 = st.columns(2)
527
 
528
  with col_b1:
529
  # Generate report
@@ -543,6 +616,12 @@ with col2:
543
  )
544
 
545
  with col_b2:
 
 
 
 
 
 
546
  # New analysis button
547
  if st.button("πŸ”„ New Analysis", use_container_width=True):
548
  st.session_state["recommendations"] = None
 
127
  "engagement": "High",
128
  "scalability": "High",
129
  "interaction": "Low",
130
+ "sample_link": "https://youtu.be/HPUWGE9B_UQ?si=a4vr6BL43eMCR9Th",
131
+ "roi_metrics": "85% knowledge retention, 60% faster skill acquisition"
132
  },
133
  "powerpoint_presentations": {
134
  "name": "PowerPoint Presentations",
 
139
  "engagement": "Low",
140
  "scalability": "High",
141
  "interaction": "Low",
142
+ "sample_link": "https://motivace.sharepoint.com/sites/FileStorage/Shared%20Documents/CreativeSP/Other-Clients/NewClient_Samples/PPT_Samples/202312PD-CoreUltra.pdf",
143
+ "roi_metrics": "Quick deployment, 70% cost savings vs. live training"
144
  },
145
  "microlearning_modules": {
146
  "name": "Microlearning Modules",
 
151
  "engagement": "Medium",
152
  "scalability": "Very High",
153
  "interaction": "Medium",
154
+ "sample_link": "http://www.motechhq.com/contentdemos",
155
+ "roi_metrics": "40% higher completion rates, 50% less time investment"
156
  },
157
  "elearning_courses": {
158
  "name": "E-Learning Courses",
 
163
  "engagement": "Medium",
164
  "scalability": "Very High",
165
  "interaction": "Medium",
166
+ "sample_link": "http://www.motechhq.com/contentdemos",
167
+ "roi_metrics": "90% completion rates, 25% faster time-to-competency"
168
  },
169
  "simulation_training": {
170
  "name": "Simulation Training",
 
174
  "production_time": "Very High",
175
  "engagement": "Very High",
176
  "scalability": "Medium",
177
+ "interaction": "Very High",
178
+ "roi_metrics": "95% skill transfer, 80% reduction in safety incidents"
179
  },
180
  "gamified_learning": {
181
  "name": "Gamified Learning",
 
185
  "production_time": "High",
186
  "engagement": "Very High",
187
  "scalability": "High",
188
+ "interaction": "High",
189
+ "roi_metrics": "3x higher engagement, 65% better knowledge retention"
190
  },
191
  "mobile_learning": {
192
  "name": "Mobile Learning",
 
197
  "engagement": "Medium",
198
  "scalability": "Very High",
199
  "interaction": "Medium",
200
+ "sample_link": "http://www.motechhq.com/contentdemos",
201
+ "roi_metrics": "Mobile access increases completion by 45%"
202
  },
203
  "blended_learning": {
204
  "name": "Blended Learning",
 
208
  "production_time": "High",
209
  "engagement": "High",
210
  "scalability": "Medium",
211
+ "interaction": "High",
212
+ "roi_metrics": "Best of both worlds: 80% satisfaction + flexibility"
213
  },
214
  "webinar_series": {
215
  "name": "Webinar Series",
 
219
  "production_time": "Low",
220
  "engagement": "Medium",
221
  "scalability": "Very High",
222
+ "interaction": "Medium",
223
+ "roi_metrics": "Reach thousands simultaneously, 60% cost reduction"
224
  },
225
  "pdf_guides": {
226
  "name": "PDF Guides & Manuals",
 
231
  "engagement": "Low",
232
  "scalability": "Very High",
233
  "interaction": "Very Low",
234
+ "sample_link": "https://www.motechhq.com/contentdemos/BunzleBrochure_SinglePg_Digital_Abbreviated.pdf",
235
+ "roi_metrics": "Instant deployment, 90% cost savings, evergreen content"
236
  }
237
  }
238
 
239
  # Scoring algorithm
240
+ def calculate_format_scores(audience_type, budget, objectives, goals, timeline, interaction_level, team_size):
241
  scores = {}
242
 
243
  for format_id, format_data in TRAINING_FORMATS.items():
 
264
  else:
265
  score -= (format_production - user_timeline) * 5
266
 
267
+ # Team size matching - boost scalable solutions for larger teams
268
+ size_map = {"Small team (10-50)": 1, "Medium team (51-200)": 2, "Large team (201-1000)": 3, "Enterprise (1000+)": 4}
269
+ user_size = size_map.get(team_size, 2)
270
+ scalability_map = {"Low": 1, "Medium": 2, "High": 3, "Very High": 4}
271
+ format_scalability = scalability_map.get(format_data["scalability"], 2)
272
+
273
+ if user_size >= 3 and format_scalability >= 3: # Large teams need scalable solutions
274
+ score += 15
275
+ elif user_size <= 2 and format_scalability <= 2: # Small teams can use less scalable solutions
276
+ score += 10
277
+
278
  # Audience type matching
279
  audience_matches = {
280
  "Corporate employees": ["elearning_courses", "webinar_series", "blended_learning", "mobile_learning", "powerpoint_presentations"],
 
350
  "External customers",
351
  "Field workers"
352
  ],
353
+ help="Consider their learning preferences, tech-savviness, and work environment when selecting your primary audience"
354
  )
355
 
356
  # Budget
 
361
  help="Consider development, production, and deployment costs"
362
  )
363
 
364
+ # Team Size
365
+ team_size = st.selectbox(
366
+ "How many learners will this reach?",
367
+ [
368
+ "Small team (10-50)",
369
+ "Medium team (51-200)",
370
+ "Large team (201-1000)",
371
+ "Enterprise (1000+)"
372
+ ],
373
+ index=1,
374
+ help="This helps us recommend formats that scale appropriately for your audience size"
375
+ )
376
+
377
  # Timeline
378
  timeline = st.selectbox(
379
  "When do you need this deployed?",
 
399
  "Behavior change",
400
  "Knowledge sharing"
401
  ],
402
+ help="What specific outcomes do you need to achieve? Select all that apply (you can choose multiple)"
403
  )
404
 
405
  # Goals
 
413
  "Better retention",
414
  "Measurable results"
415
  ],
416
+ help="What business metrics matter most to your organization? Select your top priorities"
417
  )
418
 
419
  # Interaction Level
 
490
 
491
  # Calculate scores
492
  scores = calculate_format_scores(
493
+ audience_type, budget, objectives, goals, timeline, interaction_level, team_size
494
  )
495
 
496
  # Sort by score
 
506
  "objectives": objectives,
507
  "goals": goals,
508
  "interaction": interaction_level,
509
+ "team_size": team_size,
510
  "context": additional_context
511
  }
512
  }
 
518
 
519
  st.markdown('<div class="results-container">', unsafe_allow_html=True)
520
 
521
+ # Personalized headline
522
+ st.markdown(f'<h3 style="color: #2c3e50; margin-bottom: 20px;">πŸ“‹ Based on your needs, here\'s what we recommend for {recommendations["params"]["audience"].lower()}:</h3>', unsafe_allow_html=True)
523
+
524
+ # Show top 3 recommendations
525
+ for i, (format_id, score) in enumerate(recommendations["formats"][:3]):
526
  format_data = TRAINING_FORMATS[format_id]
527
 
528
  st.markdown(f'<div class="format-card">', unsafe_allow_html=True)
 
534
  st.markdown(f'<a href="{format_data["sample_link"]}" target="_blank" style="color: #1f77b4; text-decoration: none;">πŸ”— View Sample</a>', unsafe_allow_html=True)
535
  st.markdown("<br>", unsafe_allow_html=True)
536
 
537
+ # Show ROI metrics
538
+ if "roi_metrics" in format_data:
539
+ st.markdown(f'<div style="background-color: #e8f5e8; padding: 8px; border-radius: 4px; margin: 8px 0; font-size: 0.9rem;"><strong>πŸ’‘ Expected Results:</strong> {format_data["roi_metrics"]}</div>', unsafe_allow_html=True)
540
+
541
  # Show key details
542
  st.markdown(f"""
543
  <div class="format-details">
 
548
  </div>
549
  """, unsafe_allow_html=True)
550
 
551
+ # Add "Get Custom Proposal" button for top recommendation
552
+ if i == 0:
553
+ st.markdown('<div style="margin-top: 15px;">', unsafe_allow_html=True)
554
+ if st.button(f"🎯 Get Custom Proposal for {format_data['name']}", key=f"proposal_{format_id}", use_container_width=True):
555
+ st.balloons()
556
+ st.success("πŸš€ Great choice! We'll be in touch within 24 hours to discuss your custom proposal.")
557
+ # In a real implementation, this would trigger a lead capture form or redirect
558
+ st.markdown('</div>', unsafe_allow_html=True)
559
+
560
  st.markdown('</div>', unsafe_allow_html=True)
561
 
562
+ # Expandable "View More Options" section
563
+ with st.expander("πŸ” View More Options", expanded=False):
564
+ if len(recommendations["formats"]) > 3:
565
+ st.markdown("**Additional Recommendations:**")
566
+ for i, (format_id, score) in enumerate(recommendations["formats"][3:5], 4):
567
+ format_data = TRAINING_FORMATS[format_id]
568
+
569
+ st.markdown(f'<div style="border: 1px solid #e0e0e0; border-radius: 5px; padding: 10px; margin-bottom: 10px; background-color: #f9f9f9;">', unsafe_allow_html=True)
570
+ st.markdown(f'<strong>{format_data["name"]}</strong> <span style="color: #666;">({score}% Match)</span>')
571
+ st.markdown(f'{format_data["description"]}')
572
+
573
+ if "sample_link" in format_data:
574
+ st.markdown(f'<a href="{format_data["sample_link"]}" target="_blank" style="color: #1f77b4; text-decoration: none; font-size: 0.9rem;">πŸ”— View Sample</a>', unsafe_allow_html=True)
575
+
576
+ if "roi_metrics" in format_data:
577
+ st.markdown(f'<div style="font-size: 0.85rem; color: #666; margin-top: 5px;"><strong>Expected Results:</strong> {format_data["roi_metrics"]}</div>', unsafe_allow_html=True)
578
+
579
+ st.markdown('</div>', unsafe_allow_html=True)
580
+ else:
581
+ st.markdown("*All relevant options are shown above.*")
582
+
583
  st.markdown('</div>', unsafe_allow_html=True)
584
 
585
  # Show analysis summary
 
588
  st.write(f"- **Audience:** {recommendations['params']['audience']}")
589
  st.write(f"- **Budget:** {recommendations['params']['budget']}")
590
  st.write(f"- **Timeline:** {recommendations['params']['timeline']}")
591
+ st.write(f"- **Team Size:** {recommendations['params']['team_size']}")
592
  st.write(f"- **Objectives:** {', '.join(recommendations['params']['objectives'])}")
593
  st.write(f"- **Goals:** {', '.join(recommendations['params']['goals'])}")
594
  st.write(f"- **Interaction Level:** {recommendations['params']['interaction']}")
 
596
  st.write(f"- **Additional Context:** {recommendations['params']['context']}")
597
 
598
  # Action buttons
599
+ col_b1, col_b2, col_b3 = st.columns(3)
600
 
601
  with col_b1:
602
  # Generate report
 
616
  )
617
 
618
  with col_b2:
619
+ # Consultation CTA
620
+ if st.button("🀝 Schedule Consultation", use_container_width=True):
621
+ st.success("πŸŽ‰ Perfect! A Motivation Technologies expert will contact you within 24 hours to discuss your training needs.")
622
+ # In a real implementation, this would redirect to a booking calendar
623
+
624
+ with col_b3:
625
  # New analysis button
626
  if st.button("πŸ”„ New Analysis", use_container_width=True):
627
  st.session_state["recommendations"] = None