ami_models v0.2.5 Ami.Course

Link to this section Summary

Link to this section Functions

Link to this function

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
Link to this function

catalog_for(user_struct, type)

Link to this function

catalog_of_open_public_cp()

Link to this function

changeset(course, params \\ %{})

Link to this function

clone_affiliate_logo_attachments(arg)

Link to this function

clone_course_resources(arg)

Link to this function

clone_course_struct(course)

Link to this function

clone_instructors(arg)

Link to this function

clone_tags(arg)

Link to this function

clone_teaser_image_attachments(arg)

Link to this function

clone_thumb_image_attachments(arg)

Link to this function

clone_units(arg)

Link to this function

community_course_changeset(course, params \\ %{})

Link to this function

distinct_instructors(course)

Link to this function

final_exam(course_id)

Link to this function

find_or_build_tag(tag_name)

Link to this function

graded_exams(course)

Link to this function

has_intro_activity?(course)

Link to this function

intro_activity_url(course)

Link to this function

marking_guide_url(arg)

Link to this function

parse_tags(changeset)

Link to this function

pre_assessment_quiz(course)

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

readable_level_for(course)

Link to this function

topics_for(course_struct)

Link to this function

unit_exams(course)

Link to this function

unit_for_lesson(course, lesson)