Skip to content

Commit

Permalink
Interface logic tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
levon003 committed Jan 25, 2024
1 parent 7439eef commit 514b594
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/hint_generation/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,16 +202,16 @@ def build_app():
"Correct answer:",
key="correct_answer_text_input",
)
correct_answer = st.session_state.correct_answer_text_input.strip()
incorrect_answer = st.session_state.incorrect_answer_text_input.strip()
are_buttons_enabled = (
st.session_state.correct_answer_text_input.strip() != ""
and st.session_state.incorrect_answer_text_input.strip() != ""
and st.session_state.question_text_area.strip() != ""
correct_answer != "" and incorrect_answer != "" and st.session_state.question_text_area.strip() != ""
)
# if not are_buttons_enabled:
# st.warning(
# f"Select a practice problem above, then choose one of {len(HINT_TYPE_BUTTON_LABELS_MAP)} hint types.",
# )
if st.session_state.correct_answer_text_input.strip() == st.session_state.incorrect_answer_text_input.strip():
if len(correct_answer) > 0 and correct_answer == incorrect_answer:
st.warning("To generate a hint, the student's answer can't match the correct answer.")
are_buttons_enabled = False
# add the hint buttons
Expand Down

0 comments on commit 514b594

Please sign in to comment.