@@ -538,6 +538,9 @@ def manifest_data_to_db(course_name, manifest_path):
538
538
# Process chapters and content
539
539
_process_chapters (sess , db_context , course_name , manifest_path )
540
540
541
+ # And appendices. They should not have questions, but may have source code/datafiles
542
+ _process_appendices (sess , db_context , course_name , manifest_path )
543
+
541
544
# Set course attributes
542
545
_set_course_attributes (sess , db_context , course_name , manifest_path )
543
546
@@ -623,6 +626,21 @@ def _process_chapters(sess, db_context, course_name, manifest_path):
623
626
_process_subchapters (sess , db_context , chapter , chapid , course_name )
624
627
625
628
629
+ def _process_appendices (sess , db_context , course_name , manifest_path ):
630
+ """Process all appendices from the manifest."""
631
+ rslogger .info ("Populating the database with Appendix information" )
632
+
633
+ tree = ET .parse (manifest_path )
634
+ root = tree .getroot ()
635
+
636
+ for appendix in root .findall ("./appendix" ):
637
+ _process_source_elements (sess , appendix , course_name )
638
+
639
+ for data_file in appendix .findall ("./datafile" ):
640
+ el = data_file .find (".//*[@data-component]" )
641
+ _handle_datafile (el , course_name )
642
+
643
+
626
644
def _process_single_chapter (sess , db_context , chapter , chap_num , course_name ):
627
645
"""Process a single chapter and return its database ID."""
628
646
rslogger .info (chapter )
0 commit comments