Spaces:
Build error
Build error
File size: 1,804 Bytes
5efaea1 6531b15 5efaea1 6531b15 5efaea1 | 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 53 54 55 56 | import json
import os
from pages.common import *
hide_sidebar()
# Initialize session state for page navigation
st.session_state.page = 1 # Start at page 1
st.session_state.user_data = {} # Dictionary to store user responses
st.session_state.inc_int = 0
st.session_state.question_idx = 0
st.session_state.example_idx = 0
st.session_state.user_pref_idx = 0
PLOT_PATH = "scatter_data"
st.session_state.plots = {
int(ppath.split(".")[0]): json.load(open(os.path.join(PLOT_PATH, ppath), "r"))
for ppath in os.listdir(PLOT_PATH)
}
st.session_state.questions = json.load(open("spatial_questions.json", "r"))
st.session_state.num_questions = len(
[1 for q in st.session_state.questions if q["ttype"] == "question"]
)
# Page 1 - Collect Input
st.write(
"""# Data Sonification Using Spatial Audio
"""
)
st.write(
"""1. Our Research group is exploring the use of simulated spatial audio
for data representation.
"""
)
st.write(
"""2. In this study, you will listen to some audio files, and decide the chart that
corresponds with the audio."""
)
st.write(
f"""3. This test contains {st.session_state.num_questions} questions and shouldn't take longer than 20 minutes."""
)
st.write(
f"""4. Your answer to the audio related questions, user-preference questions, your age and gender will be recorded as part of the study. No Personally Identifiable information will be stored. The stored data maybe published publically."""
)
affiliated = st.checkbox("I am affiliated with the research team")
if st.button("Agree & Continue", type="primary"):
# Save responses in session state and move to next page
st.session_state.user_data["affiliated"] = affiliated
st.session_state.user_data["ref_number"] = get_new_ref()
next_page()
|