Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,12 +2,12 @@ import streamlit as st
|
|
| 2 |
import json
|
| 3 |
import time
|
| 4 |
import random
|
| 5 |
-
from datetime import datetime
|
| 6 |
|
| 7 |
# Set page config
|
| 8 |
st.set_page_config(
|
| 9 |
-
page_title="Training
|
| 10 |
-
page_icon="
|
| 11 |
layout="wide",
|
| 12 |
initial_sidebar_state="collapsed"
|
| 13 |
)
|
|
@@ -35,102 +35,12 @@ st.markdown("""
|
|
| 35 |
margin-bottom: 10px;
|
| 36 |
font-weight: 600;
|
| 37 |
}
|
| 38 |
-
.
|
| 39 |
border: 1px solid #ddd;
|
| 40 |
border-radius: 5px;
|
| 41 |
padding: 20px;
|
| 42 |
background-color: white;
|
| 43 |
-
|
| 44 |
-
}
|
| 45 |
-
.status-card {
|
| 46 |
-
border: 2px solid #e0e0e0;
|
| 47 |
-
border-radius: 12px;
|
| 48 |
-
padding: 20px;
|
| 49 |
-
margin-bottom: 20px;
|
| 50 |
-
text-align: center;
|
| 51 |
-
}
|
| 52 |
-
.status-excellent {
|
| 53 |
-
border-color: #28a745;
|
| 54 |
-
background-color: #f8fff9;
|
| 55 |
-
}
|
| 56 |
-
.status-good {
|
| 57 |
-
border-color: #ffc107;
|
| 58 |
-
background-color: #fffdf0;
|
| 59 |
-
}
|
| 60 |
-
.status-needs-attention {
|
| 61 |
-
border-color: #fd7e14;
|
| 62 |
-
background-color: #fff8f0;
|
| 63 |
-
}
|
| 64 |
-
.status-critical {
|
| 65 |
-
border-color: #dc3545;
|
| 66 |
-
background-color: #fff5f5;
|
| 67 |
-
}
|
| 68 |
-
.status-title {
|
| 69 |
-
font-size: 1.8rem;
|
| 70 |
-
font-weight: 700;
|
| 71 |
-
margin-bottom: 10px;
|
| 72 |
-
}
|
| 73 |
-
.status-description {
|
| 74 |
-
font-size: 1.1rem;
|
| 75 |
-
margin-bottom: 15px;
|
| 76 |
-
}
|
| 77 |
-
.status-score {
|
| 78 |
-
font-size: 2.5rem;
|
| 79 |
-
font-weight: 800;
|
| 80 |
-
margin-bottom: 10px;
|
| 81 |
-
}
|
| 82 |
-
.recommendation-card {
|
| 83 |
-
border: 1px solid #e0e0e0;
|
| 84 |
-
border-radius: 8px;
|
| 85 |
-
padding: 15px;
|
| 86 |
-
margin-bottom: 15px;
|
| 87 |
-
background-color: #fafafa;
|
| 88 |
-
}
|
| 89 |
-
.recommendation-title {
|
| 90 |
-
font-size: 1.1rem;
|
| 91 |
-
font-weight: 600;
|
| 92 |
-
color: #2c3e50;
|
| 93 |
-
margin-bottom: 8px;
|
| 94 |
-
}
|
| 95 |
-
.priority-high {
|
| 96 |
-
border-left: 4px solid #dc3545;
|
| 97 |
-
}
|
| 98 |
-
.priority-medium {
|
| 99 |
-
border-left: 4px solid #ffc107;
|
| 100 |
-
}
|
| 101 |
-
.priority-low {
|
| 102 |
-
border-left: 4px solid #28a745;
|
| 103 |
-
}
|
| 104 |
-
.question-card {
|
| 105 |
-
background-color: white;
|
| 106 |
-
border: 1px solid #e0e0e0;
|
| 107 |
-
border-radius: 8px;
|
| 108 |
-
padding: 20px;
|
| 109 |
-
margin-bottom: 20px;
|
| 110 |
-
}
|
| 111 |
-
.question-number {
|
| 112 |
-
background-color: #007bff;
|
| 113 |
-
color: white;
|
| 114 |
-
border-radius: 50%;
|
| 115 |
-
width: 30px;
|
| 116 |
-
height: 30px;
|
| 117 |
-
display: inline-flex;
|
| 118 |
-
align-items: center;
|
| 119 |
-
justify-content: center;
|
| 120 |
-
font-weight: 600;
|
| 121 |
-
margin-right: 10px;
|
| 122 |
-
}
|
| 123 |
-
.progress-bar {
|
| 124 |
-
height: 8px;
|
| 125 |
-
background-color: #e9ecef;
|
| 126 |
-
border-radius: 4px;
|
| 127 |
-
overflow: hidden;
|
| 128 |
-
margin-bottom: 20px;
|
| 129 |
-
}
|
| 130 |
-
.progress-fill {
|
| 131 |
-
height: 100%;
|
| 132 |
-
background-color: #007bff;
|
| 133 |
-
transition: width 0.3s ease;
|
| 134 |
}
|
| 135 |
.stButton button {
|
| 136 |
width: 100%;
|
|
@@ -140,6 +50,18 @@ st.markdown("""
|
|
| 140 |
color: #6c757d;
|
| 141 |
margin-top: 2rem;
|
| 142 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 143 |
.placeholder-area {
|
| 144 |
border: 2px dashed #ddd;
|
| 145 |
border-radius: 10px;
|
|
@@ -148,27 +70,43 @@ st.markdown("""
|
|
| 148 |
background-color: #f8f9fa;
|
| 149 |
color: #666;
|
| 150 |
}
|
| 151 |
-
.
|
| 152 |
-
display: flex;
|
| 153 |
-
justify-content: space-around;
|
| 154 |
-
margin: 20px 0;
|
| 155 |
-
}
|
| 156 |
-
.stat-item {
|
| 157 |
-
text-align: center;
|
| 158 |
-
padding: 15px;
|
| 159 |
background-color: #f8f9fa;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 160 |
border-radius: 8px;
|
| 161 |
-
margin:
|
| 162 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 163 |
}
|
| 164 |
-
.
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
|
|
|
|
|
|
|
|
|
| 168 |
}
|
| 169 |
-
.
|
| 170 |
-
|
| 171 |
-
color:
|
|
|
|
|
|
|
|
|
|
|
|
|
| 172 |
}
|
| 173 |
</style>
|
| 174 |
""", unsafe_allow_html=True)
|
|
@@ -176,585 +114,464 @@ st.markdown("""
|
|
| 176 |
# Title and description
|
| 177 |
st.markdown("""
|
| 178 |
<div class="title-area">
|
| 179 |
-
<h1>Training
|
| 180 |
-
<p>
|
| 181 |
</div>
|
| 182 |
""", unsafe_allow_html=True)
|
| 183 |
|
| 184 |
# Initialize session state
|
| 185 |
-
if "
|
| 186 |
-
st.session_state["
|
| 187 |
-
if "
|
| 188 |
-
st.session_state["
|
| 189 |
-
if "answers" not in st.session_state:
|
| 190 |
-
st.session_state["answers"] = {}
|
| 191 |
-
if "assessment_results" not in st.session_state:
|
| 192 |
-
st.session_state["assessment_results"] = None
|
| 193 |
|
| 194 |
-
#
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
|
| 198 |
-
"
|
| 199 |
-
"
|
| 200 |
-
"
|
| 201 |
-
|
| 202 |
-
|
| 203 |
-
|
| 204 |
-
("2-3 years ago", 2),
|
| 205 |
-
("More than 3 years ago", 1)
|
| 206 |
-
],
|
| 207 |
-
"help": "Newer content is generally more relevant and effective"
|
| 208 |
-
},
|
| 209 |
-
{
|
| 210 |
-
"id": "industry_changes",
|
| 211 |
-
"question": "Have there been significant changes in your industry since the content was created?",
|
| 212 |
-
"type": "single_choice",
|
| 213 |
-
"options": [
|
| 214 |
-
("No significant changes", 5),
|
| 215 |
-
("Minor changes that don't affect the content", 4),
|
| 216 |
-
("Some changes that might impact relevance", 3),
|
| 217 |
-
("Significant changes that likely impact content", 2),
|
| 218 |
-
("Major industry transformation", 1)
|
| 219 |
-
],
|
| 220 |
-
"help": "Industry evolution can quickly make training content obsolete"
|
| 221 |
-
},
|
| 222 |
-
{
|
| 223 |
-
"id": "technology_updates",
|
| 224 |
-
"question": "If your training involves technology or software, how current are the versions covered?",
|
| 225 |
-
"type": "single_choice",
|
| 226 |
-
"options": [
|
| 227 |
-
("Current/latest versions", 5),
|
| 228 |
-
("One version behind", 4),
|
| 229 |
-
("2-3 versions behind", 3),
|
| 230 |
-
("Significantly outdated versions", 2),
|
| 231 |
-
("Legacy/deprecated technology", 1),
|
| 232 |
-
("Not applicable - no technology involved", 5)
|
| 233 |
-
],
|
| 234 |
-
"help": "Technology training needs frequent updates to remain useful"
|
| 235 |
-
},
|
| 236 |
-
{
|
| 237 |
-
"id": "learner_feedback",
|
| 238 |
-
"question": "What kind of feedback do you receive from learners about the content?",
|
| 239 |
-
"type": "single_choice",
|
| 240 |
-
"options": [
|
| 241 |
-
("Consistently positive and engaged", 5),
|
| 242 |
-
("Mostly positive with minor suggestions", 4),
|
| 243 |
-
("Mixed feedback - some find it helpful", 3),
|
| 244 |
-
("Frequent complaints about relevance", 2),
|
| 245 |
-
("Learners find it outdated or unhelpful", 1)
|
| 246 |
-
],
|
| 247 |
-
"help": "Learner feedback is a key indicator of content effectiveness"
|
| 248 |
-
},
|
| 249 |
-
{
|
| 250 |
-
"id": "completion_rates",
|
| 251 |
-
"question": "How are your training completion rates?",
|
| 252 |
-
"type": "single_choice",
|
| 253 |
-
"options": [
|
| 254 |
-
("80%+ completion rate", 5),
|
| 255 |
-
("60-79% completion rate", 4),
|
| 256 |
-
("40-59% completion rate", 3),
|
| 257 |
-
("20-39% completion rate", 2),
|
| 258 |
-
("Below 20% completion rate", 1),
|
| 259 |
-
("Don't track completion rates", 2)
|
| 260 |
-
],
|
| 261 |
-
"help": "Low completion rates often indicate content problems"
|
| 262 |
-
},
|
| 263 |
-
{
|
| 264 |
-
"id": "performance_impact",
|
| 265 |
-
"question": "Can you measure improved job performance after training?",
|
| 266 |
-
"type": "single_choice",
|
| 267 |
-
"options": [
|
| 268 |
-
("Clear performance improvements measured", 5),
|
| 269 |
-
("Some improvements observed", 4),
|
| 270 |
-
("Minimal or unclear impact", 3),
|
| 271 |
-
("No measurable improvement", 2),
|
| 272 |
-
("Performance may have declined", 1)
|
| 273 |
-
],
|
| 274 |
-
"help": "Effective training should lead to measurable performance gains"
|
| 275 |
-
},
|
| 276 |
-
{
|
| 277 |
-
"id": "content_format",
|
| 278 |
-
"question": "How well does your content format match current learner preferences?",
|
| 279 |
-
"type": "single_choice",
|
| 280 |
-
"options": [
|
| 281 |
-
("Perfect match - modern, engaging format", 5),
|
| 282 |
-
("Good match with minor format updates needed", 4),
|
| 283 |
-
("Adequate but could be more engaging", 3),
|
| 284 |
-
("Format feels somewhat outdated", 2),
|
| 285 |
-
("Very outdated format (old videos, static PDFs)", 1)
|
| 286 |
-
],
|
| 287 |
-
"help": "Learning preferences evolve - mobile, interactive, bite-sized content is preferred"
|
| 288 |
-
},
|
| 289 |
-
{
|
| 290 |
-
"id": "compliance_requirements",
|
| 291 |
-
"question": "Are there new compliance or regulatory requirements affecting your training?",
|
| 292 |
-
"type": "single_choice",
|
| 293 |
-
"options": [
|
| 294 |
-
("No new requirements", 5),
|
| 295 |
-
("Minor updates needed for compliance", 4),
|
| 296 |
-
("Some new requirements to incorporate", 3),
|
| 297 |
-
("Significant compliance changes needed", 2),
|
| 298 |
-
("Major regulatory overhaul required", 1),
|
| 299 |
-
("Not applicable - no compliance requirements", 5)
|
| 300 |
-
],
|
| 301 |
-
"help": "Regulatory changes can make training content non-compliant"
|
| 302 |
-
},
|
| 303 |
-
{
|
| 304 |
-
"id": "accessibility",
|
| 305 |
-
"question": "Does your content meet current accessibility standards?",
|
| 306 |
-
"type": "single_choice",
|
| 307 |
-
"options": [
|
| 308 |
-
("Fully accessible and compliant", 5),
|
| 309 |
-
("Mostly accessible with minor gaps", 4),
|
| 310 |
-
("Some accessibility features missing", 3),
|
| 311 |
-
("Limited accessibility support", 2),
|
| 312 |
-
("Not designed with accessibility in mind", 1)
|
| 313 |
-
],
|
| 314 |
-
"help": "Accessibility standards have evolved significantly in recent years"
|
| 315 |
-
},
|
| 316 |
-
{
|
| 317 |
-
"id": "competitive_benchmark",
|
| 318 |
-
"question": "How does your training content compare to industry standards or competitors?",
|
| 319 |
-
"type": "single_choice",
|
| 320 |
-
"options": [
|
| 321 |
-
("Industry-leading quality and innovation", 5),
|
| 322 |
-
("Above average compared to competitors", 4),
|
| 323 |
-
("On par with industry standards", 3),
|
| 324 |
-
("Below average - competitors have better content", 2),
|
| 325 |
-
("Significantly behind industry standards", 1)
|
| 326 |
-
],
|
| 327 |
-
"help": "Staying competitive requires keeping up with industry training standards"
|
| 328 |
}
|
| 329 |
-
|
| 330 |
-
|
| 331 |
-
|
| 332 |
-
|
| 333 |
-
|
| 334 |
-
|
| 335 |
-
percentage = (total_score / max_possible) * 100
|
| 336 |
-
|
| 337 |
-
# Determine status based on percentage
|
| 338 |
-
if percentage >= 85:
|
| 339 |
-
status = "Still Sharp"
|
| 340 |
-
status_class = "status-excellent"
|
| 341 |
-
status_emoji = "π"
|
| 342 |
-
status_color = "#28a745"
|
| 343 |
-
elif percentage >= 70:
|
| 344 |
-
status = "Minor Tune-Up"
|
| 345 |
-
status_class = "status-good"
|
| 346 |
-
status_emoji = "β
"
|
| 347 |
-
status_color = "#ffc107"
|
| 348 |
-
elif percentage >= 50:
|
| 349 |
-
status = "Needs Refresh"
|
| 350 |
-
status_class = "status-needs-attention"
|
| 351 |
-
status_emoji = "β οΈ"
|
| 352 |
-
status_color = "#fd7e14"
|
| 353 |
-
else:
|
| 354 |
-
status = "Critical Update"
|
| 355 |
-
status_class = "status-critical"
|
| 356 |
-
status_emoji = "π¨"
|
| 357 |
-
status_color = "#dc3545"
|
| 358 |
-
|
| 359 |
-
return {
|
| 360 |
-
"score": total_score,
|
| 361 |
-
"percentage": percentage,
|
| 362 |
-
"status": status,
|
| 363 |
-
"status_class": status_class,
|
| 364 |
-
"status_emoji": status_emoji,
|
| 365 |
-
"status_color": status_color,
|
| 366 |
-
"max_possible": max_possible
|
| 367 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 368 |
|
| 369 |
-
def
|
| 370 |
-
"""Generate
|
| 371 |
-
|
| 372 |
|
| 373 |
-
#
|
| 374 |
-
|
| 375 |
-
|
| 376 |
-
# Check content age
|
| 377 |
-
if answers.get("content_age", 5) <= 2:
|
| 378 |
-
problem_areas.append("content_age")
|
| 379 |
-
recommendations.append({
|
| 380 |
-
"title": "Update Content Immediately",
|
| 381 |
-
"description": "Your content is significantly outdated. Plan a comprehensive content refresh within the next 2-3 months.",
|
| 382 |
-
"priority": "high",
|
| 383 |
-
"action_items": [
|
| 384 |
-
"Audit all training materials for accuracy",
|
| 385 |
-
"Research current industry best practices",
|
| 386 |
-
"Create a content update timeline",
|
| 387 |
-
"Consider outsourcing content development if needed"
|
| 388 |
-
]
|
| 389 |
-
})
|
| 390 |
|
| 391 |
-
|
| 392 |
-
|
| 393 |
-
|
| 394 |
-
|
| 395 |
-
|
| 396 |
-
"
|
| 397 |
-
|
| 398 |
-
"
|
| 399 |
-
|
| 400 |
-
|
| 401 |
-
"Establish regular technology review schedule"
|
| 402 |
-
]
|
| 403 |
-
})
|
| 404 |
|
| 405 |
-
#
|
| 406 |
-
if
|
| 407 |
-
|
| 408 |
-
|
| 409 |
-
"
|
| 410 |
-
"
|
| 411 |
-
|
| 412 |
-
"action_items": [
|
| 413 |
-
"Survey learners for specific feedback",
|
| 414 |
-
"Consider interactive content formats",
|
| 415 |
-
"Break content into smaller, digestible modules",
|
| 416 |
-
"Add gamification elements"
|
| 417 |
-
]
|
| 418 |
-
})
|
| 419 |
|
| 420 |
-
#
|
| 421 |
-
|
| 422 |
-
|
| 423 |
-
|
| 424 |
-
|
| 425 |
-
"description": "Update your content format to match current learner preferences.",
|
| 426 |
-
"priority": "medium",
|
| 427 |
-
"action_items": [
|
| 428 |
-
"Convert static content to interactive formats",
|
| 429 |
-
"Optimize for mobile devices",
|
| 430 |
-
"Add video and multimedia elements",
|
| 431 |
-
"Create bite-sized learning modules"
|
| 432 |
-
]
|
| 433 |
-
})
|
| 434 |
|
| 435 |
-
#
|
| 436 |
-
|
| 437 |
-
|
| 438 |
-
|
| 439 |
-
|
| 440 |
-
|
| 441 |
-
"priority": "high",
|
| 442 |
-
"action_items": [
|
| 443 |
-
"Review current compliance requirements",
|
| 444 |
-
"Update content to meet new standards",
|
| 445 |
-
"Document compliance coverage",
|
| 446 |
-
"Schedule regular compliance reviews"
|
| 447 |
-
]
|
| 448 |
-
})
|
| 449 |
|
| 450 |
-
#
|
| 451 |
-
|
| 452 |
-
|
| 453 |
-
|
| 454 |
-
"title":
|
| 455 |
-
"
|
| 456 |
-
"
|
| 457 |
-
"action_items": [
|
| 458 |
-
"Conduct accessibility audit",
|
| 459 |
-
"Add captions to videos",
|
| 460 |
-
"Ensure screen reader compatibility",
|
| 461 |
-
"Provide alternative formats"
|
| 462 |
-
]
|
| 463 |
})
|
| 464 |
|
| 465 |
-
#
|
| 466 |
-
if
|
| 467 |
-
|
| 468 |
-
"title": "
|
| 469 |
-
"
|
| 470 |
-
"
|
| 471 |
-
"action_items": [
|
| 472 |
-
"Define success metrics",
|
| 473 |
-
"Implement tracking systems",
|
| 474 |
-
"Conduct pre/post assessments",
|
| 475 |
-
"Regular performance reviews"
|
| 476 |
-
]
|
| 477 |
})
|
| 478 |
|
| 479 |
-
|
| 480 |
-
|
| 481 |
-
|
| 482 |
-
|
| 483 |
-
|
| 484 |
-
|
| 485 |
-
|
| 486 |
-
|
| 487 |
-
|
| 488 |
-
|
| 489 |
-
|
| 490 |
-
|
| 491 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 492 |
|
| 493 |
-
return
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 494 |
|
| 495 |
# Main content
|
| 496 |
-
|
| 497 |
-
|
| 498 |
-
|
|
|
|
| 499 |
|
| 500 |
-
|
| 501 |
-
|
| 502 |
-
|
| 503 |
-
|
| 504 |
-
|
| 505 |
-
|
| 506 |
-
|
| 507 |
-
|
| 508 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 509 |
|
| 510 |
-
|
| 511 |
-
|
| 512 |
-
|
| 513 |
-
|
| 514 |
-
|
| 515 |
-
|
| 516 |
-
|
| 517 |
-
<span class="question-number">{st.session_state["current_question"] + 1}</span>
|
| 518 |
-
<h3 style="margin: 0;">{current_q["question"]}</h3>
|
| 519 |
-
</div>
|
| 520 |
-
""", unsafe_allow_html=True)
|
| 521 |
|
| 522 |
-
|
| 523 |
-
|
| 524 |
-
|
| 525 |
-
|
| 526 |
-
|
| 527 |
-
|
| 528 |
-
|
| 529 |
-
|
| 530 |
-
|
| 531 |
-
|
| 532 |
-
|
| 533 |
-
|
| 534 |
-
if option_text == answer:
|
| 535 |
-
selected_score = score
|
| 536 |
-
break
|
| 537 |
-
|
| 538 |
-
if selected_score is not None:
|
| 539 |
-
st.session_state["answers"][current_q["id"]] = selected_score
|
| 540 |
-
|
| 541 |
-
st.markdown('</div>', unsafe_allow_html=True)
|
| 542 |
-
|
| 543 |
-
# Navigation buttons
|
| 544 |
-
col_prev, col_next = st.columns([1, 1])
|
| 545 |
-
|
| 546 |
-
with col_prev:
|
| 547 |
-
if st.session_state["current_question"] > 0:
|
| 548 |
-
if st.button("β¬
οΈ Previous", use_container_width=True):
|
| 549 |
-
st.session_state["current_question"] -= 1
|
| 550 |
-
st.rerun()
|
| 551 |
|
| 552 |
-
|
| 553 |
-
|
| 554 |
-
|
| 555 |
-
|
| 556 |
-
|
| 557 |
-
else:
|
| 558 |
-
if st.button("π Get My Results", use_container_width=True):
|
| 559 |
-
st.session_state["assessment_complete"] = True
|
| 560 |
-
st.session_state["assessment_results"] = calculate_assessment_score(st.session_state["answers"])
|
| 561 |
-
st.rerun()
|
| 562 |
-
|
| 563 |
-
with col2:
|
| 564 |
-
st.markdown('<div class="custom-subheader">Assessment Overview</div>', unsafe_allow_html=True)
|
| 565 |
|
| 566 |
-
|
| 567 |
-
|
| 568 |
-
|
| 569 |
-
|
| 570 |
-
|
| 571 |
-
|
| 572 |
-
|
| 573 |
-
|
| 574 |
-
|
| 575 |
-
|
| 576 |
-
|
| 577 |
-
|
| 578 |
-
|
| 579 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 580 |
|
| 581 |
-
|
| 582 |
-
|
| 583 |
-
|
| 584 |
-
|
| 585 |
-
|
| 586 |
-
|
| 587 |
-
|
| 588 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 589 |
]
|
| 590 |
|
| 591 |
-
for
|
| 592 |
-
st.
|
|
|
|
|
|
|
| 593 |
|
| 594 |
-
|
| 595 |
-
|
| 596 |
-
|
| 597 |
-
|
| 598 |
-
|
| 599 |
-
|
| 600 |
-
|
| 601 |
-
|
| 602 |
-
|
| 603 |
-
""")
|
| 604 |
-
|
| 605 |
-
else:
|
| 606 |
-
# Results display
|
| 607 |
-
results = st.session_state["assessment_results"]
|
| 608 |
-
recommendations, problem_areas = generate_recommendations(st.session_state["answers"], results)
|
| 609 |
-
|
| 610 |
-
# Status card
|
| 611 |
-
st.markdown(f"""
|
| 612 |
-
<div class="status-card {results['status_class']}">
|
| 613 |
-
<div class="status-score" style="color: {results['status_color']}">
|
| 614 |
-
{results['status_emoji']} {results['percentage']:.0f}%
|
| 615 |
-
</div>
|
| 616 |
-
<div class="status-title" style="color: {results['status_color']}">
|
| 617 |
-
{results['status']}
|
| 618 |
-
</div>
|
| 619 |
-
<div class="status-description">
|
| 620 |
-
You scored {results['score']} out of {results['max_possible']} points
|
| 621 |
-
</div>
|
| 622 |
-
</div>
|
| 623 |
-
""", unsafe_allow_html=True)
|
| 624 |
-
|
| 625 |
-
# Status-specific messages
|
| 626 |
-
status_messages = {
|
| 627 |
-
"Still Sharp": "Excellent! Your training content is current and effective. Focus on maintenance and continuous improvement.",
|
| 628 |
-
"Minor Tune-Up": "Good foundation! Your content is mostly current but could benefit from some updates to stay competitive.",
|
| 629 |
-
"Needs Refresh": "Time for updates! Your content has some outdated elements that are impacting effectiveness.",
|
| 630 |
-
"Critical Update": "Immediate action needed! Your content requires significant updates to remain valuable and relevant."
|
| 631 |
-
}
|
| 632 |
|
| 633 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 634 |
|
| 635 |
-
|
| 636 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 637 |
|
| 638 |
-
|
| 639 |
-
st.
|
| 640 |
|
| 641 |
-
|
| 642 |
-
high_priority = [r for r in recommendations if r["priority"] == "high"]
|
| 643 |
-
medium_priority = [r for r in recommendations if r["priority"] == "medium"]
|
| 644 |
-
low_priority = [r for r in recommendations if r["priority"] == "low"]
|
| 645 |
|
| 646 |
-
|
| 647 |
-
|
| 648 |
-
|
| 649 |
-
|
| 650 |
-
|
| 651 |
-
|
| 652 |
-
st.markdown(f'<p>{rec["description"]}</p>', unsafe_allow_html=True)
|
| 653 |
-
|
| 654 |
-
if rec["action_items"]:
|
| 655 |
-
st.markdown("**Action Items:**")
|
| 656 |
-
for item in rec["action_items"]:
|
| 657 |
-
st.markdown(f"β’ {item}")
|
| 658 |
-
|
| 659 |
-
st.markdown('</div>', unsafe_allow_html=True)
|
| 660 |
-
|
| 661 |
-
with col2:
|
| 662 |
-
st.markdown('<div class="custom-subheader">π Detailed Breakdown</div>', unsafe_allow_html=True)
|
| 663 |
|
| 664 |
-
# Score
|
| 665 |
-
|
| 666 |
-
|
| 667 |
-
|
| 668 |
-
|
|
|
|
|
|
|
|
|
|
| 669 |
|
| 670 |
-
#
|
| 671 |
-
|
| 672 |
-
|
| 673 |
-
|
| 674 |
-
|
| 675 |
-
"technology": "π» Technology Currency",
|
| 676 |
-
"engagement": "π₯ Learner Engagement",
|
| 677 |
-
"format": "π¨ Content Format",
|
| 678 |
-
"compliance": "π Compliance",
|
| 679 |
-
"accessibility": "βΏ Accessibility"
|
| 680 |
-
}
|
| 681 |
-
|
| 682 |
-
for area in problem_areas:
|
| 683 |
-
if area in area_labels:
|
| 684 |
-
st.markdown(f"β’ {area_labels[area]}")
|
| 685 |
|
| 686 |
-
#
|
| 687 |
-
st.markdown("
|
| 688 |
-
|
| 689 |
-
|
| 690 |
-
|
| 691 |
-
|
| 692 |
-
|
| 693 |
-
|
| 694 |
-
|
| 695 |
-
|
|
|
|
| 696 |
|
| 697 |
-
|
|
|
|
|
|
|
|
|
|
| 698 |
|
| 699 |
-
#
|
| 700 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 701 |
|
| 702 |
-
|
| 703 |
-
report_data = {
|
| 704 |
-
"assessment_date": datetime.now().strftime("%Y-%m-%d %H:%M:%S"),
|
| 705 |
-
"overall_score": results,
|
| 706 |
-
"answers": st.session_state["answers"],
|
| 707 |
-
"recommendations": recommendations,
|
| 708 |
-
"problem_areas": problem_areas
|
| 709 |
-
}
|
| 710 |
|
| 711 |
-
|
|
|
|
| 712 |
|
| 713 |
-
|
| 714 |
-
|
| 715 |
-
|
| 716 |
-
|
| 717 |
-
|
| 718 |
-
|
| 719 |
-
|
| 720 |
-
|
| 721 |
-
|
| 722 |
-
|
| 723 |
-
|
| 724 |
-
|
| 725 |
-
|
| 726 |
-
|
| 727 |
-
|
| 728 |
-
|
| 729 |
-
|
| 730 |
-
|
| 731 |
-
|
| 732 |
-
st.rerun()
|
| 733 |
-
|
| 734 |
-
with col_b2:
|
| 735 |
-
if st.button("π View Question Summary", use_container_width=True):
|
| 736 |
-
with st.expander("Question & Answer Summary", expanded=True):
|
| 737 |
-
for i, q in enumerate(ASSESSMENT_QUESTIONS):
|
| 738 |
-
answer_score = st.session_state["answers"].get(q["id"], 0)
|
| 739 |
-
# Find the answer text
|
| 740 |
-
answer_text = "Not answered"
|
| 741 |
-
for option_text, score in q["options"]:
|
| 742 |
-
if score == answer_score:
|
| 743 |
-
answer_text = option_text
|
| 744 |
-
break
|
| 745 |
|
| 746 |
-
|
| 747 |
-
|
| 748 |
-
st.
|
| 749 |
-
|
| 750 |
-
|
| 751 |
-
|
| 752 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 753 |
|
| 754 |
# Footer
|
| 755 |
st.markdown("""
|
| 756 |
<div class="footnote">
|
| 757 |
-
<p><strong>
|
| 758 |
-
<p><strong>Pro Tip:</strong> Save your results and retake this assessment quarterly to track your training content health over time!</p>
|
| 759 |
</div>
|
| 760 |
""", unsafe_allow_html=True)
|
|
|
|
| 2 |
import json
|
| 3 |
import time
|
| 4 |
import random
|
| 5 |
+
from datetime import datetime
|
| 6 |
|
| 7 |
# Set page config
|
| 8 |
st.set_page_config(
|
| 9 |
+
page_title="Training Course Outline Generator",
|
| 10 |
+
page_icon="π",
|
| 11 |
layout="wide",
|
| 12 |
initial_sidebar_state="collapsed"
|
| 13 |
)
|
|
|
|
| 35 |
margin-bottom: 10px;
|
| 36 |
font-weight: 600;
|
| 37 |
}
|
| 38 |
+
.generated-outline {
|
| 39 |
border: 1px solid #ddd;
|
| 40 |
border-radius: 5px;
|
| 41 |
padding: 20px;
|
| 42 |
background-color: white;
|
| 43 |
+
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
}
|
| 45 |
.stButton button {
|
| 46 |
width: 100%;
|
|
|
|
| 50 |
color: #6c757d;
|
| 51 |
margin-top: 2rem;
|
| 52 |
}
|
| 53 |
+
.settings-section {
|
| 54 |
+
background-color: #f8f9fa;
|
| 55 |
+
padding: 15px;
|
| 56 |
+
border-radius: 5px;
|
| 57 |
+
margin-bottom: 20px;
|
| 58 |
+
}
|
| 59 |
+
.examples-section {
|
| 60 |
+
background-color: #e9f7fe;
|
| 61 |
+
padding: 15px;
|
| 62 |
+
border-radius: 5px;
|
| 63 |
+
margin-bottom: 20px;
|
| 64 |
+
}
|
| 65 |
.placeholder-area {
|
| 66 |
border: 2px dashed #ddd;
|
| 67 |
border-radius: 10px;
|
|
|
|
| 70 |
background-color: #f8f9fa;
|
| 71 |
color: #666;
|
| 72 |
}
|
| 73 |
+
.metric-card {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 74 |
background-color: #f8f9fa;
|
| 75 |
+
padding: 15px;
|
| 76 |
+
border-radius: 8px;
|
| 77 |
+
border-left: 4px solid #007bff;
|
| 78 |
+
margin-bottom: 15px;
|
| 79 |
+
}
|
| 80 |
+
.outline-section {
|
| 81 |
+
background-color: #ffffff;
|
| 82 |
+
padding: 20px;
|
| 83 |
border-radius: 8px;
|
| 84 |
+
margin-bottom: 20px;
|
| 85 |
+
border: 1px solid #e9ecef;
|
| 86 |
+
}
|
| 87 |
+
.success-indicator {
|
| 88 |
+
background-color: #d4edda;
|
| 89 |
+
color: #155724;
|
| 90 |
+
padding: 10px;
|
| 91 |
+
border-radius: 5px;
|
| 92 |
+
border: 1px solid #c3e6cb;
|
| 93 |
+
margin-bottom: 15px;
|
| 94 |
}
|
| 95 |
+
.recommendation {
|
| 96 |
+
background-color: #fff3cd;
|
| 97 |
+
color: #856404;
|
| 98 |
+
padding: 15px;
|
| 99 |
+
border-radius: 5px;
|
| 100 |
+
border: 1px solid #ffeaa7;
|
| 101 |
+
margin-top: 15px;
|
| 102 |
}
|
| 103 |
+
.partnership-cta {
|
| 104 |
+
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
| 105 |
+
color: white;
|
| 106 |
+
padding: 20px;
|
| 107 |
+
border-radius: 10px;
|
| 108 |
+
text-align: center;
|
| 109 |
+
margin-top: 20px;
|
| 110 |
}
|
| 111 |
</style>
|
| 112 |
""", unsafe_allow_html=True)
|
|
|
|
| 114 |
# Title and description
|
| 115 |
st.markdown("""
|
| 116 |
<div class="title-area">
|
| 117 |
+
<h1>Training Course Outline Generator π</h1>
|
| 118 |
+
<p>Transform your training ideas into structured, actionable course outlines. Perfect for L&D leaders planning their next training initiative!</p>
|
| 119 |
</div>
|
| 120 |
""", unsafe_allow_html=True)
|
| 121 |
|
| 122 |
# Initialize session state
|
| 123 |
+
if "generated_outline" not in st.session_state:
|
| 124 |
+
st.session_state["generated_outline"] = None
|
| 125 |
+
if "course_history" not in st.session_state:
|
| 126 |
+
st.session_state["course_history"] = []
|
|
|
|
|
|
|
|
|
|
|
|
|
| 127 |
|
| 128 |
+
# Helper functions
|
| 129 |
+
def calculate_estimated_duration(delivery_method, content_depth, audience_size):
|
| 130 |
+
"""Calculate estimated course duration based on inputs"""
|
| 131 |
+
base_hours = {
|
| 132 |
+
"In-person workshop": 8,
|
| 133 |
+
"Virtual live session": 4,
|
| 134 |
+
"Self-paced online": 6,
|
| 135 |
+
"Blended learning": 12,
|
| 136 |
+
"Microlearning series": 2,
|
| 137 |
+
"On-the-job training": 16
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 138 |
}
|
| 139 |
+
|
| 140 |
+
depth_multiplier = {
|
| 141 |
+
"Basic overview": 0.7,
|
| 142 |
+
"Intermediate depth": 1.0,
|
| 143 |
+
"Advanced/comprehensive": 1.5,
|
| 144 |
+
"Expert level": 2.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 145 |
}
|
| 146 |
+
|
| 147 |
+
size_factor = 1.0
|
| 148 |
+
if audience_size == "Large group (20+)":
|
| 149 |
+
size_factor = 1.2
|
| 150 |
+
elif audience_size == "Small team (5-15)":
|
| 151 |
+
size_factor = 0.9
|
| 152 |
+
|
| 153 |
+
estimated = base_hours.get(delivery_method, 6) * depth_multiplier.get(content_depth, 1.0) * size_factor
|
| 154 |
+
return max(1, round(estimated))
|
| 155 |
|
| 156 |
+
def generate_learning_objectives(course_topic, target_audience, goals):
|
| 157 |
+
"""Generate sample learning objectives based on inputs"""
|
| 158 |
+
objectives = []
|
| 159 |
|
| 160 |
+
# Create objectives based on common learning patterns
|
| 161 |
+
action_verbs = ["identify", "analyze", "implement", "evaluate", "create", "demonstrate", "apply", "compare"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 162 |
|
| 163 |
+
if goals:
|
| 164 |
+
goal_keywords = goals.lower().split()
|
| 165 |
+
if any(word in goal_keywords for word in ["skill", "skills", "ability", "practice"]):
|
| 166 |
+
objectives.append(f"Demonstrate practical {course_topic.lower()} skills relevant to {target_audience.lower()}")
|
| 167 |
+
if any(word in goal_keywords for word in ["knowledge", "understand", "learn", "know"]):
|
| 168 |
+
objectives.append(f"Analyze key concepts and principles of {course_topic.lower()}")
|
| 169 |
+
if any(word in goal_keywords for word in ["improve", "enhance", "better", "increase"]):
|
| 170 |
+
objectives.append(f"Implement strategies to improve {course_topic.lower()} outcomes")
|
| 171 |
+
if any(word in goal_keywords for word in ["solve", "problem", "challenge", "issue"]):
|
| 172 |
+
objectives.append(f"Evaluate and solve common {course_topic.lower()} challenges")
|
|
|
|
|
|
|
|
|
|
| 173 |
|
| 174 |
+
# Add default objectives if none generated
|
| 175 |
+
if not objectives:
|
| 176 |
+
objectives = [
|
| 177 |
+
f"Apply {course_topic.lower()} best practices in real-world scenarios",
|
| 178 |
+
f"Identify key success factors for {course_topic.lower()}",
|
| 179 |
+
f"Create actionable plans for implementing {course_topic.lower()} strategies"
|
| 180 |
+
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 181 |
|
| 182 |
+
return objectives[:4] # Limit to 4 objectives
|
| 183 |
+
|
| 184 |
+
def generate_course_modules(course_topic, objectives, delivery_method):
|
| 185 |
+
"""Generate suggested course modules"""
|
| 186 |
+
modules = []
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 187 |
|
| 188 |
+
# Always start with introduction
|
| 189 |
+
modules.append({
|
| 190 |
+
"title": f"Introduction to {course_topic}",
|
| 191 |
+
"duration": "30-45 minutes",
|
| 192 |
+
"content": ["Course overview", "Learning objectives", "Participant introductions", "Setting expectations"]
|
| 193 |
+
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 194 |
|
| 195 |
+
# Generate core modules based on objectives
|
| 196 |
+
for i, objective in enumerate(objectives, 1):
|
| 197 |
+
module_title = f"Module {i}: {objective.split(' ', 1)[1].title()}"
|
| 198 |
+
modules.append({
|
| 199 |
+
"title": module_title,
|
| 200 |
+
"duration": "60-90 minutes",
|
| 201 |
+
"content": ["Theory and concepts", "Practical exercises", "Case studies", "Group discussions"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 202 |
})
|
| 203 |
|
| 204 |
+
# Add application/wrap-up module
|
| 205 |
+
if delivery_method in ["In-person workshop", "Virtual live session", "Blended learning"]:
|
| 206 |
+
modules.append({
|
| 207 |
+
"title": "Application & Action Planning",
|
| 208 |
+
"duration": "45-60 minutes",
|
| 209 |
+
"content": ["Real-world application", "Action planning", "Next steps", "Resources and support"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 210 |
})
|
| 211 |
|
| 212 |
+
return modules
|
| 213 |
+
|
| 214 |
+
def calculate_readiness_score(inputs):
|
| 215 |
+
"""Calculate a readiness score based on how complete the inputs are"""
|
| 216 |
+
score = 0
|
| 217 |
+
max_score = 100
|
| 218 |
+
|
| 219 |
+
# Core requirements (60 points)
|
| 220 |
+
if inputs.get('course_topic'): score += 15
|
| 221 |
+
if inputs.get('target_audience'): score += 15
|
| 222 |
+
if inputs.get('learning_goals'): score += 15
|
| 223 |
+
if inputs.get('delivery_method'): score += 15
|
| 224 |
+
|
| 225 |
+
# Additional details (40 points)
|
| 226 |
+
if inputs.get('available_content'): score += 10
|
| 227 |
+
if inputs.get('subject_matter_experts'): score += 10
|
| 228 |
+
if inputs.get('success_metrics'): score += 10
|
| 229 |
+
if inputs.get('timeline'): score += 5
|
| 230 |
+
if inputs.get('budget_range'): score += 5
|
| 231 |
|
| 232 |
+
return min(score, max_score)
|
| 233 |
+
|
| 234 |
+
def generate_recommendations(inputs, readiness_score):
|
| 235 |
+
"""Generate personalized recommendations"""
|
| 236 |
+
recommendations = []
|
| 237 |
+
|
| 238 |
+
if readiness_score < 60:
|
| 239 |
+
recommendations.append("π― **Priority**: Define clearer learning objectives and success metrics to strengthen your course foundation.")
|
| 240 |
+
|
| 241 |
+
if not inputs.get('subject_matter_experts'):
|
| 242 |
+
recommendations.append("π₯ **Expert Input**: Consider engaging subject matter experts early to ensure content accuracy and relevance.")
|
| 243 |
+
|
| 244 |
+
if inputs.get('delivery_method') == 'Self-paced online' and not inputs.get('available_content'):
|
| 245 |
+
recommendations.append("π **Content Strategy**: Self-paced courses require substantial pre-existing content. Plan for content creation resources.")
|
| 246 |
+
|
| 247 |
+
if inputs.get('target_audience') and 'manager' in inputs.get('target_audience', '').lower():
|
| 248 |
+
recommendations.append("β‘ **Manager Focus**: Consider shorter, action-oriented modules that respect managers' time constraints.")
|
| 249 |
+
|
| 250 |
+
if inputs.get('delivery_method') == 'Microlearning series':
|
| 251 |
+
recommendations.append("π± **Microlearning Tips**: Break content into 5-10 minute digestible chunks with clear takeaways.")
|
| 252 |
+
|
| 253 |
+
if readiness_score >= 80:
|
| 254 |
+
recommendations.append("π **Ready to Launch**: Your course outline is well-developed! Consider piloting with a small group first.")
|
| 255 |
+
|
| 256 |
+
return recommendations
|
| 257 |
|
| 258 |
# Main content
|
| 259 |
+
col1, col2 = st.columns([1, 1])
|
| 260 |
+
|
| 261 |
+
with col1:
|
| 262 |
+
st.markdown('<div class="custom-subheader">Course Planning Inputs</div>', unsafe_allow_html=True)
|
| 263 |
|
| 264 |
+
# Core course information
|
| 265 |
+
st.markdown("**π Core Course Information**")
|
| 266 |
+
|
| 267 |
+
course_topic = st.text_input(
|
| 268 |
+
"Course Topic/Subject",
|
| 269 |
+
placeholder="e.g., Leadership Development, Data Analysis, Customer Service",
|
| 270 |
+
help="What is the main subject or skill your course will cover?"
|
| 271 |
+
)
|
| 272 |
+
|
| 273 |
+
target_audience = st.text_input(
|
| 274 |
+
"Target Audience",
|
| 275 |
+
placeholder="e.g., New managers, Sales team, Customer support representatives",
|
| 276 |
+
help="Who are the learners? Be specific about their role, experience level, etc."
|
| 277 |
+
)
|
| 278 |
+
|
| 279 |
+
learning_goals = st.text_area(
|
| 280 |
+
"Learning Goals & Objectives",
|
| 281 |
+
placeholder="e.g., Improve team communication skills, reduce customer complaints by 20%, increase productivity",
|
| 282 |
+
height=100,
|
| 283 |
+
help="What should participants be able to do after completing the course?"
|
| 284 |
+
)
|
| 285 |
+
|
| 286 |
+
col_d1, col_d2 = st.columns(2)
|
| 287 |
+
with col_d1:
|
| 288 |
+
delivery_method = st.selectbox(
|
| 289 |
+
"Preferred Delivery Method",
|
| 290 |
+
["In-person workshop", "Virtual live session", "Self-paced online", "Blended learning", "Microlearning series", "On-the-job training"],
|
| 291 |
+
help="How do you want to deliver this training?"
|
| 292 |
+
)
|
| 293 |
+
|
| 294 |
+
with col_d2:
|
| 295 |
+
content_depth = st.selectbox(
|
| 296 |
+
"Content Depth",
|
| 297 |
+
["Basic overview", "Intermediate depth", "Advanced/comprehensive", "Expert level"],
|
| 298 |
+
index=1,
|
| 299 |
+
help="How deep should the content go?"
|
| 300 |
+
)
|
| 301 |
+
|
| 302 |
+
# Additional details in expandable section
|
| 303 |
+
with st.expander("π Additional Planning Details", expanded=False):
|
| 304 |
+
st.markdown('<div class="settings-section">', unsafe_allow_html=True)
|
| 305 |
|
| 306 |
+
col_a1, col_a2 = st.columns(2)
|
| 307 |
+
with col_a1:
|
| 308 |
+
audience_size = st.selectbox(
|
| 309 |
+
"Audience Size",
|
| 310 |
+
["Individual (1-on-1)", "Small team (5-15)", "Medium group (15-30)", "Large group (20+)"],
|
| 311 |
+
index=1
|
| 312 |
+
)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 313 |
|
| 314 |
+
timeline = st.selectbox(
|
| 315 |
+
"Development Timeline",
|
| 316 |
+
["Rush (1-2 weeks)", "Standard (1-2 months)", "Extended (3-6 months)", "Long-term (6+ months)"],
|
| 317 |
+
index=1
|
| 318 |
+
)
|
| 319 |
+
|
| 320 |
+
with col_a2:
|
| 321 |
+
budget_range = st.selectbox(
|
| 322 |
+
"Budget Range",
|
| 323 |
+
["Minimal budget", "Small budget ($1K-5K)", "Medium budget ($5K-20K)", "Large budget ($20K+)", "Not specified"],
|
| 324 |
+
index=4
|
| 325 |
+
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 326 |
|
| 327 |
+
priority_level = st.selectbox(
|
| 328 |
+
"Priority Level",
|
| 329 |
+
["Low priority", "Medium priority", "High priority", "Critical/urgent"],
|
| 330 |
+
index=2
|
| 331 |
+
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 332 |
|
| 333 |
+
available_content = st.text_area(
|
| 334 |
+
"Available Content & Resources",
|
| 335 |
+
placeholder="e.g., Existing presentations, documentation, videos, previous training materials",
|
| 336 |
+
height=75,
|
| 337 |
+
help="What materials do you already have that could be used or adapted?"
|
| 338 |
+
)
|
| 339 |
+
|
| 340 |
+
subject_matter_experts = st.text_input(
|
| 341 |
+
"Subject Matter Experts Available",
|
| 342 |
+
placeholder="e.g., John Smith (Sales Director), external consultant, internal team leads",
|
| 343 |
+
help="Who can provide expertise and content validation?"
|
| 344 |
+
)
|
| 345 |
+
|
| 346 |
+
success_metrics = st.text_area(
|
| 347 |
+
"Success Metrics & Evaluation",
|
| 348 |
+
placeholder="e.g., Participant satisfaction scores, skill assessments, behavior change metrics, business impact",
|
| 349 |
+
height=75,
|
| 350 |
+
help="How will you measure if the training was successful?"
|
| 351 |
+
)
|
| 352 |
+
|
| 353 |
+
st.markdown('</div>', unsafe_allow_html=True)
|
| 354 |
+
|
| 355 |
+
# Example scenarios for inspiration
|
| 356 |
+
with st.expander("Need inspiration? View example training scenarios", expanded=False):
|
| 357 |
+
st.markdown('<div class="examples-section">', unsafe_allow_html=True)
|
| 358 |
|
| 359 |
+
example_scenarios = [
|
| 360 |
+
{
|
| 361 |
+
"title": "New Manager Leadership Program",
|
| 362 |
+
"topic": "Leadership Fundamentals",
|
| 363 |
+
"audience": "Newly promoted managers",
|
| 364 |
+
"goals": "Develop core leadership skills, improve team management, increase employee engagement scores by 15%"
|
| 365 |
+
},
|
| 366 |
+
{
|
| 367 |
+
"title": "Customer Service Excellence",
|
| 368 |
+
"topic": "Advanced Customer Service Skills",
|
| 369 |
+
"audience": "Customer support representatives",
|
| 370 |
+
"goals": "Reduce customer complaints by 25%, improve satisfaction ratings, handle difficult situations confidently"
|
| 371 |
+
},
|
| 372 |
+
{
|
| 373 |
+
"title": "Data-Driven Decision Making",
|
| 374 |
+
"topic": "Business Analytics and Data Interpretation",
|
| 375 |
+
"audience": "Department managers and analysts",
|
| 376 |
+
"goals": "Make better decisions using data, create meaningful reports, identify key performance indicators"
|
| 377 |
+
},
|
| 378 |
+
{
|
| 379 |
+
"title": "Remote Team Management",
|
| 380 |
+
"topic": "Managing Virtual Teams",
|
| 381 |
+
"audience": "Team leaders and managers",
|
| 382 |
+
"goals": "Improve virtual team productivity, enhance remote communication, maintain team culture"
|
| 383 |
+
}
|
| 384 |
]
|
| 385 |
|
| 386 |
+
for i, example in enumerate(example_scenarios):
|
| 387 |
+
if st.button(f"Use Example: {example['title']}", key=f"example_{i}"):
|
| 388 |
+
st.session_state["example_data"] = example
|
| 389 |
+
st.rerun()
|
| 390 |
|
| 391 |
+
st.markdown('</div>', unsafe_allow_html=True)
|
| 392 |
+
|
| 393 |
+
# Apply example data if selected
|
| 394 |
+
if "example_data" in st.session_state:
|
| 395 |
+
example = st.session_state["example_data"]
|
| 396 |
+
course_topic = example["topic"]
|
| 397 |
+
target_audience = example["audience"]
|
| 398 |
+
learning_goals = example["goals"]
|
| 399 |
+
del st.session_state["example_data"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 400 |
|
| 401 |
+
# Generate outline button
|
| 402 |
+
generate_button = st.button(
|
| 403 |
+
"π Generate Course Outline",
|
| 404 |
+
disabled=not course_topic or not target_audience or not learning_goals,
|
| 405 |
+
use_container_width=True
|
| 406 |
+
)
|
| 407 |
+
|
| 408 |
+
if not course_topic or not target_audience or not learning_goals:
|
| 409 |
+
st.info("Please fill in the core course information (topic, audience, and goals) to generate an outline")
|
| 410 |
+
|
| 411 |
+
# Display generated outline
|
| 412 |
+
with col2:
|
| 413 |
+
st.markdown('<div class="custom-subheader">Generated Course Outline</div>', unsafe_allow_html=True)
|
| 414 |
|
| 415 |
+
if generate_button and course_topic and target_audience and learning_goals:
|
| 416 |
+
with st.spinner("Creating your course outline..."):
|
| 417 |
+
# Simulate processing time
|
| 418 |
+
time.sleep(1)
|
| 419 |
+
|
| 420 |
+
# Collect all inputs
|
| 421 |
+
course_inputs = {
|
| 422 |
+
'course_topic': course_topic,
|
| 423 |
+
'target_audience': target_audience,
|
| 424 |
+
'learning_goals': learning_goals,
|
| 425 |
+
'delivery_method': delivery_method,
|
| 426 |
+
'content_depth': content_depth,
|
| 427 |
+
'audience_size': audience_size if 'audience_size' in locals() else 'Medium group (15-30)',
|
| 428 |
+
'timeline': timeline if 'timeline' in locals() else 'Standard (1-2 months)',
|
| 429 |
+
'budget_range': budget_range if 'budget_range' in locals() else 'Not specified',
|
| 430 |
+
'priority_level': priority_level if 'priority_level' in locals() else 'Medium priority',
|
| 431 |
+
'available_content': available_content if 'available_content' in locals() else '',
|
| 432 |
+
'subject_matter_experts': subject_matter_experts if 'subject_matter_experts' in locals() else '',
|
| 433 |
+
'success_metrics': success_metrics if 'success_metrics' in locals() else ''
|
| 434 |
+
}
|
| 435 |
+
|
| 436 |
+
# Generate course outline components
|
| 437 |
+
estimated_duration = calculate_estimated_duration(delivery_method, content_depth, course_inputs['audience_size'])
|
| 438 |
+
learning_objectives = generate_learning_objectives(course_topic, target_audience, learning_goals)
|
| 439 |
+
course_modules = generate_course_modules(course_topic, learning_objectives, delivery_method)
|
| 440 |
+
readiness_score = calculate_readiness_score(course_inputs)
|
| 441 |
+
recommendations = generate_recommendations(course_inputs, readiness_score)
|
| 442 |
+
|
| 443 |
+
outline_data = {
|
| 444 |
+
'inputs': course_inputs,
|
| 445 |
+
'estimated_duration': estimated_duration,
|
| 446 |
+
'learning_objectives': learning_objectives,
|
| 447 |
+
'course_modules': course_modules,
|
| 448 |
+
'readiness_score': readiness_score,
|
| 449 |
+
'recommendations': recommendations,
|
| 450 |
+
'generated_date': datetime.now().strftime("%Y-%m-%d %H:%M")
|
| 451 |
+
}
|
| 452 |
+
|
| 453 |
+
st.session_state["generated_outline"] = outline_data
|
| 454 |
+
|
| 455 |
+
# Add to history
|
| 456 |
+
if outline_data not in st.session_state["course_history"]:
|
| 457 |
+
st.session_state["course_history"].insert(0, outline_data)
|
| 458 |
+
st.session_state["course_history"] = st.session_state["course_history"][:5] # Keep last 5
|
| 459 |
+
|
| 460 |
+
st.success("β
Course outline generated successfully!")
|
| 461 |
|
| 462 |
+
if st.session_state["generated_outline"] is not None:
|
| 463 |
+
outline = st.session_state["generated_outline"]
|
| 464 |
|
| 465 |
+
st.markdown('<div class="generated-outline">', unsafe_allow_html=True)
|
|
|
|
|
|
|
|
|
|
| 466 |
|
| 467 |
+
# Course Overview Section
|
| 468 |
+
st.markdown("### π Course Overview")
|
| 469 |
+
st.markdown(f"**Course Title:** {outline['inputs']['course_topic']}")
|
| 470 |
+
st.markdown(f"**Target Audience:** {outline['inputs']['target_audience']}")
|
| 471 |
+
st.markdown(f"**Delivery Method:** {outline['inputs']['delivery_method']}")
|
| 472 |
+
st.markdown(f"**Estimated Duration:** {outline['estimated_duration']} hours")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 473 |
|
| 474 |
+
# Readiness Score
|
| 475 |
+
score_color = "green" if outline['readiness_score'] >= 80 else "orange" if outline['readiness_score'] >= 60 else "red"
|
| 476 |
+
st.markdown(f"""
|
| 477 |
+
<div class="success-indicator">
|
| 478 |
+
<strong>Course Readiness Score: <span style="color: {score_color};">{outline['readiness_score']}/100</span></strong>
|
| 479 |
+
<br><small>Based on completeness of planning inputs</small>
|
| 480 |
+
</div>
|
| 481 |
+
""", unsafe_allow_html=True)
|
| 482 |
|
| 483 |
+
# Learning Objectives
|
| 484 |
+
st.markdown("### π― Learning Objectives")
|
| 485 |
+
st.markdown("Upon completion, participants will be able to:")
|
| 486 |
+
for i, objective in enumerate(outline['learning_objectives'], 1):
|
| 487 |
+
st.markdown(f"{i}. {objective.capitalize()}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 488 |
|
| 489 |
+
# Course Modules
|
| 490 |
+
st.markdown("### π Proposed Course Structure")
|
| 491 |
+
for i, module in enumerate(outline['course_modules'], 1):
|
| 492 |
+
st.markdown(f"""
|
| 493 |
+
<div class="outline-section">
|
| 494 |
+
<strong>{module['title']}</strong> ({module['duration']})
|
| 495 |
+
<ul>
|
| 496 |
+
{"".join([f"<li>{item}</li>" for item in module['content']])}
|
| 497 |
+
</ul>
|
| 498 |
+
</div>
|
| 499 |
+
""", unsafe_allow_html=True)
|
| 500 |
|
| 501 |
+
# Success Metrics
|
| 502 |
+
if outline['inputs']['success_metrics']:
|
| 503 |
+
st.markdown("### π Success Metrics")
|
| 504 |
+
st.markdown(outline['inputs']['success_metrics'])
|
| 505 |
|
| 506 |
+
# Recommendations
|
| 507 |
+
if outline['recommendations']:
|
| 508 |
+
st.markdown("### π‘ Recommendations & Next Steps")
|
| 509 |
+
for rec in outline['recommendations']:
|
| 510 |
+
st.markdown(f"""
|
| 511 |
+
<div class="recommendation">
|
| 512 |
+
{rec}
|
| 513 |
+
</div>
|
| 514 |
+
""", unsafe_allow_html=True)
|
| 515 |
|
| 516 |
+
st.markdown('</div>', unsafe_allow_html=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 517 |
|
| 518 |
+
# Action buttons
|
| 519 |
+
col_b1, col_b2 = st.columns(2)
|
| 520 |
|
| 521 |
+
with col_b1:
|
| 522 |
+
# Download as JSON
|
| 523 |
+
outline_json = json.dumps(outline, indent=2)
|
| 524 |
+
st.download_button(
|
| 525 |
+
label="πΎ Download Outline",
|
| 526 |
+
data=outline_json,
|
| 527 |
+
file_name=f"course_outline_{int(time.time())}.json",
|
| 528 |
+
mime="application/json",
|
| 529 |
+
use_container_width=True
|
| 530 |
+
)
|
| 531 |
+
|
| 532 |
+
with col_b2:
|
| 533 |
+
# Regenerate button
|
| 534 |
+
if st.button("π Refine Outline", use_container_width=True):
|
| 535 |
+
with st.spinner("Refining course outline..."):
|
| 536 |
+
time.sleep(1)
|
| 537 |
+
# Regenerate with slight variations
|
| 538 |
+
learning_objectives = generate_learning_objectives(course_topic, target_audience, learning_goals)
|
| 539 |
+
course_modules = generate_course_modules(course_topic, learning_objectives, delivery_method)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 540 |
|
| 541 |
+
outline['learning_objectives'] = learning_objectives
|
| 542 |
+
outline['course_modules'] = course_modules
|
| 543 |
+
st.session_state["generated_outline"] = outline
|
| 544 |
+
st.success("β
Outline refined!")
|
| 545 |
+
st.rerun()
|
| 546 |
+
|
| 547 |
+
# Partnership CTA
|
| 548 |
+
st.markdown("""
|
| 549 |
+
<div class="partnership-cta">
|
| 550 |
+
<h3>π Ready to Bring Your Course to Life?</h3>
|
| 551 |
+
<p>This outline is just the beginning! Partner with our team to transform your vision into a comprehensive, engaging training program that delivers real results.</p>
|
| 552 |
+
<p><strong>Next Steps:</strong> Content development β’ Instructional design β’ Learning technology β’ Delivery support</p>
|
| 553 |
+
</div>
|
| 554 |
+
""", unsafe_allow_html=True)
|
| 555 |
+
|
| 556 |
+
else:
|
| 557 |
+
# Placeholder
|
| 558 |
+
st.markdown("""
|
| 559 |
+
<div class="placeholder-area">
|
| 560 |
+
<h3>π Your Course Outline Will Appear Here</h3>
|
| 561 |
+
<p>Fill in the course planning details and click 'Generate Course Outline' to see your structured training plan.</p>
|
| 562 |
+
<br>
|
| 563 |
+
<p><strong>Your outline will include:</strong></p>
|
| 564 |
+
<p>β
Learning objectives<br>
|
| 565 |
+
β
Course structure & modules<br>
|
| 566 |
+
β
Estimated duration<br>
|
| 567 |
+
β
Readiness assessment<br>
|
| 568 |
+
β
Personalized recommendations</p>
|
| 569 |
+
</div>
|
| 570 |
+
""", unsafe_allow_html=True)
|
| 571 |
|
| 572 |
# Footer
|
| 573 |
st.markdown("""
|
| 574 |
<div class="footnote">
|
| 575 |
+
<p><strong>About this tool:</strong> The Training Course Outline Generator helps L&D professionals structure their training ideas into actionable plans. Generated outlines provide a foundation for course development and can be customized based on your specific organizational needs.</p>
|
|
|
|
| 576 |
</div>
|
| 577 |
""", unsafe_allow_html=True)
|