File size: 1,957 Bytes
f34559c
 
 
 
 
 
d938718
 
 
 
 
f34559c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
e1bcdc1
 
 
 
 
f34559c
 
d938718
c294868
d938718
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
import streamlit as st


st.markdown(f"## System to Check AnimSchool Grades")


grade1 = st.number_input("Grade for graded assignment 1 (5%):")
grade2 = st.number_input("Grade for graded assignment 2 (5%):")
grade3 = st.number_input("Grade for graded assignment 3 (10%):")
grade4 = st.number_input("Grade for graded assignment 4 (10%):")
grade5 = st.number_input("Grade for graded assignment 5 (70%):")


clicked = st.button('Check now!')

def get_concept(grade):
    if grade >= 93:
        return 'A'
    if grade >= 90:
        return 'A-'
    if grade >= 87:
        return 'B+'
    if grade >= 83:
        return 'B'
    if grade >= 80:
        return 'B-'
    if grade >= 77:
        return 'C+'
    if grade >= 73:
        return 'C'
    if grade >= 70:
        return 'C-'
    if grade >= 67:
        return 'D+'
    if grade > 63:
        return 'D'
    if grade > 60:
        return 'D-'
    return 'F'
        
if clicked:
    st.markdown(f"###### The grade for the first assignment was {grade1}. It represents a concept of {get_concept(grade1)}.")
    st.markdown(f"###### The grade for the second assignment was {grade2}. It represents a concept of {get_concept(grade2)}.")
    st.markdown(f"###### The grade for the third assignment was {grade3}. It represents a concept of {get_concept(grade3)}.")
    st.markdown(f"###### The grade for the 4º assignment was {grade4}. It represents a concept of {get_concept(grade4)}.")
    st.markdown(f"###### The grade for the 5º assignment was {grade5}. It represents a concept of {get_concept(grade5)}.")

    final_grade = (grade1*0.05)+(grade2*0.05)+(grade3*0.1)+(grade4*0.1)+(grade5*0.7)
    color = 'red' if final_grade < 73 else 'blue'
    complement = 'REPROVED' if final_grade < 73 else 'APPROVED'
    st.markdown(f"<h3 style='color: {color};'>{complement}.<br />The final grade of student is {final_grade}. It represents a concept of {get_concept(final_grade)}.</h3>", unsafe_allow_html=True)