From ccfacc5f92437596ed32b6bcccb45a526eab3197 Mon Sep 17 00:00:00 2001 From: Sam Davies Date: Mon, 9 Oct 2023 21:46:56 +0100 Subject: [PATCH 1/2] WEB-6520: Missing description and learning objective fields from lesson It's possible that it's because we don't use LOs yet? Not sure. But we defo need description. --- app/lib/parser/lesson_metadata.rb | 2 +- app/models/lesson.rb | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) 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/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 From c87ce8a91ff610e02c0ee0ac4abf1f92f3838671 Mon Sep 17 00:00:00 2001 From: Sam Davies Date: Mon, 9 Oct 2023 22:13:29 +0100 Subject: [PATCH 2/2] WEB-6519: Typo in the slide generator --- app/lib/snapshotter/content_module_slides.rb | 2 +- app/lib/snapshotter/video_course_slides.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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)