Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -411,7 +411,7 @@ class CertificateGenerator:
|
|
411 |
|
412 |
# Add instructor info
|
413 |
draw.text((60, y_offset + 160), "Instructor", font=fonts['subtitle'], fill='#666666')
|
414 |
-
draw.text((60, y_offset + 190), "
|
415 |
|
416 |
# Add participant name (large)
|
417 |
name = name.strip() or "Participant"
|
@@ -593,73 +593,70 @@ class QuizApp:
|
|
593 |
}
|
594 |
|
595 |
# Add fixed content here
|
596 |
-
self.fixed_content = """
|
|
|
|
|
|
|
597 |
|
598 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
599 |
|
600 |
-
|
|
|
|
|
|
|
|
|
601 |
|
602 |
-
|
|
|
|
|
|
|
603 |
|
604 |
-
|
|
|
|
|
|
|
|
|
|
|
605 |
|
606 |
-
|
|
|
|
|
|
|
|
|
|
|
607 |
|
608 |
-
|
|
|
|
|
|
|
|
|
609 |
|
610 |
-
|
|
|
|
|
|
|
|
|
611 |
|
612 |
-
|
|
|
|
|
|
|
613 |
|
614 |
-
|
|
|
|
|
|
|
615 |
|
616 |
-
|
617 |
-
|
618 |
-
|
619 |
-
YTD Sales = TOTALYTD(SUM(Sales[Amount]), 'Date'[Date])
|
620 |
-
```
|
621 |
-
|
622 |
-
As you advance, you'll encounter more complex scenarios requiring advanced DAX concepts. Time intelligence functions allow you to create period-over-period comparisons, while context transition helps you navigate between row and filter contexts effectively. Understanding these concepts becomes crucial when building sophisticated financial or sales analysis solutions.
|
623 |
-
|
624 |
-
## Advanced Analysis and Visualization
|
625 |
-
|
626 |
-
Power BI's visualization capabilities extend far beyond basic charts and graphs. The platform offers a rich set of visualization tools, from standard bar and line charts to sophisticated custom visuals available through the marketplace. Learning to choose the right visualization for your data story becomes crucial for effective communication.
|
627 |
-
|
628 |
-
Consider a sales analysis scenario: you might combine a line chart showing trends over time with a map visualization displaying regional performance, while using drill-through capabilities to provide detailed product-level analysis. These interactive features allow users to explore data naturally, moving from high-level overviews to detailed insights seamlessly.
|
629 |
-
|
630 |
-
## Security and Administration
|
631 |
-
|
632 |
-
Security in Power BI operates at multiple levels. Row-level security (RLS) allows you to control data access at a granular level, ensuring users see only the data they're authorized to view. For example, regional managers might only see sales data for their specific territories, while executive leadership sees all regions.
|
633 |
-
|
634 |
-
Administration extends beyond security to include workspace management, sharing permissions, and gateway configuration. The Enterprise Gateway facilitates secure data refresh from on-premises sources, while Personal Gateway serves individual users' needs. Understanding these components helps you build a secure and efficient BI environment.
|
635 |
-
|
636 |
-
## Performance Optimization and Best Practices
|
637 |
-
|
638 |
-
Optimizing Power BI solutions requires attention to several key areas. Data model optimization involves choosing the right storage mode, implementing appropriate relationships, and creating efficient measures. Query performance can be enhanced through proper use of variables in DAX, implementing query folding in Power Query, and utilizing aggregations for large datasets.
|
639 |
-
|
640 |
-
For large-scale implementations, consider incremental refresh strategies to manage data loading efficiently. This might involve setting up refresh windows to load only the most recent data while maintaining historical information in a static form.
|
641 |
-
|
642 |
-
## Real-World Implementation Scenarios
|
643 |
-
|
644 |
-
Practical application of Power BI often involves complex scenarios combining multiple concepts. Consider a financial reporting solution that requires:
|
645 |
-
- Integration with multiple data sources
|
646 |
-
- Implementation of security roles
|
647 |
-
- Automated refresh schedules
|
648 |
-
- Excel integration for detailed analysis
|
649 |
-
|
650 |
-
Or a sales performance dashboard featuring:
|
651 |
-
- Real-time data tracking
|
652 |
-
- Predictive analytics integration
|
653 |
-
- Mobile optimization
|
654 |
-
- Automated alerting systems
|
655 |
-
|
656 |
-
These scenarios require combining technical knowledge with business understanding to create effective solutions.
|
657 |
-
|
658 |
-
## Conclusion
|
659 |
-
|
660 |
-
Mastering Power BI requires understanding not just individual components but how they work together to create effective business intelligence solutions. From basic data connectivity through advanced DAX calculations to security implementation, each element plays a crucial role in building robust, scalable BI systems. Regular practice with real-world scenarios helps reinforce these concepts and builds the experience needed to handle complex business requirements effectively.
|
661 |
-
|
662 |
-
Continue your learning journey by experimenting with different features, challenging yourself with complex scenarios, and staying updated with the platform's evolving capabilities. Remember that effective BI solutions balance technical capability with business needs, creating insights that drive meaningful business decisions."""
|
663 |
|
664 |
def get_certificate_title(self, base_title: str) -> str:
|
665 |
"""Get certificate title with difficulty level"""
|
@@ -844,7 +841,7 @@ def create_quiz_interface():
|
|
844 |
# Header
|
845 |
gr.Markdown("""
|
846 |
<div style="text-align: center;">
|
847 |
-
<h1>🎓
|
848 |
<h3>Transform Your Knowledge into Recognized Achievements</h3></p>
|
849 |
</div>
|
850 |
|
@@ -857,7 +854,7 @@ def create_quiz_interface():
|
|
857 |
<li>⏱️ <strong>Passing Score:</strong> 80% or higher</li>
|
858 |
<li>🏆 <strong>Certificate:</strong> Awarded upon successful completion</li>
|
859 |
</ul>
|
860 |
-
<p style="margin-top: 15px;"><i>This assessment evaluates your understanding of
|
861 |
</div>
|
862 |
""", show_label=False)
|
863 |
|
@@ -943,7 +940,7 @@ def create_quiz_interface():
|
|
943 |
score_display = gr.Number(label="Your Score", visible=False)
|
944 |
course_name = gr.Textbox(
|
945 |
label="Certification Title",
|
946 |
-
value=lambda: f"
|
947 |
interactive=False
|
948 |
)
|
949 |
certificate_display = gr.Image(label="Your Certificate")
|
@@ -953,7 +950,7 @@ def create_quiz_interface():
|
|
953 |
return [
|
954 |
gr.update(visible=True), # Make cert_tab visible
|
955 |
gr.update(
|
956 |
-
value=f"
|
957 |
),
|
958 |
gr.update(selected=3) # Switch to cert_tab
|
959 |
]
|
|
|
411 |
|
412 |
# Add instructor info
|
413 |
draw.text((60, y_offset + 160), "Instructor", font=fonts['subtitle'], fill='#666666')
|
414 |
+
draw.text((60, y_offset + 190), "QHSE Manager", font=fonts['text'], fill='#1C1D1F')
|
415 |
|
416 |
# Add participant name (large)
|
417 |
name = name.strip() or "Participant"
|
|
|
593 |
}
|
594 |
|
595 |
# Add fixed content here
|
596 |
+
self.fixed_content = """Introduction to Construction Safety
|
597 |
+
The construction industry remains one of the most hazardous sectors in the global workforce, presenting numerous risks to worker safety and health. This comprehensive guide addresses the fundamental aspects of construction site safety, providing detailed insights into best practices, regulatory requirements, and practical implementation strategies. Safety in construction isn't merely a legal obligation—it represents a moral imperative to protect human life and ensure the well-being of every individual working in this challenging environment.
|
598 |
+
Construction site safety encompasses multiple interconnected elements, from personal protective equipment to emergency response protocols. Success in safety management requires unwavering commitment from all organizational levels, from executive leadership to front-line workers. This guide serves as a foundational resource for construction professionals, safety managers, and workers, offering detailed insights into creating and maintaining a safe working environment.
|
599 |
+
Personal Protective Equipment (PPE)
|
600 |
|
601 |
+
Personal protective equipment forms the first line of defense against workplace injuries in construction environments. Every worker on a construction site must understand the importance of proper PPE selection, use, and maintenance. Organizations must establish comprehensive PPE programs addressing specific site hazards while ensuring compliance with applicable regulations and standards.
|
602 |
+
Head protection serves as a critical component of personal protective equipment in construction environments. Every worker must wear appropriate hard hats meeting ANSI Z89.1 standards whenever present on site. Type I hard hats protect against vertical impact and penetration, while Type II hard hats provide additional protection against lateral impact. Construction supervisors must ensure regular inspection of all hard hats for signs of damage, including cracks, dents, or UV degradation. Workers should replace their hard hats every five years from the manufacture date, or immediately following any significant impact. Proper fitting requires adjustable suspension systems that maintain a one-inch clearance between the shell and the wearer's head.
|
603 |
+
Eye and face protection requirements address multiple hazards present in construction environments. Basic eye protection begins with safety glasses featuring side shields meeting ANSI Z87.1 standards. Workers performing tasks involving flying particles, such as grinding or cutting operations, must supplement basic eye protection with face shields. Those working outdoors require tinted protection against UV radiation, while chemical handling demands sealed goggles to prevent splash exposure. Organizations must establish and enforce proper cleaning protocols for all eye protection equipment, ensuring clear vision and maximum protection throughout the workday.
|
604 |
+
Foot protection prevents countless injuries in construction environments through proper selection and use of safety footwear. Workers must wear safety boots meeting ASTM F2413-18 standards, featuring steel or composite toe caps capable of withstanding impacts up to 75 pounds. Safety boots must incorporate puncture-resistant soles protecting against sharp objects and electrical hazard protection appropriate to working conditions. The outer soles require slip-resistant properties with clearly defined tread patterns maintained through regular inspection and replacement. Workers in wet conditions need waterproof options to maintain foot health and prevent discomfort that might lead to unsafe practices.
|
605 |
+
Hand protection requirements vary based on specific task hazards and working conditions. Cut-resistant gloves meeting ANSI/ISEA 105 standards protect against sharp materials and tools. Impact-resistant gloves incorporate padding to protect against crushing injuries during material handling. Chemical-resistant gloves prevent skin exposure to harmful substances, while electrical work requires insulated gloves meeting appropriate voltage ratings. Organizations must train workers in proper glove selection, inspection, and replacement schedules to maintain protective capabilities.
|
606 |
+
Respiratory protection becomes necessary when construction activities generate airborne hazards exceeding permissible exposure limits. Organizations must establish comprehensive respiratory protection programs following OSHA Standard 1910.134. Workers exposed to dust and particles require minimum N95-rated filtering facepieces, while chemical exposures may demand half-face or full-face respirators with appropriate cartridges. All workers using respirators must undergo medical evaluation, fit testing, and proper training in use and maintenance. Organizations must maintain detailed records of respirator assignments, cartridge changes, and fit test results.
|
607 |
+
High-visibility clothing ensures worker visibility in all working conditions, particularly crucial in areas with vehicle traffic or heavy equipment operation. Workers must wear high-visibility clothing meeting ANSI/ISEA 107 standards, with Class 2 garments sufficing for daytime work and moderate traffic conditions, while Class 3 garments become necessary in high-traffic areas or low-light conditions. Reflective materials must maintain their properties through regular cleaning and inspection. Organizations should implement color-coding systems differentiating various worker roles while maintaining minimum visibility requirements.
|
608 |
+
Fall Protection Systems
|
609 |
|
610 |
+
Fall protection represents one of the most critical aspects of construction safety, requiring comprehensive planning and implementation. Organizations must develop written fall protection plans for all work conducted at heights exceeding six feet in construction environments. These plans must address specific fall hazards, protection methods, rescue procedures, and training requirements.
|
611 |
+
Guardrail systems provide primary fall protection around elevated work areas, requiring proper installation and regular maintenance. Top rails must maintain a height of 42 inches (±3 inches) and withstand a force of 200 pounds applied in any outward or downward direction. Mid-rails positioned at 21 inches provide additional protection, while toe boards preventing falling objects must extend at least 4 inches above the walking surface. Support posts cannot exceed 8-foot spacing intervals, and all components require regular inspection for structural integrity.
|
612 |
+
Personal fall arrest systems become necessary when guardrail systems prove impractical or insufficient. These systems include full-body harnesses, connectors, and appropriate anchorage points supporting 5,000 pounds per attached worker. Organizations must train workers in proper harness fitting, inspection procedures, and attachment techniques. Regular inspection programs must document the condition of all components, including impact indicators and hardware integrity.
|
613 |
+
Fall protection programs must address rescue considerations, ensuring prompt response to suspended workers following fall arrest. Rescue plans must detail specific procedures, equipment requirements, and personnel responsibilities. Organizations must conduct regular rescue drills verifying the effectiveness of established procedures and identifying potential improvements.
|
614 |
+
Equipment and Machinery Safety
|
615 |
|
616 |
+
Heavy equipment operation demands rigorous safety protocols and continuous monitoring ensuring safe operation. Every piece of heavy equipment requires daily pre-operational inspections following detailed checklists covering all critical systems. Operators must possess appropriate certification and demonstrate competency through practical evaluation before receiving authorization to operate equipment.
|
617 |
+
Equipment maintenance programs must follow manufacturer specifications, with detailed documentation of all service activities. Organizations must implement lockout/tagout procedures during maintenance operations, ensuring equipment cannot be energized while service work proceeds. Operators must maintain inspection logs recording equipment hours, operating conditions, and any observed abnormalities.
|
618 |
+
Power tool safety begins with proper selection and maintenance of tools appropriate for specific tasks. Organizations must establish tool inspection programs verifying the condition of guards, power cords, and safety devices before each use. Workers must receive task-specific training covering proper tool operation, recognized hazards, and required protective measures.
|
619 |
+
Crane operations require comprehensive planning and continuous monitoring to maintain safe working conditions. Organizations must develop detailed lift plans for all crane operations, considering load weights, lift radius, ground conditions, and environmental factors. Qualified riggers must inspect all lifting equipment before use, verifying the condition of hooks, slings, shackles, and other components.
|
620 |
|
621 |
+
Site Organization and Management
|
622 |
+
Effective site organization plays a fundamental role in maintaining safe construction operations. Site layout must consider traffic patterns, material storage requirements, and emergency access needs. Organizations must develop comprehensive site plans identifying designated work areas, storage locations, and access routes supporting safe operations while maintaining operational efficiency.
|
623 |
+
Access control and security measures protect both workers and property while preventing unauthorized site entry. Entry points must feature staffed checkpoints verifying worker identification and site authorization. Visitor management protocols must include safety orientation, protective equipment requirements, and escort procedures when necessary. Organizations must maintain accurate site occupancy records supporting emergency response and evacuation procedures.
|
624 |
+
Material storage and handling requires careful planning preventing numerous workplace injuries while maintaining site efficiency. Organizations must develop storage plans considering material characteristics, handling requirements, and access needs. Storage areas require clear designation, appropriate lighting, and protection from weather conditions affecting material integrity. Segregation requirements must address chemical compatibility, fire hazard classes, and environmental protection needs.
|
625 |
+
Traffic management systems prevent vehicle-related accidents while maintaining efficient site operations. Traffic plans must separate vehicle and pedestrian routes wherever possible, implementing physical barriers when separation cannot be maintained. Speed limits, stop signs, and traffic control devices must regulate vehicle movement throughout the site. Loading zones require clear designation, with established procedures for vehicle positioning and personnel exclusion during loading operations.
|
626 |
+
Housekeeping practices significantly impact site safety through maintenance of clear access ways and work areas. Organizations must establish daily cleaning requirements addressing debris removal, material organization, and maintenance of walking surfaces. Regular inspections must verify compliance with housekeeping standards, identifying potential hazards requiring immediate attention.
|
627 |
|
628 |
+
Emergency Preparedness and Response
|
629 |
+
Emergency preparedness requires comprehensive planning addressing various potential emergency scenarios. Organizations must develop written emergency response plans covering fires, medical emergencies, severe weather, and hazardous material releases. These plans must designate response team members, establish clear communication channels, and define specific response procedures for each type of emergency.
|
630 |
+
Medical response capabilities must match site hazards and workforce size. First aid stations require strategic placement throughout the site, with supplies appropriate to potential injuries. Organizations must ensure sufficient numbers of trained first aid providers on each work shift, maintaining current certification records. Emergency medical equipment, including automated external defibrillators, requires regular inspection and maintenance ensuring operational readiness.
|
631 |
+
Fire prevention and response programs must address potential fire hazards through comprehensive prevention and response measures. Organizations must develop fire prevention plans identifying potential ignition sources, fuel sources, and required control measures. Hot work permits must regulate operations producing flames, sparks, or excessive heat, with fire watch requirements extending beyond work completion.
|
632 |
+
Evacuation procedures must address various emergency scenarios requiring site evacuation. Organizations must establish clearly marked evacuation routes, designated assembly areas, and procedures for accounting for all personnel. Regular evacuation drills must verify worker understanding of procedures while identifying potential improvements in evacuation capabilities.
|
633 |
+
Emergency communication systems must support rapid notification of emergency conditions while maintaining clear communication channels during emergency response. Organizations must establish redundant communication methods ensuring effective communication despite potential system failures. Regular testing must verify system functionality while familiarizing workers with proper operation.
|
634 |
|
635 |
+
Training and Communication
|
636 |
+
Training programs form the foundation of effective safety management through development of worker knowledge and skills. Organizations must establish comprehensive training programs addressing site-specific hazards, safety procedures, and emergency response requirements. New worker orientation must provide thorough introduction to site safety requirements before beginning work activities.
|
637 |
+
Task-specific training must address hazards and safety requirements associated with specific work activities. Workers must demonstrate competency through practical evaluation before performing hazardous tasks independently. Refresher training maintains worker knowledge while addressing identified performance deficiencies or procedure changes.
|
638 |
+
Safety communication systems must support continuous awareness of safety requirements and potential hazards. Daily pre-task safety meetings must address specific hazards and controls associated with planned work activities. Weekly toolbox talks provide focused discussion of relevant safety topics while maintaining worker engagement in safety programs.
|
639 |
+
Documentation requirements include detailed records of all training activities, including attendance records, evaluation results, and certification expiration dates. Organizations must maintain training records demonstrating worker qualification for specific tasks while identifying upcoming training requirements maintaining worker certifications.
|
640 |
|
641 |
+
Health Monitoring and Protection
|
642 |
+
Occupational health monitoring programs protect workers from long-term health hazards through early identification of potential health impacts. Organizations must establish monitoring programs appropriate to site-specific health hazards, including noise exposure, air quality, and ergonomic factors. Regular monitoring must verify effectiveness of control measures while identifying potential areas requiring additional protection.
|
643 |
+
Noise monitoring programs must identify areas requiring hearing protection while verifying effectiveness of implemented controls. Organizations must conduct regular noise surveys establishing boundaries of hearing protection requirements. Worker audiometric testing programs monitor potential hearing impacts while verifying effectiveness of hearing conservation measures.
|
644 |
+
Air quality monitoring addresses both general site conditions and task-specific exposures. Organizations must implement monitoring programs identifying potential exposure to harmful substances while verifying effectiveness of control measures. Documentation requirements include sampling results, equipment calibration records, and worker exposure records.
|
645 |
+
Ergonomic evaluation programs address potential musculoskeletal injuries through proper task design and work practices. Organizations must evaluate work activities identifying potential ergonomic hazards while implementing appropriate control measures. Worker training must address proper lifting techniques, use of mechanical assists, and early reporting of discomfort.
|
646 |
|
647 |
+
Legal Compliance and Documentation
|
648 |
+
Regulatory compliance programs ensure adherence to applicable safety regulations while maintaining required documentation demonstrating compliance. Organizations must establish systems identifying applicable regulations while monitoring regulatory changes affecting safety requirements. Regular compliance audits verify effectiveness of implemented programs while identifying areas requiring improvement.
|
649 |
+
Documentation systems must support various aspects of safety program implementation while meeting regulatory requirements. Required documentation includes training records, inspection reports, incident investigations, and exposure monitoring results. Organizations must establish document control systems ensuring availability of current procedures while maintaining historical records.
|
650 |
+
Incident investigation programs identify root causes of accidents while implementing corrective measures preventing recurrence. Organizations must establish investigation procedures ensuring thorough evaluation of all incidents, including near-miss events. Documentation requirements include investigation reports, witness statements, and corrective action tracking.
|
651 |
|
652 |
+
Risk Assessment and Management
|
653 |
+
Risk assessment processes identify potential hazards while evaluating adequacy of existing controls. Organizations must implement formal risk assessment procedures addressing planned activities and changing site conditions. Assessment results guide implementation of additional controls while identifying activities requiring increased supervision.
|
654 |
+
Job hazard analysis procedures evaluate specific tasks identifying potential hazards and necessary control measures. Organizations must conduct analyses for hazardous activities, documenting identified hazards and required controls. Regular review ensures continued adequacy of established controls while identifying potential improvements in work procedures.
|
655 |
+
Change management programs address safety implications of operational changes through formal evaluation processes. Organizations must establish procedures ensuring safety evaluation of proposed changes before implementation. Documentation requirements include change proposals, risk assessments, and implementation plans.
|
656 |
|
657 |
+
Continuous Improvement
|
658 |
+
Safety program effectiveness requires regular evaluation identifying potential improvements while maintaining program relevance. Organizations must establish review processes evaluating various program elements while incorporating lessons learned from incidents and near-misses. Worker feedback mechanisms support program improvement through identification of practical challenges in procedure implementation.
|
659 |
+
Performance metrics provide objective measurement of safety program effectiveness while identifying trends requiring attention. Organizations must establish appropriate metrics reflecting both leading and lagging indicators of safety performance. Regular review of performance data supports identification of program elements requiring improvement."""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
660 |
|
661 |
def get_certificate_title(self, base_title: str) -> str:
|
662 |
"""Get certificate title with difficulty level"""
|
|
|
841 |
# Header
|
842 |
gr.Markdown("""
|
843 |
<div style="text-align: center;">
|
844 |
+
<h1>🎓 Construction Safety Assessment Certification </h1>
|
845 |
<h3>Transform Your Knowledge into Recognized Achievements</h3></p>
|
846 |
</div>
|
847 |
|
|
|
854 |
<li>⏱️ <strong>Passing Score:</strong> 80% or higher</li>
|
855 |
<li>🏆 <strong>Certificate:</strong> Awarded upon successful completion</li>
|
856 |
</ul>
|
857 |
+
<p style="margin-top: 15px;"><i>This assessment evaluates your understanding of Construction Safety.</i></p>
|
858 |
</div>
|
859 |
""", show_label=False)
|
860 |
|
|
|
940 |
score_display = gr.Number(label="Your Score", visible=False)
|
941 |
course_name = gr.Textbox(
|
942 |
label="Certification Title",
|
943 |
+
value=lambda: f"Construction Safety Assessment Certification", # Dynamic title with level
|
944 |
interactive=False
|
945 |
)
|
946 |
certificate_display = gr.Image(label="Your Certificate")
|
|
|
950 |
return [
|
951 |
gr.update(visible=True), # Make cert_tab visible
|
952 |
gr.update(
|
953 |
+
value=f"Construction Safety Assessment Certification" # Update title with level
|
954 |
),
|
955 |
gr.update(selected=3) # Switch to cert_tab
|
956 |
]
|