ShebMichel commited on
Commit
7fff487
·
verified ·
1 Parent(s): b25ac84

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -116,13 +116,13 @@ def read_json(file):
116
  # return text
117
 
118
  def parse_content(content):
119
- # Assuming QCM and DTM sections are clearly marked in the content
120
- sections = {"QCM": "", "DTM": ""}
121
  # Here, a simple splitting example (customize this based on your format)
122
- if "QCM" in content:
123
- sections["QCM"] = content.split("QCM")[1].split("DTM")[0].strip()
124
- if "DTM" in content:
125
- sections["DTM"] = content.split("DTM")[1].strip()
126
  return sections
127
 
128
  def handle_file_upload(file):
 
116
  # return text
117
 
118
  def parse_content(content):
119
+ # Assuming header and multiple_choice_questions sections are clearly marked in the content
120
+ sections = {"header": "", "multiple_choice_questions": ""}
121
  # Here, a simple splitting example (customize this based on your format)
122
+ if "header" in content:
123
+ sections["header"] = content.split("header")[1].split("header")[0].strip()
124
+ if "multiple_choice_questions" in content:
125
+ sections["multiple_choice_questions"] = content.split("multiple_choice_questions")[1].strip()
126
  return sections
127
 
128
  def handle_file_upload(file):