ami_models v0.3.0 Ami.Course
Link to this section Summary
Functions
Fetch courses to display on the my_courses page tailored for given user If given user is business member (2), fetch
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
catalog_for(user_struct)
Fetch courses to display on the my_courses page tailored for given user If given user is business member (2), fetch:
- courses with open course periods belonging to the communities the user is member of
- courses with open course periods belonging to the communities the user is moderator of If given user is member (1), fetch above plus the followings:
- 'on air' featured courses
- 'on air' open public courses
- 'on air' closed public courses If given user is non-member (0) fetch:
- 'on air' public courses
- 'on air' courses with course periods belonging to communities
- 'on air' courses with course periods belonging to 'Universal' and 'Public' communities
catalog_for(user_struct, type)
catalog_of_open_public_cp()
changeset(course, params \\ %{})
clone(course)
clone_affiliate_logo_attachments(arg)
clone_course_resources(arg)
clone_course_struct(course)
clone_instructors(arg)
clone_tags(arg)
clone_thumb_image_attachments(arg)
clone_units(arg)
community_course_changeset(course, params \\ %{})
distinct_instructors(course)
final_exam(course_id)
find_or_build_tag(tag_name)
graded_exams(course)
has_intro_activity?(course)
intro_activity_url(course)
levels_map()
marking_guide_url(arg)
parse_tags(changeset)
pre_assessment_quiz(course)
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