Appearance
Courses
Online courses on LearnPress's data: lessons, quizzes, students' progress, paid courses sold through the shop.
kitloom/courses · admins: kitloom/courses-filament, kitloom/courses-nova
Video lessons
Recorded in the Filament admin; the Nova admin works the same way.
Online courses: a curriculum of lessons and quizzes, students who work through it at their own pace, quizzes marked on the server, and paid courses sold through the shop. The data is where LearnPress keeps it — the plugin under Eduma and most WordPress course sites — so a site that ran it keeps its courses, students and their progress as they are.
The admin is kitloom/courses-filament or kitloom/courses-nova. A theme draws the pages: kitloom/lyceum-theme.
Setting it up
- Categories. Course categories (with sub-categories) and tags group the catalog.
- Lessons and quizzes. A lesson is a page of words, pictures and video. Mark it Preview to let anyone read it before they enroll. A quiz holds questions — true or false, single choice, multiple choice, fill in the blanks — with a passing grade, a time limit, how many retakes a student gets, whether wrong answers take marks away, and whether the right answers are shown after.
- Courses. The curriculum is sections of lessons and quizzes, in order. Then the level, the duration, the requirements, who it is for, what they will learn, the FAQs — and how it is passed: by the lessons done, by the quizzes passed, or by a final quiz, against a passing share (80% by default). A course may cap its students.
- Selling. A free course is taken with one click by a signed-in visitor. A paid course is sold by a shop product: Sell in the shop makes a virtual product with the course's price, or link one you have. The product's price is the course's. Paying gives the course; a cancelled, failed or refunded order takes it back. A guest who paid gets the course in an account with the order's email once that address is known to be theirs: an account you made gets it when they sign in; one they signed up for themselves, after they open a password reset link sent to it — anyone could sign up with someone else's address.
- Settings → Courses. Courses per page (LearnPress's own setting, kept as it was), and whether students get emails. On a site LearnPress ran, an email it had turned off in LearnPress → Settings → Emails stays off. A sale price with dates is charged only between them, in the site's time zone — and the catalog sorts and filters by that price too (a course on sale for nothing counts as free while the sale lasts).
- Reviews. As LearnPress's Course Review add-on: a student who is taking or has finished a course gives it one to five stars, a title and a few words — once; a second review is refused. Reviews go through Settings → Discussion as comments do (held for moderation, the spam protection, moderation and disallowed words), and you approve them on the Comments screen. The course's average follows every approval. Each course has two switches on its form: Enable reviews (the add-on's own, on unless you turn it off — a course from LearnPress keeps what it had) — off, the page shows no reviews and takes none; and its comments — Take new reviews in Filament, Allow Comments in Nova — off, the reviews written stay on the page and no new ones come.
How a student goes through a course
| Step | What happens |
|---|---|
| Enrolled | The course is theirs: an email with the way in. "My courses" on the account page shows it with their progress. |
| A lesson | They read it and press Complete. Lessons of a course they do not have show their title and the way to enroll, never their words. |
| A quiz | Start opens the questions; the timer runs if the quiz has one. Submit marks them on the server — the page never knows which answer is right before. Handed in more than a minute after its time is up, a quiz counts no answers. A failed quiz is retaken while retakes are left. |
| Finished | When every lesson and quiz is done, the course is finished — passed or not by its rule — and an email says so. |
Addresses are LearnPress's: /courses/{course}/, /courses/{course}/lessons/{lesson}/, /courses/{course}/quizzes/{quiz}/, /course-category/{slug}/ — or the bases set in LearnPress → Settings → Permalinks. A lesson opened at its own address is sent to its course; one in no published course is not found.
For the theme
| What | Where |
|---|---|
| The catalog | the page part courseCatalog: a page of cards on /courses/ and the categories' pages, filters (category, level, `price=free |
| A course's page | courseDetails: the card, the curriculum with the student's status per item, instructor, requirements, audiences, features, FAQs, and the button — enrolment.state (enroll, signin, buy, enrolled, finished, full, unavailable) with its addresses |
| Reviews | courseDetails.reviews: the average, the count per star, a page of approved reviews with the instructor's replies (?reviews-page=2 answers with the page's JSON), the visitor's own still waiting, and state (review, signin, students, reviewed, closed) with the form's address and spam protection |
| A lesson | lesson: whether it is open, done, its complete address, the previous and next items, the curriculum |
| A quiz | quiz: its state (locked, ready, started, completed), the questions while started (options without their rightness, blanks as segments), startedAt/endsAt, the latest result with the review |
| The steps | POST /wp-json/courses/v1/courses/{id}/enroll, …/lessons/{id}/complete, …/quizzes/{id}/start, …/submit (answers: question id => option value, a list of values, or blank key => word), …/retake; a review: POST …/courses/{id}/reviews (rating 1–5, title, review) |
| Buying | the shop's POST /wp-json/wc/store/v1/cart/add-item with product_id = enrolment.productId |
| My courses | the account section courses |
Who may do what
The capabilities are LearnPress's, so a site's roles mean what they meant there: courses go by edit_lp_courses, publish_lp_courses, edit_others_lp_courses and the rest; lessons, quizzes and questions — one set for the three, as in LearnPress — by edit_lp_lessons, publish_lp_lessons, edit_others_lp_lessons and the rest. When the module is first installed the roles that may do the same with posts get them: administrators and editors everyone's, authors and contributors their own, as with posts. Change it on Users → Roles. A course's students are seen and given by whoever may edit the course; Settings → Courses needs manage_courses.
LearnPress's Instructor role (lp_teacher) is not created: kitloom does not yet read roles from a WordPress site's wp_user_roles. Make a role with the same capabilities (their own courses and lessons, upload_files) on Users → Roles.
Where things are kept
| What | Where |
|---|---|
| Courses, lessons, quizzes, questions | posts of lp_course, lp_lesson, lp_quiz, lp_question, settings in _lp_* meta |
| Curriculum | learnpress_sections, learnpress_section_items |
| A quiz's questions, a question's options | learnpress_quiz_questions, learnpress_question_answers (fill in the blanks: [fib fill="…"] in its text) |
| Students and progress | learnpress_user_items — a row per course (what gave it: wc_order, free, manual, LearnPress's own lp_order) and per lesson and quiz under it; learnpress_user_item_results — each quiz attempt and the course's evaluation, JSON |
| Course ↔ product | the product's _lp_woo_courses_assigned, as LearnPress's WooCommerce add-on keeps it; the course's _kitloom_course_product |
| Reviews | comments of type review on the course, the stars in _lpr_rating, the title in _lpr_review_title; the average in the course's lp_course_rating_average, "Enable reviews" in _lp_course_review_enable — as the Course Review add-on keeps them |
| Configuration | config/kitloom-courses.php: the addresses' bases |
AI agents (kitloom/ai): courses_list, courses_get, courses_save (with the curriculum), courses_students, courses_enroll. Personal data (kitloom/privacy): a student's courses and results are exported and erased by their email; a course an order paid for stays theirs, only its progress is erased. Reviews are comments: kitloom/privacy's comments exporter and eraser take them.
Tests
From the application that installs the package: php vendor/bin/phpunit --testsuite Courses. A theme's or admin's test creates courses with Kitloom\Courses\Testing\CreatesCourses.