Spaces:
Running
Running
File size: 2,258 Bytes
bfd0106 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# 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 β€οΈ")
|