EdBoy2202 commited on
Commit
7165b5a
·
verified ·
1 Parent(s): 2be75a5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -0
app.py CHANGED
@@ -49,6 +49,10 @@ def parse_quiz_content(quiz_content):
49
  # --- Split into blocks by double newline, more robust splitting ---
50
  blocks = re.split(r'\n\n+', question_section)
51
 
 
 
 
 
52
  # --- Handle Potential Title (First Block) - More robust title check ---
53
  if blocks:
54
  first_block = blocks[0].strip()
@@ -97,6 +101,11 @@ def parse_quiz_content(quiz_content):
97
  option_text = match.group(2).strip()
98
  options[option_letter] = option_text
99
 
 
 
 
 
 
100
 
101
  if question_text: # Only add question if we successfully extracted question text
102
  questions.append({'question': question_text, 'options': options})
 
49
  # --- Split into blocks by double newline, more robust splitting ---
50
  blocks = re.split(r'\n\n+', question_section)
51
 
52
+ # --- DEBUGGING PRINT: Print the blocks after splitting ---
53
+ st.write("### Debugging: Question Blocks after Splitting:")
54
+ st.write(blocks)
55
+
56
  # --- Handle Potential Title (First Block) - More robust title check ---
57
  if blocks:
58
  first_block = blocks[0].strip()
 
101
  option_text = match.group(2).strip()
102
  options[option_letter] = option_text
103
 
104
+ # --- DEBUGGING PRINT: Print question text and options for each block ---
105
+ st.write(f"#### Debugging: Block {question_number} - Parsed Data:")
106
+ st.write(f"- Question Text: '{question_text}'")
107
+ st.write(f"- Options: {options}")
108
+
109
 
110
  if question_text: # Only add question if we successfully extracted question text
111
  questions.append({'question': question_text, 'options': options})