CarolineM5 commited on
Commit
e9dc4d9
·
verified ·
1 Parent(s): 3a37bbe

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -5
app.py CHANGED
@@ -35,7 +35,7 @@ def load_image_pair(index):
35
  def form_callback(name, imgID, correct):
36
  with open(RESULTS_FILE, 'a+') as f: #Append & read mode
37
  yes = f.write(f"{name},{imgID},{correct}\n")
38
- st.success(f"{name},{imgID},{correct}\n")
39
 
40
  # def form_callback(name, results_list):
41
  # # On convertit la liste de dictionnaires en lignes CSV.
@@ -114,6 +114,18 @@ if st.session_state.page == "evaluation":
114
  st.success("Thank you for completing the evaluation!")
115
  # results_df = pd.DataFrame(st.session_state.results)
116
  # results_df.to_csv(RESULTS_FILE, index=False)
 
 
 
 
 
 
 
 
 
 
 
 
117
 
118
 
119
  #Calculating result
@@ -122,10 +134,8 @@ if st.session_state.page == "evaluation":
122
 
123
  st.success(f"Number of correct answers: {nb_correct}/{NUM_PAIRS}")
124
 
125
- submitted = st.button("Submit")
126
- if submitted:
127
- form_callback(st.session_state.user_name, st.session_state.list_pair_ID, correct_guess)
128
- st.stop()
129
 
130
 
131
  # d = {'ID_img': st.session_state.list_pair_ID, 'Correct': correct_guess}
 
35
  def form_callback(name, imgID, correct):
36
  with open(RESULTS_FILE, 'a+') as f: #Append & read mode
37
  yes = f.write(f"{name},{imgID},{correct}\n")
38
+ # st.success(f"{name},{imgID},{correct}\n")
39
 
40
  # def form_callback(name, results_list):
41
  # # On convertit la liste de dictionnaires en lignes CSV.
 
114
  st.success("Thank you for completing the evaluation!")
115
  # results_df = pd.DataFrame(st.session_state.results)
116
  # results_df.to_csv(RESULTS_FILE, index=False)
117
+
118
+ confidence = st.select_slider(
119
+ "How confident were you in your selections?",
120
+ options=[
121
+ "Not confident at all",
122
+ "Slightly confident",
123
+ "Moderately confident",
124
+ "Very confident",
125
+ "Extremely confident"
126
+ ],
127
+ value="Moderately confident",
128
+ )
129
 
130
 
131
  #Calculating result
 
134
 
135
  st.success(f"Number of correct answers: {nb_correct}/{NUM_PAIRS}")
136
 
137
+ form_callback(st.session_state.user_name, st.session_state.list_pair_ID, correct_guess)
138
+ st.stop()
 
 
139
 
140
 
141
  # d = {'ID_img': st.session_state.list_pair_ID, 'Correct': correct_guess}