Courses, lessons and quizzes

How a course is built, how progress is counted, and how quizzes are scored and limited.

A course

Field Notes
Titles, subtitles, descriptions Arabic and English. Paragraphs are separated by a blank line
Outcomes, requirements One per line, in both languages
FAQ Course questions; the academy's common questions (access, certificate, refund) are added after them
Category, instructor, level, teaching language Used by the catalogue filters
Format Recorded (self-paced) or Live (cohort with sessions on the schedule)
Price, "was" price In OMR. 0 = free. The "was" price shows only when it is higher than the price
Status Draft (hidden), Published (in the catalogue, can be bought), Archived (hidden from the catalogue and not for sale, still open to enrolled learners)
Featured Shown first on the home page (admins only)
Certificate Whether completing the course issues a certificate

The duration is the sum of the lesson minutes; the rating is the average of approved reviews; the learner count is the number of enrolments. All three are computed, never typed.

Sections and lessons

A course has sections; a section has lessons in order. A lesson is:

  • Text: Markdown (headings, lists, links, code and code blocks, quotes). Raw HTML is shown as text, so a lesson cannot inject scripts.
  • Video: an https link to YouTube, Vimeo or an .mp4/.webm/.m4v file, with optional Markdown notes under the player. YouTube is embedded through youtube-nocookie.com.

Each lesson has minutes (for the duration) and a free preview switch: preview lessons open to everyone at /courses/{slug}/preview/{lessonId}, other lessons only to enrolled learners (the API answers 403 locked).

Progress

When a learner marks a lesson complete, the server records it and recomputes the enrolment's progress: completed lessons / lessons, rounded down, and 100% only when every lesson is done (progressPercent in src/lib/learning.ts). The value is cached on the enrolment for lists and charts. Adding or deleting lessons recomputes every enrolment of the course.

The player remembers the last lesson opened; "Resume" goes back to it, and the course home sends the learner to the first lesson not yet done.

Quizzes

Setting Meaning
Shown after A section, or the end of the course
Pass mark Percent needed to pass (70 by default)
Attempts allowed 0 = unlimited. Once passed, a quiz cannot be retaken
Required Required quizzes must be passed for the certificate

Questions are multiple choice (2 to 8 answers, one right) or true / false, in both languages, with an optional explanation shown after an attempt.

Scoring is done on the server (scoreQuiz in src/lib/learning.ts): the score is the whole percent of right answers rounded down, so 69.9% does not pass a 70% mark; unanswered questions count as wrong. The quiz page receives the questions without the right answers; the attempt's answer reveals them with the explanations, only after the attempt is saved. A new attempt is refused with 409 already_passed or 409 no_attempts_left.

Live courses

Set the format to Live and add sessions in Dashboard > Schedule (date, time in Muscat time, length, meeting link, notes). Enrolled learners see the upcoming sessions with a Join button on their course home; the public course page lists the next dates without the link.

AI help

With AI_BASE_URL set, the course editor's Write with AI drafts the subtitle, description and outcomes from the syllabus, and the quiz builder drafts questions from a chosen lesson. Drafts are shown for review; nothing is saved until you save it. See AI assistant.