Spaces:
Sleeping
Sleeping
import streamlit as st | |
import json | |
from quiz_gui_helper import _QuizGUI | |
def main(): | |
st.title("View Results") | |
if not st.session_state.quiz_completed: | |
st.error("No completed exam results available.") | |
else: | |
st.write("Displaying results...") | |
quiz_data = st.session_state.quiz_data | |
_QuizGUI(quiz_data).view_results() | |
if st.button("Retake Exam"): | |
st.session_state.quiz_completed = False | |
st.session_state.quiz_loaded = True | |
st.session_state.page_access["Take Exam"] = True | |
st.session_state.page_access["View Results"] = False | |
st.success("You can now retake the exam. Go to the Take Exam page to start.") | |
if __name__ == "__main__": | |
main() |