Spaces:
Running
Running
import streamlit as st | |
# Initialize session state | |
if "page_access" not in st.session_state: | |
st.session_state.page_access = {"About": True, "Load Exam": True, "Take Exam": False, "View Results": False} | |
if "current_page" not in st.session_state: | |
st.session_state.current_page = "Main" | |
if "quiz_data" not in st.session_state: | |
st.session_state.quiz_data = [] | |
if "metadata" not in st.session_state: | |
st.session_state.metadata = [] | |
# Navigation logic | |
if st.session_state.current_page == "About": | |
st.session_state.current_page = "1_About" | |
if st.session_state.current_page == "Load Exam": | |
st.session_state.current_page = "2_Load Exam" | |
elif st.session_state.current_page == "Take Exam": | |
st.session_state.current_page = "3_Take Exam" | |
def main(): | |
# Set app title | |
st.title("Exam Kiosk") | |
# Logic to control page access | |
if "quiz_loaded" not in st.session_state: | |
st.session_state.quiz_loaded = False | |
if "quiz_completed" not in st.session_state: | |
st.session_state.quiz_completed = False | |
# Provide instructions | |
instructions = """ | |
### Welcome to the Exam Kiosk version 1.0! | |
This application allows you to manage your exam process seamlessly, from loading exams to taking and reviewing results. Follow the steps below to use the app effectively. | |
--- | |
## **How to Use the Application** | |
### **Step 1: Explore the About Page** | |
- Navigate to the **About** page to learn more about the system. | |
--- | |
### **Step 2: Load an Exam** | |
1. Go to the **Load Exam** page. | |
2. Click the **Load Exam** button to load an exam. | |
3. Once an exam is loaded, you will be redirected to the **Take Exam** page. | |
--- | |
### **Step 3: Take the Exam** | |
- On the **Take Exam** page, you can: | |
1. Start answering the exam questions. | |
2. **Finish Exam**: Complete the exam and proceed to the results. | |
3. **End Exam Early**: End the exam without completing all questions and proceed to the results. | |
--- | |
### **Step 4: View Results** | |
- Navigate to the **View Results** page to see your exam performance. | |
- After reviewing your results, you can: | |
- **Retake Exam**: Restart the same exam. | |
- **Load Another Exam**: Start a new exam by returning to the **Load Exam** page. | |
--- | |
## **Navigation Tips** | |
- The sidebar displays the pages you can currently access. | |
- Some pages will only become accessible as you progress through the workflow. | |
--- | |
## **Important Notes** | |
- Make sure to follow the sequence: Load Exam β Take Exam β View Results. | |
- If you wish to restart or load another exam, use the options available on the **View Results** page. | |
Enjoy using the Exam Kiosk v1.0! | |
""" | |
st.markdown(instructions) | |
if __name__ == "__main__": | |
main() |