ycho223 commited on
Commit
b568a13
Β·
verified Β·
1 Parent(s): 428030b

Update src/exp2-pilot.py

Browse files
Files changed (1) hide show
  1. src/exp2-pilot.py +8 -9
src/exp2-pilot.py CHANGED
@@ -73,14 +73,13 @@ def upload_to_google_drive(response_df):
73
 
74
  # Add headers if the sheet is empty or headers don't match
75
  if not current_sheet_headers or current_sheet_headers != expected_headers:
76
- if sheet.row_count > 0:
77
- st.warning("Google Sheet headers do not match. Data will be appended, but consider manual alignment or creating a new sheet/worksheet.")
78
-
79
  if not current_sheet_headers: # Only add if sheet is truly empty after potential clear
80
  sheet.append_row(expected_headers)
81
- st.info("Added headers to the Google Sheet.")
82
- elif current_sheet_headers != expected_headers:
83
- st.error("Existing sheet headers mismatch. Data will be appended, but columns might be misaligned.")
84
 
85
 
86
  # Prepare data: Replace NaN, inf with empty string, then convert to list of lists
@@ -283,7 +282,7 @@ def training():
283
  st.session_state.training_complete = True
284
  st.header("πŸŽ‰ Practice Complete!")
285
  st.markdown("""
286
- <div style='font-size:16px; line-height:1.6;'>
287
  You've successfully completed the training phase of the experiment. Great work! 🎯<br><br>
288
  If you have any questions, suggestions, or feedback about the task, please let us know.<br>
289
  If everything is clear, just let us know that you're ready to proceed to the main experiment.
@@ -497,8 +496,8 @@ def training():
497
  # Validate response time
498
  response_time = time.time() - st.session_state.response_start_time
499
 
500
- if response_time < 5: # Minimum 5 seconds for careful evaluation per section
501
- st.warning("⚠️ Please take enough time to read and evaluate carefully before proceeding. (Minimum 5 seconds required per section)")
502
  st.stop()
503
 
504
  # If all validations pass, record responses for this section
 
73
 
74
  # Add headers if the sheet is empty or headers don't match
75
  if not current_sheet_headers or current_sheet_headers != expected_headers:
76
+ # if sheet.row_count > 0:
77
+ # st.warning("Google Sheet headers do not match. Data will be appended, but consider manual alignment or creating a new sheet/worksheet.")
 
78
  if not current_sheet_headers: # Only add if sheet is truly empty after potential clear
79
  sheet.append_row(expected_headers)
80
+ # st.info("Added headers to the Google Sheet.")
81
+ # elif current_sheet_headers != expected_headers:
82
+ # st.error("Existing sheet headers mismatch. Data will be appended, but columns might be misaligned.")
83
 
84
 
85
  # Prepare data: Replace NaN, inf with empty string, then convert to list of lists
 
282
  st.session_state.training_complete = True
283
  st.header("πŸŽ‰ Practice Complete!")
284
  st.markdown("""
285
+ <div style='font-size:18px; line-height:1.6;'>
286
  You've successfully completed the training phase of the experiment. Great work! 🎯<br><br>
287
  If you have any questions, suggestions, or feedback about the task, please let us know.<br>
288
  If everything is clear, just let us know that you're ready to proceed to the main experiment.
 
496
  # Validate response time
497
  response_time = time.time() - st.session_state.response_start_time
498
 
499
+ if response_time < 3: # Minimum 5 seconds for careful evaluation per section
500
+ st.warning("⚠️ Please take enough time to read and evaluate carefully before proceeding. (Minimum 3 seconds required per section)")
501
  st.stop()
502
 
503
  # If all validations pass, record responses for this section