bparrino's picture
Update app.py
c812946 verified
import streamlit as st
def calculate_scores(audience, goal, priority, has_lms, learning_environment, budget_range):
"""
Calculate scores for all training formats based on user inputs
"""
recommendations = {
'microlearning': {
'name': 'Microlearning Modules',
'description': 'Short, bite-sized learning units (5-10 minutes each)',
'best_for': 'Busy professionals, skill reinforcement, mobile learning',
'pros': ['High engagement', 'Easy to consume', 'Flexible scheduling', 'Great retention'],
'cons': ['Limited depth per module', 'Requires series planning'],
'sample_link': 'https://demo.motivace.com/creative/MotechDemo/Franke-MyticoOverview/index.html#/'
},
'elearning': {
'name': 'E-Learning Courses',
'description': 'Comprehensive online courses with interactive elements',
'best_for': 'Detailed skill development, certification programs, scalable training',
'pros': ['Comprehensive coverage', 'Interactive features', 'Progress tracking', 'Scalable'],
'cons': ['Higher development cost', 'Longer time commitment'],
'sample_link': 'https://demo.motivace.com/creative/MotechDemo/ZipsCarWash_BodyLanguage/'
},
'powerpoint': {
'name': 'PowerPoint Presentations',
'description': 'Traditional slide-based presentations for instructor-led or self-study',
'best_for': 'Quick deployment, budget-conscious, familiar format',
'pros': ['Fast to create', 'Cost-effective', 'Easy to update', 'Widely compatible'],
'cons': ['Less engaging', 'Limited interactivity', 'Passive learning'],
'sample_link': 'https://drive.google.com/file/d/19zDU8li50_Vs3jZqW_Uy8Pq5HYRmJDmc/view?usp=sharing'
},
'pdf_guides': {
'name': 'PDF Guides & Manuals',
'description': 'Comprehensive written resources and reference materials',
'best_for': 'Reference materials, detailed procedures, offline access',
'pros': ['Detailed information', 'Portable', 'Easy to distribute', 'Low cost'],
'cons': ['Text-heavy', 'Less engaging', 'Difficult to track usage'],
'sample_link': 'https://www.motechhq.com/contentdemos/BunzleBrochure_SinglePg_Digital_Abbreviated.pdf'
},
'webinars': {
'name': 'Webinar Series',
'description': 'Live or recorded online presentations with Q&A opportunities',
'best_for': 'Expert knowledge sharing, live interaction, thought leadership',
'pros': ['Real-time interaction', 'Expert access', 'Engaging format', 'Can be recorded'],
'cons': ['Scheduling challenges', 'Technical requirements', 'Limited replay value'],
'sample_link': 'https://elearningindustry.com/webinars'
},
'infographics': {
'name': 'Infographics & Job Aids',
'description': 'Visual quick-reference materials and process guides',
'best_for': 'Quick reference, process reminders, visual learners',
'pros': ['Highly visual', 'Quick consumption', 'Easy to share', 'Cost-effective'],
'cons': ['Limited detail', 'Not suitable for complex topics', 'Static content'],
'sample_link': 'https://drive.google.com/file/d/1LKfLZH_g1WvbqtciCyzE-E4IRX-W2N2x/view?usp=sharing'
},
'video_tutorials': {
'name': 'Video Tutorials',
'description': 'Step-by-step video demonstrations and explanations',
'best_for': 'Software training, demonstrations, visual learning',
'pros': ['Highly engaging', 'Perfect for demos', 'Reusable', 'Appeals to visual learners'],
'cons': ['Production time', 'File size/bandwidth', 'Updates require re-recording'],
'sample_link': 'https://elearningindustry.com/video-training-education'
},
'blended': {
'name': 'Blended Learning Approach',
'description': 'Combination of multiple formats for comprehensive training',
'best_for': 'Complex topics, diverse learning styles, maximum effectiveness',
'pros': ['Addresses all learning styles', 'Comprehensive', 'Flexible', 'High retention'],
'cons': ['More complex to develop', 'Higher resource requirements', 'Coordination needed'],
'sample_link': 'https://www.motechhq.com'
}
}
# Initialize scores
scores = {key: 0 for key in recommendations.keys()}
# Priority scoring (highest weight)
if priority == "Budget/cost-effectiveness":
scores['pdf_guides'] += 15
scores['powerpoint'] += 12
scores['infographics'] += 12
scores['microlearning'] += 8
scores['video_tutorials'] += 5
scores['webinars'] += 5
scores['elearning'] += 3
scores['blended'] += 1
elif priority == "Speed of deployment":
scores['powerpoint'] += 15
scores['pdf_guides'] += 12
scores['infographics'] += 12
scores['microlearning'] += 8
scores['webinars'] += 6
scores['video_tutorials'] += 4
scores['elearning'] += 2
scores['blended'] += 1
elif priority == "Engagement/interactivity":
scores['elearning'] += 15
scores['microlearning'] += 12
scores['video_tutorials'] += 12
scores['webinars'] += 10
scores['blended'] += 8
scores['infographics'] += 4
scores['powerpoint'] += 2
scores['pdf_guides'] += 1
elif priority == "Scalability":
scores['elearning'] += 15
scores['microlearning'] += 12
scores['video_tutorials'] += 10
scores['blended'] += 8
scores['powerpoint'] += 6
scores['pdf_guides'] += 6
scores['infographics'] += 5
scores['webinars'] += 3
# Audience scoring
if audience == "New Hires - Anyone going through onboarding or ramp-up":
scores['elearning'] += 10
scores['microlearning'] += 8
scores['blended'] += 8
scores['video_tutorials'] += 6
elif audience == "Frontline Employees - Customer service, retail, field workers, production staff, etc.":
scores['microlearning'] += 10
scores['infographics'] += 8
scores['video_tutorials'] += 6
scores['powerpoint'] += 5
elif audience == "People Leaders - Managers, supervisors, team leads":
scores['microlearning'] += 8
scores['webinars'] += 8
scores['elearning'] += 6
scores['blended'] += 6
elif audience == "Sales & Customer-Facing Teams - Sales reps, account managers, support agents":
scores['microlearning'] += 10
scores['video_tutorials'] += 8
scores['webinars'] += 6
scores['infographics'] += 5
elif audience == "Technical or Skilled Roles - Engineers, IT, operations, or hands-on specialists":
scores['elearning'] += 10
scores['video_tutorials'] += 8
scores['pdf_guides'] += 6
scores['microlearning'] += 5
elif audience == "External Partners or Clients - Channel partners, franchisees, customers, vendors":
scores['elearning'] += 8
scores['video_tutorials'] += 8
scores['webinars'] += 6
scores['pdf_guides'] += 5
elif audience == "Not Sure / Mixed Audience":
scores['blended'] += 10
scores['elearning'] += 8
scores['microlearning'] += 6
# Goal scoring
if goal == "Software/system training":
scores['video_tutorials'] += 10
scores['elearning'] += 7
scores['microlearning'] += 5
elif goal == "Compliance training":
scores['elearning'] += 10
scores['blended'] += 6
scores['powerpoint'] += 5
elif goal == "Leadership development":
scores['blended'] += 10
scores['webinars'] += 8
scores['elearning'] += 6
elif goal == "Process documentation":
scores['pdf_guides'] += 10
scores['infographics'] += 8
scores['video_tutorials'] += 6
elif goal == "Basic knowledge transfer":
scores['microlearning'] += 8
scores['powerpoint'] += 7
scores['pdf_guides'] += 6
# Learning environment scoring
if learning_environment == "Formal Classroom or Scheduled Sessions - Instructor-led, in-person, or structured virtual sessions.":
scores['powerpoint'] += 8
scores['webinars'] += 6
scores['blended'] += 5
elif learning_environment == "Individual, Self-Paced - Learners complete training on their own time, independently.":
scores['elearning'] += 10
scores['microlearning'] += 8
scores['video_tutorials'] += 7
scores['pdf_guides'] += 5
elif learning_environment == "Team-Based or Collaborative - Group learning sessions, discussions, or peer-based activities.":
scores['webinars'] += 10
scores['blended'] += 8
scores['elearning'] += 5
elif learning_environment == "On-the-Job / Workplace-Based - Learning happens in the flow of work or during active job tasks.":
scores['infographics'] += 10
scores['microlearning'] += 8
scores['video_tutorials'] += 6
elif learning_environment == "Mobile or On-the-Go - Training needs to be accessed on phones or tablets β€” often in short bursts.":
scores['microlearning'] += 10
scores['infographics'] += 8
scores['video_tutorials'] += 5
elif learning_environment == "Technical or Hands-On Lab Environment - Requires specialized equipment, environments, or simulation training.":
scores['video_tutorials'] += 10
scores['elearning'] += 8
scores['blended'] += 6
elif learning_environment == "Remote / Distributed Teams - Learners are in different locations or time zones.":
scores['elearning'] += 8
scores['webinars'] += 8
scores['microlearning'] += 6
scores['video_tutorials'] += 6
elif learning_environment == "Not Sure / A Mix of All":
scores['blended'] += 10
scores['elearning'] += 6
scores['microlearning'] += 5
# Budget scoring
if budget_range == "Low":
scores['pdf_guides'] += 6
scores['powerpoint'] += 5
scores['infographics'] += 5
scores['elearning'] += 4
elif budget_range == "Medium":
scores['elearning'] += 6
scores['video_tutorials'] += 4
scores['webinars'] += 3
elif budget_range == "High":
scores['microlearning'] += 6
scores['blended'] += 4
# If budget_range is "" or "Prefer not to say", no budget scoring is applied
# Sort by score and return top 3 with their details
sorted_recommendations = sorted(scores.items(), key=lambda x: x[1], reverse=True)
top_3 = sorted_recommendations[:3]
result = []
for key, score in top_3:
rec_data = recommendations[key].copy()
rec_data['score'] = score
result.append(rec_data)
return result
# Streamlit setup
st.set_page_config(page_title="Training Content Format Recommender", layout="wide")
# Initialize session state
if "recommendations" not in st.session_state:
st.session_state["recommendations"] = None
if "form_key" not in st.session_state:
st.session_state["form_key"] = 0
# Header with contact info
st.markdown("""
<div style='background: linear-gradient(90deg, #1e3c72 0%, #2a5298 100%); padding: 20px; border-radius: 10px; margin-bottom: 30px;'>
<h1 style='text-align: center; color: white; margin: 0;'>Training Content Format Recommender</h1>
<h3 style='text-align: center; color: #e8f4f8; margin: 10px 0;'>Find the Perfect Training Format in Under a Minute!</h3>
<p style='text-align: center; color: #b8d4e8; margin: 0; font-size: 16px;'>
Powered by <a href='https://www.motechhq.com/' target='_blank' style='color: #ffffff; text-decoration: none; font-weight: bold;'>Motivation Technologies</a> -
Questions? Contact Ben Parrino at <a href='mailto:bparrino@motechhq.com' style='color: #ffffff; text-decoration: none;'>bparrino@motechhq.com</a>
</p>
</div>
""", unsafe_allow_html=True)
# User inputs
st.markdown("<h2 style='text-align: center;'>Quick Assessment</h2>", unsafe_allow_html=True)
# Use dynamic keys that change when form is reset
form_key = st.session_state["form_key"]
# Question 1: Target Audience (Full Width)
audience = st.selectbox("1. Who is your primary target audience?", [
"",
"Frontline Employees - Customer service, retail, field workers, production staff, etc.",
"People Leaders - Managers, supervisors, team leads",
"New Hires - Anyone going through onboarding or ramp-up",
"Sales & Customer-Facing Teams - Sales reps, account managers, support agents",
"Technical or Skilled Roles - Engineers, IT, operations, or hands-on specialists",
"External Partners or Clients - Channel partners, franchisees, customers, vendors",
"Not Sure / Mixed Audience"
], key=f"audience_select_{form_key}")
# Question 2: Learning Environment (Full Width)
learning_environment = st.selectbox("2. What's your preferred learning environment?", [
"",
"Individual, Self-Paced - Learners complete training on their own time, independently.",
"On-the-Job / Workplace-Based - Learning happens in the flow of work or during active job tasks.",
"Mobile or On-the-Go - Training needs to be accessed on phones or tablets β€” often in short bursts.",
"Team-Based or Collaborative - Group learning sessions, discussions, or peer-based activities.",
"Formal Classroom or Scheduled Sessions - Instructor-led, in-person, or structured virtual sessions.",
"Remote / Distributed Teams - Learners are in different locations or time zones.",
"Technical or Hands-On Lab Environment - Requires specialized equipment, environments, or simulation training.",
"Not Sure / A Mix of All"
], key=f"learning_env_select_{form_key}")
# Questions 3-6 in two columns
col1, col2 = st.columns(2)
with col1:
# Question 3: Primary Training Goal
goal = st.selectbox("3. What's your primary training goal?", [
"",
"Basic knowledge transfer",
"Skill development/improvement",
"Software/system training",
"Compliance training",
"Process documentation",
"Leadership development",
"Product knowledge",
"Safety training"
], key=f"goal_select_{form_key}")
# Question 5: LMS Availability
has_lms = st.selectbox("5. Do you have a formal Learning Management System (LMS)?", [
"",
"No preference/Unsure",
"Yes - we have an LMS",
"No - no formal LMS"
], key=f"lms_select_{form_key}")
with col2:
# Question 4: Top Priority
priority = st.selectbox("4. What's your top priority?", [
"",
"Speed of deployment",
"Engagement/interactivity",
"Scalability",
"Budget/cost-effectiveness"
], key=f"priority_select_{form_key}")
# Question 6: Budget Range
budget_range = st.selectbox("6. What's your approximate budget range? (Optional)", [
"",
"Prefer not to say",
"Low",
"Medium",
"High"
], key=f"budget_select_{form_key}")
# Generate recommendation button
generate_button = st.button('Get My Training Format Recommendation', type="primary")
# Process results
if generate_button:
if not audience or not learning_environment or not goal or not priority:
st.error("Please answer questions 1-4 to get your recommendation.")
else:
with st.spinner("Analyzing your needs and generating recommendation..."):
recommendations = calculate_scores(
audience, goal, priority, has_lms, learning_environment, budget_range
)
st.session_state["recommendations"] = recommendations
# Display results
if st.session_state["recommendations"]:
recommendations = st.session_state["recommendations"]
primary = recommendations[0]
secondary = recommendations[1]
tertiary = recommendations[2]
st.markdown("---")
st.markdown(f"<h2 style='text-align: center; color: var(--text-color);'>🎯 Your Training Format Recommendations</h2>", unsafe_allow_html=True)
st.markdown("<p style='text-align: center; opacity: 0.7; font-style: italic; margin-bottom: 25px;'>Click the recommendation name to view a sample and learn more.</p>", unsafe_allow_html=True)
# Primary recommendation
st.markdown(f"<h3 style='color: #2E8B57;'>πŸ₯‡ Primary Recommendation: <a href='{primary['sample_link']}' target='_blank' rel='noopener noreferrer' style='color: #2E8B57; text-decoration: none;'>{primary['name']}</a> ({max(75, min(95, int((primary['score']/30)*100)))}% Match)</h3>", unsafe_allow_html=True)
st.markdown(f"""
<div style='background: var(--background-color); border: 1px solid var(--border-color, #e0e0e0); padding: 20px; border-radius: 10px; border-left: 5px solid #4CAF50;'>
<h4 style='margin-top: 0; color: var(--text-color);'>πŸ“‹ {primary['name']}</h4>
<p style='font-size: 16px; color: var(--text-color); opacity: 0.9;'><strong>Description:</strong> {primary['description']}</p>
<p style='font-size: 16px; color: var(--text-color); opacity: 0.9;'><strong>Best for:</strong> {primary['best_for']}</p>
</div>
""", unsafe_allow_html=True)
# Pros and Cons for primary
col1, col2 = st.columns(2)
with col1:
st.markdown("#### βœ… Advantages")
for pro in primary['pros']:
st.markdown(f"β€’ {pro}")
with col2:
st.markdown("#### ⚠️ Considerations")
for con in primary['cons']:
st.markdown(f"β€’ {con}")
# Secondary and tertiary recommendations
st.markdown("### πŸ”„ Alternative Options")
col1, col2 = st.columns(2)
with col1:
st.markdown(f"#### πŸ₯ˆ Secondary: <a href='{secondary['sample_link']}' target='_blank' rel='noopener noreferrer' style='color: inherit; text-decoration: none;'>{secondary['name']}</a> ({max(60, min(85, int((secondary['score']/30)*100)))}% Match)", unsafe_allow_html=True)
st.markdown(f"**Description:** {secondary['description']}")
st.markdown(f"**Best for:** {secondary['best_for']}")
with st.expander("View Details"):
st.markdown("**Advantages:**")
for pro in secondary['pros']:
st.markdown(f"β€’ {pro}")
st.markdown("**Considerations:**")
for con in secondary['cons']:
st.markdown(f"β€’ {con}")
with col2:
st.markdown(f"#### πŸ₯‰ Tertiary: <a href='{tertiary['sample_link']}' target='_blank' rel='noopener noreferrer' style='color: inherit; text-decoration: none;'>{tertiary['name']}</a> ({max(45, min(75, int((tertiary['score']/30)*100)))}% Match)", unsafe_allow_html=True)
st.markdown(f"**Description:** {tertiary['description']}")
st.markdown(f"**Best for:** {tertiary['best_for']}")
with st.expander("View Details"):
st.markdown("**Advantages:**")
for pro in tertiary['pros']:
st.markdown(f"β€’ {pro}")
st.markdown("**Considerations:**")
for con in tertiary['cons']:
st.markdown(f"β€’ {con}")
# Next steps
st.markdown("### πŸš€ Next Steps")
st.markdown("""
1. **Review** all three recommendations above
2. **Consider** your specific context and constraints
3. **Plan** your content development timeline
4. **Start** with a pilot or small-scale implementation
5. **Measure** effectiveness and adjust as needed
**Need help with implementation?** Contact our team at [MoTech](https://www.motechhq.com/connect) for personalized support.
""")
# Additional tip based on primary recommendation
if primary['name'] == 'Microlearning Modules':
st.info("πŸ’‘ **Tip:** Start with 3-5 modules covering your core topics. Each module should focus on one specific learning objective. Need help designing effective microlearning? We can help!")
elif primary['name'] == 'Video Tutorials':
st.info("πŸ’‘ **Tip:** Keep videos under 10 minutes, use screen recording tools like Loom or Camtasia, and include closed captions. Want professional video production support? Let's chat!")
elif primary['name'] == 'E-Learning Courses':
st.info("πŸ’‘ **Tip:** Consider platforms like Articulate Storyline, Adobe Captivate, or cloud-based solutions like Thinkific. Need help choosing the right platform? We can guide you!")
elif primary['name'] == 'PowerPoint Presentations':
st.info("πŸ’‘ **Tip:** Make slides more engaging with visuals, keep text minimal, and consider adding voice narration. Want to transform your presentations into interactive experiences? Contact us!")
elif primary['name'] == 'PDF Guides & Manuals':
st.info("πŸ’‘ **Tip:** Use clear headings, bullet points, and visual elements to make text-heavy content more digestible. Need help creating professional training materials? We're here to help!")
elif primary['name'] == 'Webinar Series':
st.info("πŸ’‘ **Tip:** Plan interactive elements like polls and Q&A sessions. Record sessions for those who can't attend live. Want help planning and executing a webinar series? Let's discuss!")
elif primary['name'] == 'Infographics & Job Aids':
st.info("πŸ’‘ **Tip:** Focus on one key process or concept per infographic. Use consistent colors and branding. Need professional design support for your visual materials? We can help!")
elif primary['name'] == 'Blended Learning Approach':
st.info("πŸ’‘ **Tip:** Start with 2-3 formats that complement each other, such as video + job aids or microlearning + webinars. Blended learning can be complex - let our experts help you design the perfect mix!")
# Action buttons
if st.button("Start Over", type="secondary"):
# Clear recommendations and increment form key to reset all widgets
st.session_state["recommendations"] = None
st.session_state["form_key"] += 1
st.rerun()
# Footer with contact information
st.markdown("---")
st.markdown("""
<div style='background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); padding: 15px; border-radius: 8px; text-align: center; margin-top: 30px;'>
<h4 style='color: white; margin-top: 0; margin-bottom: 10px;'>🀝 Ready to Transform Your Training?</h4>
<p style='color: #e8f4f8; margin-bottom: 12px; font-size: 14px;'>
This tool provides general guidance based on best practices. For a customized training strategy
that fits your unique organizational needs, our experts are ready to help.
</p>
<div style='margin-bottom: 10px;'>
<a href='https://www.motechhq.com/' target='_blank' style='color: white; text-decoration: none; font-weight: bold; margin-right: 15px; font-size: 14px;'>🌐 Visit motechhq.com</a>
<a href='mailto:bparrino@motechhq.com' style='color: white; text-decoration: none; font-weight: bold; margin-right: 15px; font-size: 14px;'>πŸ“§ bparrino@motechhq.com</a>
<a href='https://meetings.hubspot.com/ben-parrino' target='_blank' style='color: white; text-decoration: none; font-weight: bold; font-size: 14px;'>πŸ“… Schedule with Ben</a>
</div>
<p style='color: #b8d4e8; font-size: 12px; margin: 0;'>
πŸ’‘ Consider your specific organizational needs, resources, and learner preferences when making final decisions.
</p>
</div>
""", unsafe_allow_html=True)