|
261 | 261 | "metadata": {}, |
262 | 262 | "outputs": [], |
263 | 263 | "source": [ |
264 | | - "def replace_figures_in_markdown(md_content, figures):\n", |
| 264 | + "def replace_figures_in_markdown(md_content, figures) -> str:\n", |
265 | 265 | " #replace the image URLs in the markdown content with local paths\n", |
266 | 266 | " # add pictureTag for Lambda Feedback to recognise it as a picture\n", |
267 | 267 | " md_content = md_content.replace(\"![]\", \"![pictureTag]\")\n", |
|
275 | 275 | " print(\"Modified markdown saved successfully.\")\n", |
276 | 276 | " except Exception as e:\n", |
277 | 277 | " print(f\"Error saving modified markdown: {e}\")\n", |
| 278 | + " \n", |
| 279 | + " return md_content\n", |
278 | 280 | "\n", |
279 | | - "replace_figures_in_markdown(md_content, figures)" |
| 281 | + "md_content = replace_figures_in_markdown(md_content, figures)" |
280 | 282 | ] |
281 | 283 | }, |
282 | 284 | { |
|
935 | 937 | " dict: A dictionary containing the keys \"name\" and \"exercise\".\n", |
936 | 938 | " If parsing fails, returns None.\n", |
937 | 939 | " \"\"\"\n", |
938 | | - " # corrected_md_content = correct_mistakes_in_markdown(md_content)\n", |
939 | | - " # print(\"Markdown content corrected for spelling, grammar, and structure.\")\n", |
| 940 | + " corrected_md_content = correct_mistakes_in_markdown(md_content)\n", |
| 941 | + " print(\"Markdown content corrected for spelling, grammar, and structure.\")\n", |
940 | 942 | "\n", |
941 | | - " questions_dict = extract_questions(md_content)\n", |
| 943 | + " questions_dict = extract_questions(corrected_md_content)\n", |
942 | 944 | " print(\"successfully extracted the questions from the markdown. Now extracting the parts...\")\n", |
943 | 945 | "\n", |
944 | 946 | " extracted_dict = extract_parts_question(questions_dict)\n", |
|
0 commit comments