Spaces:
Sleeping
Sleeping
add-help (#1)
Browse files- add help on navigation buttons (998b1eb2b6e7c110d775b27f7e1bb066080af067)
Co-authored-by: Fitri Aisyah <[email protected]>
- views/nav_buttons.py +4 -4
views/nav_buttons.py
CHANGED
|
@@ -42,7 +42,7 @@ def navigation_buttons(data, response: Response):
|
|
| 42 |
col1, col2, col3, col4 = st.columns([1, 1, 1, 2])
|
| 43 |
|
| 44 |
with col1: # Back button #TODO fix: only gets ratings for the session, not from previous session
|
| 45 |
-
if st.button("Back", disabled=st.session_state.current_index == 0):
|
| 46 |
if current_index > 0:
|
| 47 |
st.session_state.previous_ratings[
|
| 48 |
data.iloc[st.session_state.current_index]['config_id']] = response.model_ratings
|
|
@@ -53,7 +53,7 @@ def navigation_buttons(data, response: Response):
|
|
| 53 |
# st.rerun()
|
| 54 |
|
| 55 |
with col2: # Next button
|
| 56 |
-
if st.button("Next", disabled=current_index == len(data) - 1):
|
| 57 |
all_ratings = flatten_ratings(response)
|
| 58 |
if any(rating == 0 for rating in all_ratings):
|
| 59 |
st.warning("Please provide all ratings before proceeding.")
|
|
@@ -82,12 +82,12 @@ def navigation_buttons(data, response: Response):
|
|
| 82 |
# st.rerun()
|
| 83 |
|
| 84 |
with col3: # Submit button
|
| 85 |
-
if st.button("Submit & Resume Later"):
|
| 86 |
all_ratings = flatten_ratings(response)
|
| 87 |
if any(rating == 0 for rating in all_ratings):
|
| 88 |
st.warning("Please provide all ratings before submitting.")
|
| 89 |
else:
|
| 90 |
submit_feedback(current_index)
|
| 91 |
with col4: # Save & Resume Later button
|
| 92 |
-
if st.button("Exit & Resume Later"):
|
| 93 |
submit_feedback(current_index)
|
|
|
|
| 42 |
col1, col2, col3, col4 = st.columns([1, 1, 1, 2])
|
| 43 |
|
| 44 |
with col1: # Back button #TODO fix: only gets ratings for the session, not from previous session
|
| 45 |
+
if st.button("Back", disabled=st.session_state.current_index == 0, help="Go back to the previous question"):
|
| 46 |
if current_index > 0:
|
| 47 |
st.session_state.previous_ratings[
|
| 48 |
data.iloc[st.session_state.current_index]['config_id']] = response.model_ratings
|
|
|
|
| 53 |
# st.rerun()
|
| 54 |
|
| 55 |
with col2: # Next button
|
| 56 |
+
if st.button("Next", disabled=current_index == len(data) - 1, help="Proceed to the next question, your current progress will be saved. Click twice if page does not change."):
|
| 57 |
all_ratings = flatten_ratings(response)
|
| 58 |
if any(rating == 0 for rating in all_ratings):
|
| 59 |
st.warning("Please provide all ratings before proceeding.")
|
|
|
|
| 82 |
# st.rerun()
|
| 83 |
|
| 84 |
with col3: # Submit button
|
| 85 |
+
if st.button("Submit & Resume Later", help="Submit your evaluations. You can return later to make changes if needed."):
|
| 86 |
all_ratings = flatten_ratings(response)
|
| 87 |
if any(rating == 0 for rating in all_ratings):
|
| 88 |
st.warning("Please provide all ratings before submitting.")
|
| 89 |
else:
|
| 90 |
submit_feedback(current_index)
|
| 91 |
with col4: # Save & Resume Later button
|
| 92 |
+
if st.button("Exit & Resume Later", help="Save your progress and exit the page, come back anytime to continue where you left off."):
|
| 93 |
submit_feedback(current_index)
|