diff --git a/app/lib/parser/lesson_metadata.rb b/app/lib/parser/lesson_metadata.rb index df9c88b..76f8550 100644 --- a/app/lib/parser/lesson_metadata.rb +++ b/app/lib/parser/lesson_metadata.rb @@ -5,7 +5,7 @@ module Parser class LessonMetadata include SimpleAttributes - VALID_SIMPLE_ATTRIBUTES = %i[title description ordinal ref].freeze + VALID_SIMPLE_ATTRIBUTES = %i[title description_md learning_objectives_md ordinal ref].freeze attr_accessor :lesson, :metadata diff --git a/app/lib/snapshotter/content_module_slides.rb b/app/lib/snapshotter/content_module_slides.rb index 280b1fc..651f4d6 100644 --- a/app/lib/snapshotter/content_module_slides.rb +++ b/app/lib/snapshotter/content_module_slides.rb @@ -2,7 +2,7 @@ module Snapshotter # Creates snapshots of all the slides in a content module - class ContentModule < Slides + class ContentModuleSlides < Slides def generate data.each do |lesson| lesson.segments.each do |segment| diff --git a/app/lib/snapshotter/video_course_slides.rb b/app/lib/snapshotter/video_course_slides.rb index 24740b1..0227f68 100644 --- a/app/lib/snapshotter/video_course_slides.rb +++ b/app/lib/snapshotter/video_course_slides.rb @@ -2,7 +2,7 @@ module Snapshotter # Creates snapshots of all the slides in a video course - class ContentModule < Slides + class VideoCourseSlides < Slides def generate data.each do |episode| next unless episode.is_a?(Video) diff --git a/app/models/lesson.rb b/app/models/lesson.rb index 99fdfd7..3c39c50 100644 --- a/app/models/lesson.rb +++ b/app/models/lesson.rb @@ -7,8 +7,10 @@ class Lesson include Concerns::ImageAttachable include Concerns::MarkdownRenderable - attr_accessor :title, :description, :ordinal, :ref, :segments + attr_accessor :title, :description_md, :ordinal, :ref, :segments, :learning_objectives_md + attr_markdown :description, source: :description_md, file: false + attr_markdown :learning_objectives, source: :learning_objectives_md, file: false validates :title, :ordinal, presence: true def initialize(attributes = {}) @@ -22,7 +24,7 @@ def slug # Used for serialisation def attributes - { title: nil, description: nil, ordinal: nil, segments: [], ref: nil }.stringify_keys + { title: nil, description: nil, learning_objectives: nil, ordinal: nil, segments: [], ref: nil }.stringify_keys end # Used for linting