File size: 1,516 Bytes
fa1e621
 
29a4bc9
 
fa1e621
 
 
 
 
 
 
 
 
 
29a4bc9
 
 
 
 
 
 
fa1e621
 
 
 
 
 
29a4bc9
 
fa1e621
 
 
 
 
 
 
 
 
 
 
 
 
 
29a4bc9
fa1e621
 
 
29a4bc9
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
import streamlit as st

from views.intro_screen import welcome_screen


def exit_screen():
    """Display exit screen"""
    st.markdown("""
        <div class='exit-container'>
            <h1>Thank you for participating!</h1>
            <p>Your responses have been saved successfully.</p>
            <p>You can safely close this window or start a new survey.</p>
        </div>
    """, unsafe_allow_html=True)
    st.session_state.completed = True
    st.session_state.show_exit_screen = True
    # btn = st.button("Resume Survey")
    # if btn:
    #     reset_survey()
    #     st.session_state.screen ="welcome"
        # st.rerun()


def reset_survey():
    """Reset the survey state to start over."""
    st.session_state.responses = []
    st.session_state.completed = True
    # st.session_state.start_new_survey = True
    st.show_exit_screen = False


def display_completion_message():
    """Display a standardized survey completion message."""
    st.markdown(
        """
        <div class='exit-container'>
            <h1>You have already completed the survey! Thank you for participating!</h1>
            <p>Your responses have been saved successfully.</p>
            <p>You can safely close this window or start a new survey.</p>
        </div>
        """,
        unsafe_allow_html=True,
    )
    print("trying to show completion message agian")
    st.session_state.show_questions = False
    st.session_state.completed = True
    st.session_state.start_new_survey = True
    st.rerun()