Sha256: a18078edc73e408968b5d8a7a17a9320a5735530624be016c7cb4df0398775bf

Contents?: true

Size: 713 Bytes

Versions: 1

Compression:

Stored size: 713 Bytes

Contents

# frozen_string_literal: true

module Kitchen::Directions::MoveSolutionsToAnswerKey
  module Strategies
    class ContemporaryMath
      def bake(chapter:, append_to:)
        # Hacky numbering fix
        chapter.notes('$.your-turn').exercises.each do |exercise|
          solution = exercise.solution
          next unless solution

          number = exercise.ancestor(:note).count_in(:chapter)
          solution.first('a.os-number').inner_html = number.to_s
          solution.first('span.os-divider').inner_html = '. '
        end

        Kitchen::Directions::MoveSolutionsFromNumberedNote.v1(
          chapter: chapter, append_to: append_to, note_class: 'your-turn'
        )
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
openstax_kitchen-11.0.0 lib/kitchen/directions/move_solutions_to_answer_key/strategies/contemporary_math.rb