Spaces:
Runtime error
Runtime error
Everton Aleixo
commited on
Commit
•
f34559c
1
Parent(s):
7056152
Create app to calculate the animschool grade.
Browse files- app.py +49 -0
- requirements.txt +1 -0
app.py
ADDED
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
|
3 |
+
|
4 |
+
st.markdown(f"## System to Check AnimSchool Grades")
|
5 |
+
|
6 |
+
|
7 |
+
grade1 = st.number_input("Grade for graded assignment 1:")
|
8 |
+
grade2 = st.number_input("Grade for graded assignment 2:")
|
9 |
+
grade3 = st.number_input("Grade for graded assignment 3:")
|
10 |
+
grade4 = st.number_input("Grade for graded assignment 4:")
|
11 |
+
grade5 = st.number_input("Grade for graded assignment 5:")
|
12 |
+
|
13 |
+
|
14 |
+
clicked = st.button('Check now!')
|
15 |
+
|
16 |
+
def get_concept(grade):
|
17 |
+
if grade >= 93:
|
18 |
+
return 'A'
|
19 |
+
if grade >= 90:
|
20 |
+
return 'A-'
|
21 |
+
if grade >= 87:
|
22 |
+
return 'B+'
|
23 |
+
if grade >= 83:
|
24 |
+
return 'B'
|
25 |
+
if grade >= 80:
|
26 |
+
return 'B-'
|
27 |
+
if grade >= 77:
|
28 |
+
return 'C+'
|
29 |
+
if grade >= 73:
|
30 |
+
return 'C'
|
31 |
+
if grade >= 70:
|
32 |
+
return 'C-'
|
33 |
+
if grade >= 67:
|
34 |
+
return 'D+'
|
35 |
+
if grade > 63:
|
36 |
+
return 'D'
|
37 |
+
if grade > 60:
|
38 |
+
return 'D-'
|
39 |
+
return 'F'
|
40 |
+
|
41 |
+
if clicked:
|
42 |
+
st.markdown(f"###### The grade for the first asignment was {grade1}. It represents a concept of {get_concept(grade1)}.")
|
43 |
+
st.markdown(f"###### The grade for the second asignment was {grade2}. It represents a concept of {get_concept(grade2)}.")
|
44 |
+
st.markdown(f"###### The grade for the third asignment was {grade3}. It represents a concept of {get_concept(grade3)}.")
|
45 |
+
st.markdown(f"###### The grade for the 4º asignment was {grade4}. It represents a concept of {get_concept(grade4)}.")
|
46 |
+
st.markdown(f"###### The grade for the 5º asignment was {grade5}. It represents a concept of {get_concept(grade5)}.")
|
47 |
+
|
48 |
+
final_grade = (grade1*0.05)+(grade2*0.05)+(grade3*0.1)+(grade4*0.1)+(grade5*0.7)
|
49 |
+
st.markdown(f"#### The final grade of student is {final_grade}. It represents a concept of {get_concept(final_grade)}.")
|
requirements.txt
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
streamlit
|