Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# app.py
|
2 |
+
|
3 |
+
import streamlit as st
|
4 |
+
|
5 |
+
# Title of the App
|
6 |
+
st.title("PAK ANGELS - ULEFUSA Gen AI Training Certificate Checker π")
|
7 |
+
|
8 |
+
# Explanation of Criteria
|
9 |
+
st.write("""
|
10 |
+
### Qualification Criteria:
|
11 |
+
To qualify for the **Gen AI Training Success Certificate**, you must achieve a minimum of **50%** overall score.
|
12 |
+
Your final score is calculated with the following weightage:
|
13 |
+
- **Quiz 1:** 5%
|
14 |
+
- **Quiz 2:** 5%
|
15 |
+
- **Quiz 3:** 10%
|
16 |
+
- **Quiz 4:** 15%
|
17 |
+
- **Quiz 5:** 15%
|
18 |
+
- **Grand Quiz (Final Exam):** 50%
|
19 |
+
|
20 |
+
Enter your scores below to check if you qualify!
|
21 |
+
""")
|
22 |
+
|
23 |
+
# Input fields for quiz scores (out of 60)
|
24 |
+
quiz1 = st.number_input("Enter Quiz 1 Score (out of 60):", min_value=0, max_value=60, step=1)
|
25 |
+
quiz2 = st.number_input("Enter Quiz 2 Score (out of 60):", min_value=0, max_value=60, step=1)
|
26 |
+
quiz3 = st.number_input("Enter Quiz 3 Score (out of 60):", min_value=0, max_value=60, step=1)
|
27 |
+
quiz4 = st.number_input("Enter Quiz 4 Score (out of 60):", min_value=0, max_value=60, step=1)
|
28 |
+
quiz5 = st.number_input("Enter Quiz 5 Score (out of 60):", min_value=0, max_value=60, step=1)
|
29 |
+
grand_quiz = st.number_input("Enter Grand Quiz (Final Exam) Score (out of 60):", min_value=0, max_value=60, step=1)
|
30 |
+
|
31 |
+
# Calculate Final Weighted Score
|
32 |
+
if st.button("Check Qualification"):
|
33 |
+
# Convert scores out of 60 to percentage
|
34 |
+
weighted_score = (
|
35 |
+
(quiz1 / 60) * 5 +
|
36 |
+
(quiz2 / 60) * 5 +
|
37 |
+
(quiz3 / 60) * 10 +
|
38 |
+
(quiz4 / 60) * 15 +
|
39 |
+
(quiz5 / 60) * 15 +
|
40 |
+
(grand_quiz / 60) * 50
|
41 |
+
)
|
42 |
+
|
43 |
+
st.subheader("Your Results π")
|
44 |
+
st.write(f"**Final Weighted Score:** {weighted_score:.2f}%")
|
45 |
+
|
46 |
+
# Qualification Criteria
|
47 |
+
if weighted_score >= 50:
|
48 |
+
st.success("β
Congratulations! You qualify for the **Gen AI Training Success Certificate** π")
|
49 |
+
|
50 |
+
# Performance Categories
|
51 |
+
if weighted_score >= 80:
|
52 |
+
st.write("π **Top Performer:** 80% or higher")
|
53 |
+
elif weighted_score >= 65:
|
54 |
+
st.write("β **Skilled Performer:** 65% or higher")
|
55 |
+
else:
|
56 |
+
st.write("π° **Promising Performer:** 50% or higher")
|
57 |
+
|
58 |
+
else:
|
59 |
+
st.error("β Unfortunately, you did not qualify for the certificate. Keep practicing and try again!")
|
60 |
+
|
61 |
+
# Final message
|
62 |
+
st.write("\n\nI made this tool with β€οΈ")
|