Update app.py
Browse files
app.py
CHANGED
@@ -116,13 +116,13 @@ def read_json(file):
|
|
116 |
# return text
|
117 |
|
118 |
def parse_content(content):
|
119 |
-
# Assuming
|
120 |
-
sections = {"
|
121 |
# Here, a simple splitting example (customize this based on your format)
|
122 |
-
if "
|
123 |
-
sections["
|
124 |
-
if "
|
125 |
-
sections["
|
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):
|