Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/recipes/astronomy/recipe.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@
append_to: exercises_composite_chapter
) do |section|
RemoveSectionTitle.v1(section: section)
title = EocSectionTitleLinkSnippet.v1(page: section.ancestor(:page))
section.prepend(child: title)
end
end
exercises_composite_chapter.exercises.each do |exercise|
Expand Down
2 changes: 2 additions & 0 deletions lib/recipes/business-ethics/recipe.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@
section_selector: "section.#{section_key}"
) do |section|
RemoveSectionTitle.v1(section: section)
title = EocSectionTitleLinkSnippet.v1(page: section.ancestor(:page))
section.prepend(child: title)
end
end

Expand Down
16 changes: 13 additions & 3 deletions lib/recipes/economics/recipe.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,24 @@
BakeChapterSummary.v1(chapter: chapter, metadata_source: metadata)

exercise_section_classes = \
%w[summary self-check-questions review-questions critical-thinking problems]
%w[self-check-questions review-questions critical-thinking problems]

chapter.search(exercise_section_classes.prefix('section.')).exercises.each do |exercise|
BakeNumberedExercise.v1(exercise: exercise, number: exercise.count_in(:chapter))
end

exercise_section_classes.each do |klass|
MoveExercisesToEOC.v1(chapter: chapter, metadata_source: metadata, klass: klass)
exercise_section_classes.each do |section_key|
MoveCustomSectionToEocContainer.v1(
chapter: chapter,
metadata_source: metadata,
container_key: section_key,
uuid_key: ".#{section_key}",
section_selector: "section.#{section_key}"
) do |section|
RemoveSectionTitle.v1(section: section)
title = EocSectionTitleLinkSnippet.v1(page: section.ancestor(:page))
section.prepend(child: title)
end
end

answer_key_inner_container = AnswerKeyInnerContainer.v1(
Expand Down
16 changes: 11 additions & 5 deletions lib/recipes/microbiology/recipe.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,19 @@
exercise_section_classes = %w[multiple-choice true-false matching
fill-in-the-blank short-answer critical-thinking]

exercise_section_classes.each do |klass|
MoveExercisesToEOC.v1(
exercise_section_classes.each do |section_key|
MoveCustomSectionToEocContainer.v1(
chapter: chapter,
metadata_source: metadata,
append_to: eoc_wrapper,
klass: klass
)
container_key: section_key,
uuid_key: ".#{section_key}",
section_selector: "section.#{section_key}",
append_to: eoc_wrapper
) do |section|
RemoveSectionTitle.v1(section: section)
title = EocSectionTitleLinkSnippet.v1(page: section.ancestor(:page))
section.prepend(child: title)
end
end

chapter.search(exercise_section_classes.prefix('section.').join(', ')).exercises
Expand Down