sunbal7's picture
Create app.py
bfd0106 verified
raw
history blame
2.26 kB
# app.py
import streamlit as st
# Title of the App
st.title("PAK ANGELS - ULEFUSA Gen AI Training Certificate Checker πŸ†")
# Explanation of Criteria
st.write("""
### Qualification Criteria:
To qualify for the **Gen AI Training Success Certificate**, you must achieve a minimum of **50%** overall score.
Your final score is calculated with the following weightage:
- **Quiz 1:** 5%
- **Quiz 2:** 5%
- **Quiz 3:** 10%
- **Quiz 4:** 15%
- **Quiz 5:** 15%
- **Grand Quiz (Final Exam):** 50%
Enter your scores below to check if you qualify!
""")
# Input fields for quiz scores (out of 60)
quiz1 = st.number_input("Enter Quiz 1 Score (out of 60):", min_value=0, max_value=60, step=1)
quiz2 = st.number_input("Enter Quiz 2 Score (out of 60):", min_value=0, max_value=60, step=1)
quiz3 = st.number_input("Enter Quiz 3 Score (out of 60):", min_value=0, max_value=60, step=1)
quiz4 = st.number_input("Enter Quiz 4 Score (out of 60):", min_value=0, max_value=60, step=1)
quiz5 = st.number_input("Enter Quiz 5 Score (out of 60):", min_value=0, max_value=60, step=1)
grand_quiz = st.number_input("Enter Grand Quiz (Final Exam) Score (out of 60):", min_value=0, max_value=60, step=1)
# Calculate Final Weighted Score
if st.button("Check Qualification"):
# Convert scores out of 60 to percentage
weighted_score = (
(quiz1 / 60) * 5 +
(quiz2 / 60) * 5 +
(quiz3 / 60) * 10 +
(quiz4 / 60) * 15 +
(quiz5 / 60) * 15 +
(grand_quiz / 60) * 50
)
st.subheader("Your Results πŸ“Š")
st.write(f"**Final Weighted Score:** {weighted_score:.2f}%")
# Qualification Criteria
if weighted_score >= 50:
st.success("βœ… Congratulations! You qualify for the **Gen AI Training Success Certificate** πŸŽ‰")
# Performance Categories
if weighted_score >= 80:
st.write("πŸ† **Top Performer:** 80% or higher")
elif weighted_score >= 65:
st.write("⭐ **Skilled Performer:** 65% or higher")
else:
st.write("πŸ”° **Promising Performer:** 50% or higher")
else:
st.error("❌ Unfortunately, you did not qualify for the certificate. Keep practicing and try again!")
# Final message
st.write("\n\nI made this tool with ❀️")