ami_models v0.3.0 Ami.Lesson
Link to this section Summary
Functions
Check if the lesson is completed or not
Helper checking if a lesson has got an 'Activity' resource
Pattern to fetch resources as lesson.resources with resourceable_type == "Lesson"
Because of better design patterns implemented by Ecto we cannot return lesson.videos to return correct videos. preload_videos implement a pattern which will return lesson.videos to return only videos with videoable_type == "Lesson" for the given lesson
Link to this section Functions
changeset(lesson, params \\ %{})
changeset_with_quiz(lesson, params \\ %{})
completed?(lesson, enrollment)
Check if the lesson is completed or not
conditionaly_cast_assoc(changeset, atom)
find_or_build_tag(tag_name)
has_activity?(lesson)
Helper checking if a lesson has got an 'Activity' resource
parse_tags(changeset)
preload_resources(struct)
Pattern to fetch resources as lesson.resources with resourceable_type == "Lesson"
preload_videos(struct)
Because of better design patterns implemented by Ecto we cannot return lesson.videos to return correct videos. preload_videos implement a pattern which will return lesson.videos to return only videos with videoable_type == "Lesson" for the given lesson