Skip to content

Commit

Permalink
Merge pull request #221 from razeware/WEB-6520
Browse files Browse the repository at this point in the history
WEB-6520: Missing description and learning objective fields from lesson
  • Loading branch information
sammyd authored Oct 9, 2023
2 parents 86a0fc9 + c87ce8a commit 6c05cd4
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/lib/parser/lesson_metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion app/lib/snapshotter/content_module_slides.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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|
Expand Down
2 changes: 1 addition & 1 deletion app/lib/snapshotter/video_course_slides.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 4 additions & 2 deletions app/models/lesson.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {})
Expand All @@ -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
Expand Down

0 comments on commit 6c05cd4

Please sign in to comment.