ami_models v0.2.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

Link to this function

changeset(lesson, params \\ %{})

Link to this function

changeset_with_quiz(lesson, params \\ %{})

Link to this function

completed?(lesson, enrollment)

Check if the lesson is completed or not

Link to this function

conditionaly_cast_assoc(changeset, atom)

Link to this function

find_or_build_tag(tag_name)

Link to this function

has_activity?(lesson)

Helper checking if a lesson has got an 'Activity' resource

Link to this function

parse_tags(changeset)

Link to this function

preload_resources(struct)

Pattern to fetch resources as lesson.resources with resourceable_type == "Lesson"

Link to this function

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

Link to this function

struct_for_lesson_wizard()