Spaces:
Sleeping
Sleeping
| import streamlit as st | |
| import json | |
| import time | |
| import random | |
| from datetime import datetime, timedelta | |
| # Set page config | |
| st.set_page_config( | |
| page_title="Training Content Health Check", | |
| page_icon="π", | |
| layout="wide", | |
| initial_sidebar_state="collapsed" | |
| ) | |
| # Custom CSS | |
| st.markdown(""" | |
| <style> | |
| .main .block-container { | |
| padding-top: 2rem; | |
| padding-bottom: 2rem; | |
| max-width: 1000px; | |
| margin: 0 auto; | |
| } | |
| .stApp { | |
| background-color: #f8f9fa; | |
| } | |
| .title-area { | |
| text-align: center; | |
| margin-bottom: 2rem; | |
| } | |
| .custom-subheader { | |
| background-color: #f0f2f6; | |
| padding: 10px; | |
| border-radius: 5px; | |
| margin-bottom: 10px; | |
| font-weight: 600; | |
| } | |
| .results-container { | |
| border: 1px solid #ddd; | |
| border-radius: 5px; | |
| padding: 20px; | |
| background-color: white; | |
| margin-bottom: 20px; | |
| } | |
| .status-card { | |
| border: 2px solid #e0e0e0; | |
| border-radius: 12px; | |
| padding: 20px; | |
| margin-bottom: 20px; | |
| text-align: center; | |
| } | |
| .status-excellent { | |
| border-color: #28a745; | |
| background-color: #f8fff9; | |
| } | |
| .status-good { | |
| border-color: #ffc107; | |
| background-color: #fffdf0; | |
| } | |
| .status-needs-attention { | |
| border-color: #fd7e14; | |
| background-color: #fff8f0; | |
| } | |
| .status-critical { | |
| border-color: #dc3545; | |
| background-color: #fff5f5; | |
| } | |
| .status-title { | |
| font-size: 1.8rem; | |
| font-weight: 700; | |
| margin-bottom: 10px; | |
| } | |
| .status-description { | |
| font-size: 1.1rem; | |
| margin-bottom: 15px; | |
| } | |
| .status-score { | |
| font-size: 2.5rem; | |
| font-weight: 800; | |
| margin-bottom: 10px; | |
| } | |
| .recommendation-card { | |
| border: 1px solid #e0e0e0; | |
| border-radius: 8px; | |
| padding: 15px; | |
| margin-bottom: 15px; | |
| background-color: #fafafa; | |
| } | |
| .recommendation-title { | |
| font-size: 1.1rem; | |
| font-weight: 600; | |
| color: #2c3e50; | |
| margin-bottom: 8px; | |
| } | |
| .priority-high { | |
| border-left: 4px solid #dc3545; | |
| } | |
| .priority-medium { | |
| border-left: 4px solid #ffc107; | |
| } | |
| .priority-low { | |
| border-left: 4px solid #28a745; | |
| } | |
| .question-card { | |
| background-color: white; | |
| border: 1px solid #e0e0e0; | |
| border-radius: 8px; | |
| padding: 20px; | |
| margin-bottom: 20px; | |
| } | |
| .question-number { | |
| background-color: #007bff; | |
| color: white; | |
| border-radius: 50%; | |
| width: 30px; | |
| height: 30px; | |
| display: inline-flex; | |
| align-items: center; | |
| justify-content: center; | |
| font-weight: 600; | |
| margin-right: 10px; | |
| } | |
| .progress-bar { | |
| height: 8px; | |
| background-color: #e9ecef; | |
| border-radius: 4px; | |
| overflow: hidden; | |
| margin-bottom: 20px; | |
| } | |
| .progress-fill { | |
| height: 100%; | |
| background-color: #007bff; | |
| transition: width 0.3s ease; | |
| } | |
| .stButton button { | |
| width: 100%; | |
| } | |
| .footnote { | |
| font-size: 0.8rem; | |
| color: #6c757d; | |
| margin-top: 2rem; | |
| } | |
| .placeholder-area { | |
| border: 2px dashed #ddd; | |
| border-radius: 10px; | |
| padding: 40px; | |
| text-align: center; | |
| background-color: #f8f9fa; | |
| color: #666; | |
| } | |
| .stats-container { | |
| display: flex; | |
| justify-content: space-around; | |
| margin: 20px 0; | |
| } | |
| .stat-item { | |
| text-align: center; | |
| padding: 15px; | |
| background-color: #f8f9fa; | |
| border-radius: 8px; | |
| margin: 0 5px; | |
| flex: 1; | |
| } | |
| .stat-number { | |
| font-size: 1.5rem; | |
| font-weight: 700; | |
| color: #007bff; | |
| } | |
| .stat-label { | |
| font-size: 0.9rem; | |
| color: #6c757d; | |
| } | |
| </style> | |
| """, unsafe_allow_html=True) | |
| # Title and description | |
| st.markdown(""" | |
| <div class="title-area"> | |
| <h1>Training Content Health Check π</h1> | |
| <p>Assess whether your training content is still effective and relevant. Get personalized recommendations to keep your content fresh and engaging!</p> | |
| </div> | |
| """, unsafe_allow_html=True) | |
| # Initialize session state | |
| if "assessment_complete" not in st.session_state: | |
| st.session_state["assessment_complete"] = False | |
| if "current_question" not in st.session_state: | |
| st.session_state["current_question"] = 0 | |
| if "answers" not in st.session_state: | |
| st.session_state["answers"] = {} | |
| if "assessment_results" not in st.session_state: | |
| st.session_state["assessment_results"] = None | |
| # Assessment questions | |
| ASSESSMENT_QUESTIONS = [ | |
| { | |
| "id": "content_age", | |
| "question": "When was your training content last updated?", | |
| "type": "single_choice", | |
| "options": [ | |
| ("Within the last 6 months", 5), | |
| ("6 months to 1 year ago", 4), | |
| ("1-2 years ago", 3), | |
| ("2-3 years ago", 2), | |
| ("More than 3 years ago", 1) | |
| ], | |
| "help": "Newer content is generally more relevant and effective" | |
| }, | |
| { | |
| "id": "industry_changes", | |
| "question": "Have there been significant changes in your industry since the content was created?", | |
| "type": "single_choice", | |
| "options": [ | |
| ("No significant changes", 5), | |
| ("Minor changes that don't affect the content", 4), | |
| ("Some changes that might impact relevance", 3), | |
| ("Significant changes that likely impact content", 2), | |
| ("Major industry transformation", 1) | |
| ], | |
| "help": "Industry evolution can quickly make training content obsolete" | |
| }, | |
| { | |
| "id": "technology_updates", | |
| "question": "If your training involves technology or software, how current are the versions covered?", | |
| "type": "single_choice", | |
| "options": [ | |
| ("Current/latest versions", 5), | |
| ("One version behind", 4), | |
| ("2-3 versions behind", 3), | |
| ("Significantly outdated versions", 2), | |
| ("Legacy/deprecated technology", 1), | |
| ("Not applicable - no technology involved", 5) | |
| ], | |
| "help": "Technology training needs frequent updates to remain useful" | |
| }, | |
| { | |
| "id": "learner_feedback", | |
| "question": "What kind of feedback do you receive from learners about the content?", | |
| "type": "single_choice", | |
| "options": [ | |
| ("Consistently positive and engaged", 5), | |
| ("Mostly positive with minor suggestions", 4), | |
| ("Mixed feedback - some find it helpful", 3), | |
| ("Frequent complaints about relevance", 2), | |
| ("Learners find it outdated or unhelpful", 1) | |
| ], | |
| "help": "Learner feedback is a key indicator of content effectiveness" | |
| }, | |
| { | |
| "id": "completion_rates", | |
| "question": "How are your training completion rates?", | |
| "type": "single_choice", | |
| "options": [ | |
| ("80%+ completion rate", 5), | |
| ("60-79% completion rate", 4), | |
| ("40-59% completion rate", 3), | |
| ("20-39% completion rate", 2), | |
| ("Below 20% completion rate", 1), | |
| ("Don't track completion rates", 2) | |
| ], | |
| "help": "Low completion rates often indicate content problems" | |
| }, | |
| { | |
| "id": "performance_impact", | |
| "question": "Can you measure improved job performance after training?", | |
| "type": "single_choice", | |
| "options": [ | |
| ("Clear performance improvements measured", 5), | |
| ("Some improvements observed", 4), | |
| ("Minimal or unclear impact", 3), | |
| ("No measurable improvement", 2), | |
| ("Performance may have declined", 1) | |
| ], | |
| "help": "Effective training should lead to measurable performance gains" | |
| }, | |
| { | |
| "id": "content_format", | |
| "question": "How well does your content format match current learner preferences?", | |
| "type": "single_choice", | |
| "options": [ | |
| ("Perfect match - modern, engaging format", 5), | |
| ("Good match with minor format updates needed", 4), | |
| ("Adequate but could be more engaging", 3), | |
| ("Format feels somewhat outdated", 2), | |
| ("Very outdated format (old videos, static PDFs)", 1) | |
| ], | |
| "help": "Learning preferences evolve - mobile, interactive, bite-sized content is preferred" | |
| }, | |
| { | |
| "id": "compliance_requirements", | |
| "question": "Are there new compliance or regulatory requirements affecting your training?", | |
| "type": "single_choice", | |
| "options": [ | |
| ("No new requirements", 5), | |
| ("Minor updates needed for compliance", 4), | |
| ("Some new requirements to incorporate", 3), | |
| ("Significant compliance changes needed", 2), | |
| ("Major regulatory overhaul required", 1), | |
| ("Not applicable - no compliance requirements", 5) | |
| ], | |
| "help": "Regulatory changes can make training content non-compliant" | |
| }, | |
| { | |
| "id": "accessibility", | |
| "question": "Does your content meet current accessibility standards?", | |
| "type": "single_choice", | |
| "options": [ | |
| ("Fully accessible and compliant", 5), | |
| ("Mostly accessible with minor gaps", 4), | |
| ("Some accessibility features missing", 3), | |
| ("Limited accessibility support", 2), | |
| ("Not designed with accessibility in mind", 1) | |
| ], | |
| "help": "Accessibility standards have evolved significantly in recent years" | |
| }, | |
| { | |
| "id": "competitive_benchmark", | |
| "question": "How does your training content compare to industry standards or competitors?", | |
| "type": "single_choice", | |
| "options": [ | |
| ("Industry-leading quality and innovation", 5), | |
| ("Above average compared to competitors", 4), | |
| ("On par with industry standards", 3), | |
| ("Below average - competitors have better content", 2), | |
| ("Significantly behind industry standards", 1) | |
| ], | |
| "help": "Staying competitive requires keeping up with industry training standards" | |
| } | |
| ] | |
| def calculate_assessment_score(answers): | |
| """Calculate the overall assessment score and determine status""" | |
| total_score = sum(answers.values()) | |
| max_possible = len(answers) * 5 | |
| percentage = (total_score / max_possible) * 100 | |
| # Determine status based on percentage | |
| if percentage >= 85: | |
| status = "Still Sharp" | |
| status_class = "status-excellent" | |
| status_emoji = "π" | |
| status_color = "#28a745" | |
| elif percentage >= 70: | |
| status = "Minor Tune-Up" | |
| status_class = "status-good" | |
| status_emoji = "β " | |
| status_color = "#ffc107" | |
| elif percentage >= 50: | |
| status = "Needs Refresh" | |
| status_class = "status-needs-attention" | |
| status_emoji = "β οΈ" | |
| status_color = "#fd7e14" | |
| else: | |
| status = "Critical Update" | |
| status_class = "status-critical" | |
| status_emoji = "π¨" | |
| status_color = "#dc3545" | |
| return { | |
| "score": total_score, | |
| "percentage": percentage, | |
| "status": status, | |
| "status_class": status_class, | |
| "status_emoji": status_emoji, | |
| "status_color": status_color, | |
| "max_possible": max_possible | |
| } | |
| def generate_recommendations(answers, results): | |
| """Generate personalized recommendations based on assessment results""" | |
| recommendations = [] | |
| # Analyze specific areas that need attention | |
| problem_areas = [] | |
| # Check content age | |
| if answers.get("content_age", 5) <= 2: | |
| problem_areas.append("content_age") | |
| recommendations.append({ | |
| "title": "Update Content Immediately", | |
| "description": "Your content is significantly outdated. Plan a comprehensive content refresh within the next 2-3 months.", | |
| "priority": "high", | |
| "action_items": [ | |
| "Audit all training materials for accuracy", | |
| "Research current industry best practices", | |
| "Create a content update timeline", | |
| "Consider outsourcing content development if needed" | |
| ] | |
| }) | |
| # Check technology relevance | |
| if answers.get("technology_updates", 5) <= 2: | |
| problem_areas.append("technology") | |
| recommendations.append({ | |
| "title": "Technology Update Required", | |
| "description": "Your technology training is using outdated versions that may confuse learners.", | |
| "priority": "high", | |
| "action_items": [ | |
| "Update all software versions in training", | |
| "Create version-specific training modules", | |
| "Establish regular technology review schedule" | |
| ] | |
| }) | |
| # Check learner engagement | |
| if answers.get("learner_feedback", 5) <= 3 or answers.get("completion_rates", 5) <= 3: | |
| problem_areas.append("engagement") | |
| recommendations.append({ | |
| "title": "Improve Learner Engagement", | |
| "description": "Low engagement suggests content format or relevance issues.", | |
| "priority": "medium", | |
| "action_items": [ | |
| "Survey learners for specific feedback", | |
| "Consider interactive content formats", | |
| "Break content into smaller, digestible modules", | |
| "Add gamification elements" | |
| ] | |
| }) | |
| # Check format modernization | |
| if answers.get("content_format", 5) <= 3: | |
| problem_areas.append("format") | |
| recommendations.append({ | |
| "title": "Modernize Content Format", | |
| "description": "Update your content format to match current learner preferences.", | |
| "priority": "medium", | |
| "action_items": [ | |
| "Convert static content to interactive formats", | |
| "Optimize for mobile devices", | |
| "Add video and multimedia elements", | |
| "Create bite-sized learning modules" | |
| ] | |
| }) | |
| # Check compliance | |
| if answers.get("compliance_requirements", 5) <= 3: | |
| problem_areas.append("compliance") | |
| recommendations.append({ | |
| "title": "Address Compliance Gaps", | |
| "description": "New regulatory requirements need to be incorporated into your training.", | |
| "priority": "high", | |
| "action_items": [ | |
| "Review current compliance requirements", | |
| "Update content to meet new standards", | |
| "Document compliance coverage", | |
| "Schedule regular compliance reviews" | |
| ] | |
| }) | |
| # Check accessibility | |
| if answers.get("accessibility", 5) <= 3: | |
| problem_areas.append("accessibility") | |
| recommendations.append({ | |
| "title": "Enhance Accessibility", | |
| "description": "Improve accessibility to ensure all learners can effectively use your content.", | |
| "priority": "medium", | |
| "action_items": [ | |
| "Conduct accessibility audit", | |
| "Add captions to videos", | |
| "Ensure screen reader compatibility", | |
| "Provide alternative formats" | |
| ] | |
| }) | |
| # Performance tracking | |
| if answers.get("performance_impact", 5) <= 3: | |
| recommendations.append({ | |
| "title": "Implement Performance Tracking", | |
| "description": "Establish metrics to measure training effectiveness and ROI.", | |
| "priority": "low", | |
| "action_items": [ | |
| "Define success metrics", | |
| "Implement tracking systems", | |
| "Conduct pre/post assessments", | |
| "Regular performance reviews" | |
| ] | |
| }) | |
| # If no major issues, provide maintenance recommendations | |
| if results["percentage"] >= 70: | |
| recommendations.append({ | |
| "title": "Maintain Content Excellence", | |
| "description": "Your content is in good shape! Focus on continuous improvement.", | |
| "priority": "low", | |
| "action_items": [ | |
| "Schedule quarterly content reviews", | |
| "Stay updated with industry trends", | |
| "Gather regular learner feedback", | |
| "Plan incremental improvements" | |
| ] | |
| }) | |
| return recommendations, problem_areas | |
| # Main content | |
| if not st.session_state["assessment_complete"]: | |
| # Assessment questionnaire | |
| col1, col2 = st.columns([2, 1]) | |
| with col1: | |
| # Progress bar | |
| progress = (st.session_state["current_question"]) / len(ASSESSMENT_QUESTIONS) | |
| st.markdown(f""" | |
| <div class="progress-bar"> | |
| <div class="progress-fill" style="width: {progress * 100}%"></div> | |
| </div> | |
| <p style="text-align: center; margin-bottom: 20px;">Question {st.session_state["current_question"] + 1} of {len(ASSESSMENT_QUESTIONS)}</p> | |
| """, unsafe_allow_html=True) | |
| # Current question | |
| if st.session_state["current_question"] < len(ASSESSMENT_QUESTIONS): | |
| current_q = ASSESSMENT_QUESTIONS[st.session_state["current_question"]] | |
| st.markdown(f'<div class="question-card">', unsafe_allow_html=True) | |
| st.markdown(f""" | |
| <div style="display: flex; align-items: center; margin-bottom: 15px;"> | |
| <span class="question-number">{st.session_state["current_question"] + 1}</span> | |
| <h3 style="margin: 0;">{current_q["question"]}</h3> | |
| </div> | |
| """, unsafe_allow_html=True) | |
| # Question options | |
| if current_q["type"] == "single_choice": | |
| answer = st.radio( | |
| "Select your answer:", | |
| options=[option[0] for option in current_q["options"]], | |
| key=f"question_{current_q['id']}", | |
| help=current_q.get("help", "") | |
| ) | |
| # Find the score for the selected answer | |
| selected_score = None | |
| for option_text, score in current_q["options"]: | |
| if option_text == answer: | |
| selected_score = score | |
| break | |
| if selected_score is not None: | |
| st.session_state["answers"][current_q["id"]] = selected_score | |
| st.markdown('</div>', unsafe_allow_html=True) | |
| # Navigation buttons | |
| col_prev, col_next = st.columns([1, 1]) | |
| with col_prev: | |
| if st.session_state["current_question"] > 0: | |
| if st.button("β¬ οΈ Previous", use_container_width=True): | |
| st.session_state["current_question"] -= 1 | |
| st.rerun() | |
| with col_next: | |
| if st.session_state["current_question"] < len(ASSESSMENT_QUESTIONS) - 1: | |
| if st.button("Next β‘οΈ", use_container_width=True): | |
| st.session_state["current_question"] += 1 | |
| st.rerun() | |
| else: | |
| if st.button("π Get My Results", use_container_width=True): | |
| st.session_state["assessment_complete"] = True | |
| st.session_state["assessment_results"] = calculate_assessment_score(st.session_state["answers"]) | |
| st.rerun() | |
| with col2: | |
| st.markdown('<div class="custom-subheader">Assessment Overview</div>', unsafe_allow_html=True) | |
| # Show progress stats | |
| answered = len(st.session_state["answers"]) | |
| st.markdown(f""" | |
| <div class="stats-container"> | |
| <div class="stat-item"> | |
| <div class="stat-number">{answered}</div> | |
| <div class="stat-label">Answered</div> | |
| </div> | |
| <div class="stat-item"> | |
| <div class="stat-number">{len(ASSESSMENT_QUESTIONS) - answered}</div> | |
| <div class="stat-label">Remaining</div> | |
| </div> | |
| </div> | |
| """, unsafe_allow_html=True) | |
| # Assessment categories | |
| st.markdown("**Assessment Categories:**") | |
| categories = [ | |
| "π Content Age & Relevance", | |
| "π Industry & Technology Changes", | |
| "π₯ Learner Engagement & Feedback", | |
| "π Performance & Compliance", | |
| "βΏ Accessibility & Format" | |
| ] | |
| for category in categories: | |
| st.markdown(f"β’ {category}") | |
| # Tips | |
| with st.expander("π‘ Assessment Tips"): | |
| st.markdown(""" | |
| **For Best Results:** | |
| - Answer honestly based on your current situation | |
| - Consider gathering learner feedback before assessment | |
| - Think about recent industry or regulatory changes | |
| - Review your training analytics if available | |
| - Consider both technical and content aspects | |
| """) | |
| else: | |
| # Results display | |
| results = st.session_state["assessment_results"] | |
| recommendations, problem_areas = generate_recommendations(st.session_state["answers"], results) | |
| # Status card | |
| st.markdown(f""" | |
| <div class="status-card {results['status_class']}"> | |
| <div class="status-score" style="color: {results['status_color']}"> | |
| {results['status_emoji']} {results['percentage']:.0f}% | |
| </div> | |
| <div class="status-title" style="color: {results['status_color']}"> | |
| {results['status']} | |
| </div> | |
| <div class="status-description"> | |
| You scored {results['score']} out of {results['max_possible']} points | |
| </div> | |
| </div> | |
| """, unsafe_allow_html=True) | |
| # Status-specific messages | |
| status_messages = { | |
| "Still Sharp": "Excellent! Your training content is current and effective. Focus on maintenance and continuous improvement.", | |
| "Minor Tune-Up": "Good foundation! Your content is mostly current but could benefit from some updates to stay competitive.", | |
| "Needs Refresh": "Time for updates! Your content has some outdated elements that are impacting effectiveness.", | |
| "Critical Update": "Immediate action needed! Your content requires significant updates to remain valuable and relevant." | |
| } | |
| st.success(status_messages[results['status']]) | |
| # Detailed recommendations | |
| col1, col2 = st.columns([1, 1]) | |
| with col1: | |
| st.markdown('<div class="custom-subheader">π Your Action Plan</div>', unsafe_allow_html=True) | |
| # Priority recommendations first | |
| high_priority = [r for r in recommendations if r["priority"] == "high"] | |
| medium_priority = [r for r in recommendations if r["priority"] == "medium"] | |
| low_priority = [r for r in recommendations if r["priority"] == "low"] | |
| for priority_group, title in [(high_priority, "π¨ High Priority"), (medium_priority, "β οΈ Medium Priority"), (low_priority, "π‘ Low Priority")]: | |
| if priority_group: | |
| st.markdown(f"**{title}**") | |
| for rec in priority_group: | |
| st.markdown(f'<div class="recommendation-card priority-{rec["priority"]}">', unsafe_allow_html=True) | |
| st.markdown(f'<div class="recommendation-title">{rec["title"]}</div>', unsafe_allow_html=True) | |
| st.markdown(f'<p>{rec["description"]}</p>', unsafe_allow_html=True) | |
| if rec["action_items"]: | |
| st.markdown("**Action Items:**") | |
| for item in rec["action_items"]: | |
| st.markdown(f"β’ {item}") | |
| st.markdown('</div>', unsafe_allow_html=True) | |
| with col2: | |
| st.markdown('<div class="custom-subheader">π Detailed Breakdown</div>', unsafe_allow_html=True) | |
| # Score breakdown by category | |
| category_scores = {} | |
| for q in ASSESSMENT_QUESTIONS: | |
| score = st.session_state["answers"].get(q["id"], 0) | |
| category_scores[q["question"]] = (score, 5) | |
| # Show problem areas | |
| if problem_areas: | |
| st.markdown("**Areas Needing Attention:**") | |
| area_labels = { | |
| "content_age": "π Content Age", | |
| "technology": "π» Technology Currency", | |
| "engagement": "π₯ Learner Engagement", | |
| "format": "π¨ Content Format", | |
| "compliance": "π Compliance", | |
| "accessibility": "βΏ Accessibility" | |
| } | |
| for area in problem_areas: | |
| if area in area_labels: | |
| st.markdown(f"β’ {area_labels[area]}") | |
| # Timeline estimate | |
| st.markdown("**Estimated Timeline:**") | |
| if results['percentage'] >= 85: | |
| timeline = "1-2 months for maintenance" | |
| elif results['percentage'] >= 70: | |
| timeline = "2-4 months for updates" | |
| elif results['percentage'] >= 50: | |
| timeline = "3-6 months for refresh" | |
| else: | |
| timeline = "6+ months for overhaul" | |
| st.info(f"β±οΈ {timeline}") | |
| # Export options | |
| st.markdown("**Export Results:**") | |
| # Generate report data | |
| report_data = { | |
| "assessment_date": datetime.now().strftime("%Y-%m-%d %H:%M:%S"), | |
| "overall_score": results, | |
| "answers": st.session_state["answers"], | |
| "recommendations": recommendations, | |
| "problem_areas": problem_areas | |
| } | |
| report_json = json.dumps(report_data, indent=2) | |
| st.download_button( | |
| label="π Download Full Report", | |
| data=report_json, | |
| file_name=f"training_assessment_{int(time.time())}.json", | |
| mime="application/json", | |
| use_container_width=True | |
| ) | |
| # Action buttons | |
| st.markdown("---") | |
| col_b1, col_b2, col_b3 = st.columns([1, 1, 1]) | |
| with col_b1: | |
| if st.button("π Take Assessment Again", use_container_width=True): | |
| # Reset session state | |
| st.session_state["assessment_complete"] = False | |
| st.session_state["current_question"] = 0 | |
| st.session_state["answers"] = {} | |
| st.session_state["assessment_results"] = None | |
| st.rerun() | |
| with col_b2: | |
| if st.button("π View Question Summary", use_container_width=True): | |
| with st.expander("Question & Answer Summary", expanded=True): | |
| for i, q in enumerate(ASSESSMENT_QUESTIONS): | |
| answer_score = st.session_state["answers"].get(q["id"], 0) | |
| # Find the answer text | |
| answer_text = "Not answered" | |
| for option_text, score in q["options"]: | |
| if score == answer_score: | |
| answer_text = option_text | |
| break | |
| st.markdown(f"**Q{i+1}: {q['question']}**") | |
| st.markdown(f"*Answer: {answer_text}* (Score: {answer_score}/5)") | |
| st.markdown("---") | |
| with col_b3: | |
| # Placeholder for future feature | |
| st.button("π¬ Get Expert Consultation", disabled=True, use_container_width=True, help="Coming soon - connect with training experts") | |
| # Footer | |
| st.markdown(""" | |
| <div class="footnote"> | |
| <p><strong>Disclaimer:</strong> This assessment provides general guidance based on common training best practices. Results may vary based on your specific context, industry, and organizational needs. Consider consulting with training professionals for detailed content strategy.</p> | |
| <p><strong>Pro Tip:</strong> Save your results and retake this assessment quarterly to track your training content health over time!</p> | |
| </div> | |
| """, unsafe_allow_html=True) |