|
|
|
import streamlit as st |
|
import pandas as pd |
|
|
|
|
|
@st.cache_data |
|
def load_data(): |
|
data = pd.read_csv('questions_working.csv') |
|
return data |
|
|
|
data = load_data() |
|
|
|
|
|
easy_questions = data[data['Level'] == 'Easy'] |
|
very_easy_questions = data[data['Level'] == 'Very Easy'] |
|
moderate_questions = data[data['Level'] == 'Moderate'] |
|
|
|
|
|
col1, col2, col3, col4 = st.columns(4) |
|
|
|
|
|
easy_selection_1 = col1.selectbox('Choose an Easy Question (1):', easy_questions['ID'].tolist()) |
|
easy_selection_2 = col2.selectbox('Choose an Easy Question (2):', easy_questions['ID'].tolist()) |
|
very_easy_selection = col3.selectbox('Choose a Very Easy Question:', very_easy_questions['ID'].tolist()) |
|
moderate_selection = col4.selectbox('Choose a Moderate Question:', moderate_questions['ID'].tolist()) |
|
|
|
|
|
|
|
if st.button('Show Answers'): |
|
selections = [easy_selection_1, easy_selection_2, very_easy_selection, moderate_selection] |
|
for selected_id in selections: |
|
question_row = data[data['ID'] == selected_id].iloc[0] |
|
st.markdown('---') |
|
st.write(f"**Question (ID: {question_row['ID']}):** {question_row['Question']}") |
|
st.write(f"**Answer:** {question_row['Answer']}") |
|
|
|
|