@@ -76,13 +76,15 @@ def __init__(
76
76
publishedPartContent : Optional [str ] = None ,
77
77
publishedPartAnswerContent : Optional [str ] = None ,
78
78
publishedWorkedSolutionSections : Optional [List [dict ]] = [],
79
+ publishedStructuredTutorialSections : Optional [List [dict ]] = [],
79
80
publishedResponseAreas : Optional [List [Optional [ResponseAreaDetails ]]] = [],
80
81
):
81
82
self .publishedPartId = publishedPartId
82
83
self .publishedPartPosition = publishedPartPosition
83
84
self .publishedPartContent = publishedPartContent
84
85
self .publishedPartAnswerContent = publishedPartAnswerContent
85
86
self .publishedWorkedSolutionSections = publishedWorkedSolutionSections
87
+ self .publishedStructuredTutorialSections = publishedStructuredTutorialSections
86
88
self .publishedResponseAreas = [ResponseAreaDetails (** publishedResponseArea ) for publishedResponseArea in publishedResponseAreas ]
87
89
88
90
class QuestionDetails :
@@ -277,9 +279,20 @@ def _format_single_part(
277
279
'content' : ws .get ('content' , '' ),
278
280
'position' : ws .get ('position' , 0 )
279
281
})
282
+
283
+ # 6. Structured Tutorial Sections
284
+ tutorial_data = []
285
+ if part .publishedStructuredTutorialSections :
286
+ for ts in part .publishedStructuredTutorialSections :
287
+ tutorial_data .append ({
288
+ 'title' : ts .get ('title' , '' ),
289
+ 'content' : ts .get ('content' , '' ),
290
+ 'position' : ts .get ('position' , 0 )
291
+ })
280
292
281
293
part_sections .append (PromptFormatter .format_worked_solutions (solutions_data ))
282
-
294
+ part_sections .append (PromptFormatter .format_structured_tutorials (tutorial_data ))
295
+
283
296
return "\n " .join (part_sections ) + "\n ---\n "
284
297
285
298
0 commit comments