sunbal7 commited on
Commit
bfd0106
Β·
verified Β·
1 Parent(s): 765236a

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +62 -0
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 ❀️")