Skip to main content

learning app

Built-in learning management — author courses, deliver content, assess via quizzes, issue certificates.

Models (12)

  • Course — top-level course; FK to org; scope (national / regional / chapter); pass_score, recertification_cadence
  • CourseModule — ordered section of a course
  • Lesson — content block in a module: rich text, video URL, document URL, image
  • Quiz — assessment block; pass_score, max_attempts, time_limit
  • Question — quiz question; type (multiple_choice / true_false / multi_select / short_answer / free_form)
  • QuizAnswer — option for multiple-choice / multi-select questions
  • Enrollment — joins User to Course; status (assigned / in_progress / completed / failed)
  • CourseCompletion — record of a passing finish; score, completed_at
  • Assessment — final assessment block (special quiz at course end)
  • AssessmentResult — submission of an assessment
  • Certificate — issued on pass; PDF generated, public verification URL
  • MasteredSkill — skills the course teaches; auto-added to the user's MemberSkill on completion

Key endpoints

URLPurpose
GET /api/courses/Courses available to current user
POST /api/courses/Create course (admin / authoring permission)
GET /api/courses/<id>/modules/Module list
POST /api/courses/<id>/enroll/Enroll self in optional course
POST /api/courses/<id>/assign/Assign course to others (admin)
GET /api/users/enrollments/My enrollments
GET /api/users/enrollments/progress/Progress across all enrollments
POST /api/quizzes/<id>/submit/Submit a quiz
POST /api/assessments/<id>/submit/Submit final assessment
GET /api/certificates/<id>/verify/Public verification page (no auth)

Permissions

  • CanAuthorCourses — national or regional admin (configurable)
  • CanGradeAssessments — designated grader users
  • IsEnrollmentOwner — only the enrolled user can submit answers

Background tasks

  • auto_assign_courses — runs on Membership status change; matches against AssignmentRule set
  • send_course_reminders — 7 / 3 / 1 day before due
  • generate_certificates(completion_id) — renders PDF, uploads to S3, generates verification URL

External integrations

  • LibreOffice (PowerPoint → PDF conversion for legacy training material)

Notable patterns

Auto-assignment rules

AssignmentRule(course=, trigger=, audience_filter=):

  • trigger: membership_status_change | scheduled_date | manual
  • audience_filter: status / chapter / region / custom field criteria

A new pledge triggers Hazing Prevention auto-assignment if a rule matches.

Quiz grading

Five question types, with mixed grading:

  • Multiple choice / true false / multi-select — auto-graded
  • Short answer — text-match (case-insensitive, trimmed) OR routed to manual review
  • Free form — always manual review by graders

Manual review queue: GET /api/learning/grading/pending/.

Compliance linkage

Course.linked_compliance_requirement — when a member completes a linked course, the corresponding ChapterComplianceStatus for that user / requirement auto-marks complete.

Certificate verification

/certificates/<id>/verify/ is a public page (no auth) that displays:

  • Recipient name + course
  • Issued date
  • Issuing org

Used by employers / grad schools to verify legitimacy.

Versioning

Courses have published_version + draft. Editing creates a new draft. Publishing rolls forward; in-progress enrollees keep their version, new enrollments use the published version.

Code paths

  • Models: backend/apps/learning/models.py
  • Views: backend/apps/learning/views.py
  • Tasks: backend/apps/learning/tasks.py
  • Certificate generator: backend/apps/learning/services/certificates.py