coursekit-lms 0.1.2 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (173) hide show
  1. package/CHANGELOG.md +76 -0
  2. package/README.md +127 -26
  3. package/dist/cli/index.js +7139 -1633
  4. package/dist/cli/index.js.map +1 -1
  5. package/dist/server/index.js +7128 -1655
  6. package/dist/server/index.js.map +1 -1
  7. package/dist/types/server/config.d.ts +4 -0
  8. package/dist/types/server/db/migrations/002_email.d.ts +8 -0
  9. package/dist/types/server/db/migrations/003_groups_cohorts.d.ts +7 -0
  10. package/dist/types/server/db/migrations/004_completion_badges.d.ts +8 -0
  11. package/dist/types/server/db/migrations/005_question_bank.d.ts +11 -0
  12. package/dist/types/server/db/migrations/006_grade_categories.d.ts +11 -0
  13. package/dist/types/server/db/schema-completion.d.ts +79 -0
  14. package/dist/types/server/db/schema.d.ts +165 -5
  15. package/dist/types/server/index.d.ts +7 -0
  16. package/dist/types/server/lib/events.d.ts +105 -0
  17. package/dist/types/server/routes/badges.d.ts +4 -0
  18. package/dist/types/server/routes/certificates.d.ts +3 -0
  19. package/dist/types/server/routes/cohorts.d.ts +6 -0
  20. package/dist/types/server/routes/completion.d.ts +4 -0
  21. package/dist/types/server/routes/email.d.ts +13 -0
  22. package/dist/types/server/routes/grade-categories.d.ts +4 -0
  23. package/dist/types/server/routes/groups.d.ts +4 -0
  24. package/dist/types/server/routes/question-bank.d.ts +4 -0
  25. package/dist/types/server/seed/demo-completion.d.ts +2 -0
  26. package/dist/types/server/seed/demo-email.d.ts +2 -0
  27. package/dist/types/server/seed/demo-grade-categories.d.ts +6 -0
  28. package/dist/types/server/seed/demo-groups.d.ts +6 -0
  29. package/dist/types/server/seed/demo-question-bank.d.ts +20 -0
  30. package/dist/types/server/services/badges.d.ts +39 -0
  31. package/dist/types/server/services/certificates.d.ts +42 -0
  32. package/dist/types/server/services/cohorts.d.ts +64 -0
  33. package/dist/types/server/services/completion.d.ts +63 -0
  34. package/dist/types/server/services/course-total.d.ts +107 -0
  35. package/dist/types/server/services/email/config.d.ts +55 -0
  36. package/dist/types/server/services/email/digests.d.ts +57 -0
  37. package/dist/types/server/services/email/outbox.d.ts +61 -0
  38. package/dist/types/server/services/email/preferences.d.ts +25 -0
  39. package/dist/types/server/services/email/service.d.ts +116 -0
  40. package/dist/types/server/services/email/templates.d.ts +74 -0
  41. package/dist/types/server/services/email/tokens.d.ts +11 -0
  42. package/dist/types/server/services/email/transport.d.ts +29 -0
  43. package/dist/types/server/services/enrolments.d.ts +32 -0
  44. package/dist/types/server/services/grade-categories.d.ts +31 -0
  45. package/dist/types/server/services/gradebook.d.ts +18 -0
  46. package/dist/types/server/services/groups.d.ts +90 -0
  47. package/dist/types/server/services/notify.d.ts +4 -1
  48. package/dist/types/server/services/question-bank.d.ts +53 -0
  49. package/dist/types/server/services/question-types.d.ts +146 -0
  50. package/dist/types/server/services/quiz-slots.d.ts +33 -0
  51. package/dist/types/server/services/quiz.d.ts +45 -14
  52. package/dist/types/shared/completion.d.ts +214 -0
  53. package/dist/types/shared/email.d.ts +117 -0
  54. package/dist/types/shared/grades.d.ts +18 -0
  55. package/dist/types/shared/groups.d.ts +17 -0
  56. package/dist/types/shared/permissions.d.ts +1 -1
  57. package/dist/types/shared/types.d.ts +268 -2
  58. package/dist/web/assets/{ActivityEditor-BVSZUV8l.js → ActivityEditor-BNG3aTQa.js} +2 -2
  59. package/dist/web/assets/ActivityPage-i0XHYD2Q.js +1 -0
  60. package/dist/web/assets/AdminBadgesPage-DvpxIg1P.js +1 -0
  61. package/dist/web/assets/AdminCohortsPage-B5PWBkjp.js +3 -0
  62. package/dist/web/assets/AdminCoursesPage-Dm1ECbS-.js +1 -0
  63. package/dist/web/assets/AdminEmailPage-D3E_Db1_.js +1 -0
  64. package/dist/web/assets/AdminLayout-BVeduyCQ.js +1 -0
  65. package/dist/web/assets/{AdminOverviewPage-DnTrdGbr.js → AdminOverviewPage-BaCKvhgr.js} +1 -1
  66. package/dist/web/assets/{AdminSettingsPage-B82cX8xU.js → AdminSettingsPage-B5Ag5K15.js} +1 -1
  67. package/dist/web/assets/AdminUsersPage-BVCG65EK.js +1 -0
  68. package/dist/web/assets/{AnnouncementsPage-BKW30k0Z.js → AnnouncementsPage-C0OAzyvW.js} +1 -1
  69. package/dist/web/assets/BadgePage-B3Ecudas.js +1 -0
  70. package/dist/web/assets/CalendarPage-CEks5F4m.js +1 -0
  71. package/dist/web/assets/{CatalogPage-BiMgSSBR.js → CatalogPage-e7lVtwUN.js} +1 -1
  72. package/dist/web/assets/CertificatePage-_eSGt8R-.js +9 -0
  73. package/dist/web/assets/CompletionPage-Dxp-ulA_.js +1 -0
  74. package/dist/web/assets/CourseBadgesPage-Vi3P1Lnc.js +1 -0
  75. package/dist/web/assets/CourseContentPage-IFlhVsO5.js +1 -0
  76. package/dist/web/assets/CourseLayout-BqwXol8L.js +1 -0
  77. package/dist/web/assets/CourseSettingsPage-BIagLirb.js +1 -0
  78. package/dist/web/assets/CreateCoursePage-BBcdiTtz.js +1 -0
  79. package/dist/web/assets/{DiscussionPage-CWwVpFQV.js → DiscussionPage-C23QoCSw.js} +1 -1
  80. package/dist/web/assets/GradebookSetupPage-a5GH4xIk.js +1 -0
  81. package/dist/web/assets/GradesPage-CY6MtJxs.js +1 -0
  82. package/dist/web/assets/GroupsPage-DS3HFeC4.js +1 -0
  83. package/dist/web/assets/{MyCoursesPage-Dd-Oaygv.js → MyCoursesPage-Ckj-1SCA.js} +1 -1
  84. package/dist/web/assets/{NotFoundPage-BRquC7-l.js → NotFoundPage-BmwVsGAy.js} +1 -1
  85. package/dist/web/assets/NotificationsPage-DBRM37F1.js +1 -0
  86. package/dist/web/assets/ParticipantsPage-DV4Mjfxo.js +1 -0
  87. package/dist/web/assets/ProfilePage-BqG55_02.js +1 -0
  88. package/dist/web/assets/QuestionAnswer-CJIoWSz2.js +1 -0
  89. package/dist/web/assets/QuestionBankPage-BkI44c4K.js +1 -0
  90. package/dist/web/assets/QuizAttemptPage-DQVfbLKI.js +1 -0
  91. package/dist/web/assets/QuizEditorPage-muk-KVG1.js +1 -0
  92. package/dist/web/assets/SubmissionsPage-Dx97JOzE.js +1 -0
  93. package/dist/web/assets/UnsubscribePage-BPLiTiaG.js +1 -0
  94. package/dist/web/assets/VerifyCertificatePage-Cw9iXN3C.js +1 -0
  95. package/dist/web/assets/achievements-DaIfUTKU.js +1 -0
  96. package/dist/web/assets/{arrow-up-LHDup5m4.js → arrow-up-lI30bvj5.js} +1 -1
  97. package/dist/web/assets/badge-art-QPo-pYql.js +1 -0
  98. package/dist/web/assets/badge-card-ByT0wR6q.js +1 -0
  99. package/dist/web/assets/badge-dialog-p2zTk4h0.js +1 -0
  100. package/dist/web/assets/{ban-D3Vsxg_g.js → ban-DEiI8npI.js} +1 -1
  101. package/dist/web/assets/bank-S3XEFPfe.js +3 -0
  102. package/dist/web/assets/bell-off-Bo2RE0kn.js +1 -0
  103. package/dist/web/assets/calendar-range-Cfg-P4Md.js +1 -0
  104. package/dist/web/assets/certificate-sheet-DzW0lfzR.js +2 -0
  105. package/dist/web/assets/chevron-left-Bu6IJANV.js +1 -0
  106. package/dist/web/assets/circle-dashed-D34ZjnSx.js +1 -0
  107. package/dist/web/assets/clock-DPBmdKAi.js +1 -0
  108. package/dist/web/assets/cohorts-DL0Dsxva.js +1 -0
  109. package/dist/web/assets/completion-2z7I-ypT.js +1 -0
  110. package/dist/web/assets/contact-NCWQa7wc.js +1 -0
  111. package/dist/web/assets/{context-BLVW7NB7.js → context-D8W_QqNi.js} +1 -1
  112. package/dist/web/assets/{copy-Bxxjq6zo.js → copy-B5IKRMFo.js} +1 -1
  113. package/dist/web/assets/download-BrtK5sVk.js +1 -0
  114. package/dist/web/assets/{ellipsis-c2POIN-Y.js → ellipsis-BDmYLoyn.js} +1 -1
  115. package/dist/web/assets/email-BZ3kGs-R.js +1 -0
  116. package/dist/web/assets/flag-DOzXVys0.js +1 -0
  117. package/dist/web/assets/folder-input-M2p_UJZX.js +1 -0
  118. package/dist/web/assets/{library-3WG9oLCb.js → folder-tree-B-DoLXMB.js} +1 -1
  119. package/dist/web/assets/frame-DZh5g5b3.js +1 -0
  120. package/dist/web/assets/globe-DDTr53UY.js +1 -0
  121. package/dist/web/assets/grades-ogaD0MDO.js +1 -0
  122. package/dist/web/assets/groups-CrYV_AFp.js +1 -0
  123. package/dist/web/assets/{hooks-BBARn-DA.js → hooks-EFhyJ5yU.js} +1 -1
  124. package/dist/web/assets/hourglass-BKca6Cje.js +1 -0
  125. package/dist/web/assets/inbox-x1U4YU-c.js +1 -0
  126. package/dist/web/assets/index-BdPmMS6n.css +2 -0
  127. package/dist/web/assets/index-CEZdqKdi.js +50 -0
  128. package/dist/web/assets/{key-round-B_KI-brR.js → key-round-fzvV-etw.js} +1 -1
  129. package/dist/web/assets/library-Bcm33ouq.js +1 -0
  130. package/dist/web/assets/lightbulb-CjSpJ1_v.js +1 -0
  131. package/dist/web/assets/{lock-BjbqwA_0.js → lock-C2edVDOc.js} +1 -1
  132. package/dist/web/assets/mail-CQ9yiBph.js +1 -0
  133. package/dist/web/assets/mail-x-B6oBqlcw.js +1 -0
  134. package/dist/web/assets/{markdown-ykrkPMbn.js → markdown-HNlXovsL.js} +3 -3
  135. package/dist/web/assets/message-square-text-wvO9_guT.js +1 -0
  136. package/dist/web/assets/{misc-DvgDEI3I.js → misc-CyGhN6HT.js} +1 -1
  137. package/dist/web/assets/{pencil-p0GQmIMo.js → pencil-DFUpj3YP.js} +1 -1
  138. package/dist/web/assets/{pin-DlYC3uec.js → pin-DNUQ6-WX.js} +1 -1
  139. package/dist/web/assets/revoke-dialog-DjBKaFTV.js +1 -0
  140. package/dist/web/assets/rotate-ccw-yBj9Ri49.js +1 -0
  141. package/dist/web/assets/scroll-text-RmPlZi3F.js +1 -0
  142. package/dist/web/assets/{send-mxSHcdcD.js → send-BnVkFV8w.js} +1 -1
  143. package/dist/web/assets/{settings-DRKWzSHN.js → settings-BxdCrDf8.js} +1 -1
  144. package/dist/web/assets/shield-x-RpNHS0o8.js +1 -0
  145. package/dist/web/assets/shuffle-C1aB_4dp.js +1 -0
  146. package/dist/web/assets/target-G9Q_WQLB.js +1 -0
  147. package/dist/web/assets/trophy-BFFngFEh.js +1 -0
  148. package/dist/web/assets/user-minus-CkOPT3ak.js +1 -0
  149. package/dist/web/assets/users-round-CNhv0Whm.js +1 -0
  150. package/dist/web/index.html +4 -4
  151. package/package.json +6 -1
  152. package/dist/web/assets/ActivityPage-DPmSV_mU.js +0 -1
  153. package/dist/web/assets/AdminCoursesPage-uaSHNtzf.js +0 -1
  154. package/dist/web/assets/AdminLayout-DqoShZGn.js +0 -1
  155. package/dist/web/assets/AdminUsersPage-3d2F9AEl.js +0 -1
  156. package/dist/web/assets/CalendarPage-CLRWyTNT.js +0 -1
  157. package/dist/web/assets/CourseContentPage-BIDH0UbG.js +0 -1
  158. package/dist/web/assets/CourseLayout-ql01LEmj.js +0 -1
  159. package/dist/web/assets/CourseSettingsPage-CReoPqOa.js +0 -1
  160. package/dist/web/assets/CreateCoursePage-DFCHlq5M.js +0 -1
  161. package/dist/web/assets/GradesPage-Bu5vphcG.js +0 -1
  162. package/dist/web/assets/NotificationsPage-LJvqb6Dj.js +0 -1
  163. package/dist/web/assets/ParticipantsPage-wFxiphna.js +0 -1
  164. package/dist/web/assets/ProfilePage-CzfhacAX.js +0 -1
  165. package/dist/web/assets/QuizAttemptPage-CEAV6wAL.js +0 -1
  166. package/dist/web/assets/QuizEditorPage-DS_czQVM.js +0 -3
  167. package/dist/web/assets/SubmissionsPage-CQjcx09G.js +0 -1
  168. package/dist/web/assets/chevron-left-D6IMQD6N.js +0 -1
  169. package/dist/web/assets/frame-CGabirLa.js +0 -1
  170. package/dist/web/assets/index-B29bTBiJ.js +0 -50
  171. package/dist/web/assets/index-WxCvsbJq.css +0 -2
  172. package/dist/web/assets/message-square-text-fe24gbEU.js +0 -1
  173. package/dist/web/assets/trophy-Cch2iF1m.js +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,81 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.0
4
+
5
+ Email notifications, groups and cohorts, course completion with certificates and badges, question banks with three new question types, and grade categories with weights.
6
+
7
+ **Before upgrading, back up your database.** Migrations `002` to `006` run on start. They only add tables, except `005_question_bank`, which moves quiz questions into the new question bank and can't be undone.
8
+
9
+ ### Email notifications and digests
10
+
11
+ - Every in-app notification can also be emailed, either straight away or in a daily or weekly digest. People choose on their profile page and can switch off categories (announcements, discussions, grades, courses, badges and certificates). The site default is an admin setting. Email stays off until a transport is configured.
12
+ - SMTP through nodemailer, an optional peer dependency (`npm install nodemailer`), configured with `COURSEKIT_SMTP_URL` and `COURSEKIT_MAIL_FROM`. A `log` transport (`COURSEKIT_MAIL_TRANSPORT=log`) saves emails as files for local testing. `createCoursekit({ email: { transport: { send } } })` takes custom transports for Resend, SES and other providers.
13
+ - Emails are queued in a database outbox and sent in the background, with retries and backoff, so a slow mail server never holds up a request. Several servers sharing one database never send the same email twice.
14
+ - Digests go out at a configurable hour, weekday and time zone, and are skipped when there is nothing new. For cron setups there are `coursekit send-digests [--force]`, `lms.email.sendDigests()`, `lms.email.processOutbox()` and `COURSEKIT_MAIL_WORKER=false`.
15
+ - Unsubscribing works without signing in. Links are signed, and a confirmation page at `/unsubscribe` can stop one category or all email. Messages carry `List-Unsubscribe` and `List-Unsubscribe-Post` headers, so mail apps offer one-click unsubscribe (RFC 8058).
16
+ - Emails are branded HTML in the site's colours, with dark mode and a plain-text part.
17
+ - A new **Administration → Email** page shows delivery status, outbox counts and the last error. It can retry failed emails and send a test email, and it holds the digest settings.
18
+
19
+ ### Groups and cohorts
20
+
21
+ - **Course groups.** Teachers and teaching assistants manage groups on the new **Groups** tab. They can create groups and add or remove members by hand, or auto-create groups by splitting the students at random into N groups or into groups of N, with balanced sizes and a naming scheme. Students see only their own groups.
22
+ - Participants, assignment submissions and the gradebook (including its averages and CSV export) can be filtered by group.
23
+ - **Cohorts.** Site-wide groups of people, managed under **Administration → Cohorts**. Add people one at a time or paste a list of email addresses.
24
+ - Linking a cohort to a course enrols every member, and people who join the cohort later are enrolled automatically. Unlinking a cohort, or removing someone from it, keeps existing enrolments.
25
+
26
+ ### Course completion, certificates and badges
27
+
28
+ - **Course completion.** A teacher turns it on in the course settings and picks the criteria: every activity that tracks completion, or a chosen set, plus an optional minimum course grade. Completion is checked automatically when an activity is finished, a grade changes or the gradebook setup changes.
29
+ - Students see a checklist on the course page, and staff see a report on the new **Completion** tab.
30
+ - Completion is permanent and notifies the student.
31
+ - **Certificates.** Printable A4 certificates with your own text, using placeholders such as `{name}`, `{course}` and `{date}`, and a signature line.
32
+ - Each certificate has a verification code that anyone can check at `/verify` without signing in.
33
+ - Issued certificates keep a snapshot of their text, and teachers can revoke and restore them.
34
+ - **Badges.** Course badges (made by teachers) and site badges (made by administrators), each with one of 20 icons and 10 colours.
35
+ - Awarded by hand, on completing the course, or on completing a set of courses.
36
+ - Earned badges and certificates appear on the profile.
37
+
38
+ ### Question banks and new question types
39
+
40
+ - Each course has a **question bank**: nested categories, search, type filters, preview, duplicate, move and delete. A question can't be deleted while a quiz uses it. The bank is on a new **Question bank** tab for teachers.
41
+ - A quiz is an ordered list of **slots**. Each slot is either a specific question or N random questions from a category, picked again for every attempt with no repeats. Each slot has its own mark.
42
+ - **New question types:**
43
+ - **essay**: optional word limits and notes for graders, marked by hand;
44
+ - **matching**: partial credit for each correct match, with optional distractors;
45
+ - **ordering**: drag and drop or keyboard buttons, partial credit for each pair of neighbours in the right order.
46
+ - Attempts keep a copy of their questions, so later edits to the bank never change an attempt that has started or its review.
47
+ - **Essay marking.** Attempts with essays finish as `needs_grading`, with a pending score. Teachers and teaching assistants mark each essay on the attempt's review page. The grade is recorded once the last essay has a mark.
48
+
49
+ ### Grade categories and weights
50
+
51
+ - Group graded activities into categories under **Grades → Categories & weights**. Each category has a weight and a "drop the lowest N" rule.
52
+ - Each course uses either natural (points) totals, the default and unchanged from 0.1.x, or weighted categories. With weighted categories, an activity's weight sets its share of its category. Categories with no grades yet are left out and the other weights are scaled up.
53
+ - The gradebook groups its columns by category and shows category subtotals and averages. Dropped grades are struck through. The CSV export adds a subtotal column per category.
54
+ - Students see their grades grouped by category, with subtotals and weights.
55
+
56
+ ### Changes to check if you integrate with Coursekit
57
+
58
+ - Quiz questions now live in the bank. `GET` and `PUT /api/activities/:id/questions` still work; a `PUT` keeps questions removed from the quiz in the bank instead of deleting them.
59
+ - A quiz attempt can now have the status `needs_grading`, with a `null` score. The new `quiz.attempt.submitted` event fires on hand-in, and `quiz.attempt.finished` fires once the score is final.
60
+ - Course totals and averages now have two decimals (84.17% rather than 84.2%). The totals themselves are unchanged for courses without categories.
61
+ - New capabilities:
62
+ - `course:manageGroups`, `completion:viewReport` and `badges:award`, for teachers and teaching assistants;
63
+ - `completion:manage`, `badges:manage`, `questionbank:manage` and `grades:manage`, for teachers.
64
+ - New events:
65
+ - email: `email.sent` and `email.failed`;
66
+ - groups: `group.created`, `group.updated`, `group.deleted`, `group.member.added` and `group.member.removed`;
67
+ - cohorts: `cohort.created`, `cohort.updated`, `cohort.deleted`, `cohort.member.added`, `cohort.member.removed`, `cohort.linked` and `cohort.unlinked`;
68
+ - completion and badges: `course.completed`, `certificate.issued`, `certificate.revoked`, `badge.awarded` and `badge.revoked`;
69
+ - quizzes and grades: `quiz.attempt.submitted` and `gradebook.setup.updated`.
70
+ - New REST endpoints are listed in [docs/api.md](docs/api.md).
71
+
72
+ ### Other changes
73
+
74
+ - The demo content now includes groups, a cohort, a question bank, essay attempts waiting to be marked, weighted grade categories, completion with certificates, badges, and two people on email digests.
75
+ - "Enrol people" skips someone who was enrolled at the same moment by another request, instead of failing.
76
+ - Fixed: on phones, the student course page and the course settings page no longer scroll sideways.
77
+ - Fixed: the quiz editor's save bar no longer covers the last buttons on wide screens.
78
+
3
79
  ## 0.1.2
4
80
 
5
81
  - **`seedDemo()` without a password no longer locks you out.** On a site with no administrator, `lms.seedDemo()` creates `admin@coursekit.test` with a random password; it now returns that password instead of `null`. The CLI was not affected: `coursekit seed --demo` uses `coursekit` unless you pass `--password`.
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [![CI](https://github.com/Donsimeone2206/coursekit/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/Donsimeone2206/coursekit/actions/workflows/ci.yml)
4
4
 
5
- **An open-source learning management system for Node.js.** Courses, lessons, assignments, auto-graded quizzes, forums and a gradebook, with a fast, modern interface. Think Moodle, rebuilt for today's web.
5
+ **An open-source learning management system for Node.js.** Courses, lessons, assignments, quizzes with question banks, forums, a weighted gradebook, groups, certificates, badges and email notifications, with a fast, modern interface. Think Moodle, rebuilt for today's web.
6
6
 
7
7
  ```bash
8
8
  npx coursekit-lms start
@@ -23,24 +23,35 @@ Open http://localhost:3000 and the setup wizard walks you through creating your
23
23
  - Courses organised into sections (weeks, topics or modules), with drafts, publishing and archiving
24
24
  - Five activity types: **lessons** (Markdown with video embeds), **resources** (files or links), **assignments**, **quizzes** and **forums**
25
25
  - Completion tracking (manual or automatic) with progress per section and per course
26
+ - **Groups** inside a course, made by hand or auto-created with even sizes; filter participants, submissions and the gradebook by group
26
27
  - Course catalog with categories, search, open enrolment, enrolment keys or invite-only courses
27
28
  - Edit mode for teachers: add, reorder, move, hide and delete activities without leaving the course page
28
29
 
29
30
  **Assessment**
30
31
 
31
32
  - Assignments with online text and file submissions, due dates, late flags and a side-by-side grading workspace
32
- - Quizzes with single and multiple choice, true/false, short answer (with wildcards) and numerical questions
33
+ - Quizzes built from a per-course **question bank** with nested categories, using fixed questions or random ones from a category
34
+ - Eight question types: single and multiple choice, true/false, short answer (with wildcards), numerical, **essay** (marked by hand), **matching** and **ordering**
33
35
  - Time limits, attempt limits, highest/last/average grading, pass marks, shuffling and configurable review
34
36
  - Gradebook with inline editing, feedback, class averages and CSV export; students see their own grades
37
+ - **Grade categories and weights**, with drop-lowest rules and category subtotals
35
38
 
36
39
  **Community**
37
40
 
38
41
  - Threaded forums with pinning, locking and moderation
39
42
  - Course announcements, in-app notifications and a calendar with due dates and events
43
+ - **Email notifications**, sent straight away or as daily or weekly digests, with per-person preferences and one-click unsubscribe
44
+
45
+ **Recognition**
46
+
47
+ - **Course completion** with criteria (all activities, a chosen set, a minimum course grade), a checklist for students and a report for teachers
48
+ - Printable **certificates** with a verification code anyone can check at `/verify`
49
+ - Course and site **badges**, awarded by hand or automatically on completion
40
50
 
41
51
  **Administration**
42
52
 
43
53
  - People management with site roles, suspension and **"Log in as"** for support
54
+ - **Cohorts**: site-wide groups of people (a year group, a department) that you link to courses to enrol everyone in them
44
55
  - Categories, branding (site name, tagline, brand colour) and self-registration control
45
56
  - Moodle-style capabilities per course role (teacher, teaching assistant, student)
46
57
 
@@ -80,7 +91,7 @@ npm start
80
91
  npx coursekit-lms seed --demo
81
92
  ```
82
93
 
83
- This adds six courses, two teachers, a teaching assistant and twelve students with submissions, quiz attempts, grades and forum threads. Every demo account uses the password `coursekit`. It is meant for local evaluation only, so don't load it on a public site.
94
+ This adds six courses, two teachers, a teaching assistant and twelve students with submissions, quiz attempts, grades and forum threads. It also adds groups, a cohort, a question bank, weighted grade categories, completion with certificates, and badges. Alex's profile (`alex.johnson@coursekit.test`) shows earned badges and a certificate. Every demo account uses the password `coursekit`. It is meant for local evaluation only, so don't load it on a public site.
84
95
 
85
96
  | Account | Role |
86
97
  | ----------------------------- | ------------------ |
@@ -93,14 +104,18 @@ This adds six courses, two teachers, a teaching assistant and twelve students wi
93
104
 
94
105
  Set these as environment variables or in a `.env` file next to where you run Coursekit.
95
106
 
96
- | Variable | Default | Description |
97
- | ------------------------- | ------------------------------ | ----------------------------------------------------------------- |
98
- | `PORT` | `3000` | Port to listen on |
99
- | `HOST` | `0.0.0.0` | Interface to bind |
100
- | `DATABASE_URL` | `sqlite://./data/coursekit.db` | `sqlite://path/to/file.db` or `postgres://user:pass@host:5432/db` |
101
- | `COURSEKIT_DATA_DIR` | `./data` | Uploaded files (and the default SQLite database) |
102
- | `COURSEKIT_PUBLIC_URL` | (none) | Public URL; an `https://` URL turns on secure cookies |
103
- | `COURSEKIT_MAX_UPLOAD_MB` | `50` | Maximum upload size |
107
+ | Variable | Default | Description |
108
+ | -------------------------- | -------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
109
+ | `PORT` | `3000` | Port to listen on |
110
+ | `HOST` | `0.0.0.0` | Interface to bind |
111
+ | `DATABASE_URL` | `sqlite://./data/coursekit.db` | `sqlite://path/to/file.db` or `postgres://user:pass@host:5432/db` |
112
+ | `COURSEKIT_DATA_DIR` | `./data` | Uploaded files (and the default SQLite database) |
113
+ | `COURSEKIT_PUBLIC_URL` | (none) | Public URL; an `https://` URL turns on secure cookies |
114
+ | `COURSEKIT_MAX_UPLOAD_MB` | `50` | Maximum upload size |
115
+ | `COURSEKIT_SMTP_URL` | (none) | `smtp://` or `smtps://` URL with credentials; turns on email (see [Email](#email-notifications-and-digests)) |
116
+ | `COURSEKIT_MAIL_FROM` | `"<site name>" <no-reply@<public URL host>>` | Sender address |
117
+ | `COURSEKIT_MAIL_TRANSPORT` | `smtp` with a URL, else `none` | `smtp`, `log` (saves emails to `<data dir>/emails`) or `none` |
118
+ | `COURSEKIT_MAIL_WORKER` | `true` | `false` stops this process sending email in the background |
104
119
 
105
120
  The same options are available as CLI flags: `coursekit start --port 8080 --database-url postgres://...`.
106
121
 
@@ -120,6 +135,45 @@ Migrations run automatically on start (or explicitly with `coursekit migrate`).
120
135
  - Put Coursekit behind a reverse proxy with HTTPS and set `COURSEKIT_PUBLIC_URL=https://...` so session cookies are marked `Secure`
121
136
  - Back up the data folder (SQLite database and uploads), or your PostgreSQL database plus the uploads folder
122
137
  - Keep self-registration off if your site is private (Administration → Site settings)
138
+ - Back up before upgrading. Migrations run on start, and 0.2.0's question bank migration can't be undone
139
+
140
+ ## Email notifications and digests
141
+
142
+ Coursekit can email people their notifications, straight away or in a daily or weekly digest. Email is **off until you configure it**. Until then people see notifications only in the app.
143
+
144
+ ```bash
145
+ npm install nodemailer
146
+ COURSEKIT_SMTP_URL=smtps://user:password@smtp.example.com:465
147
+ COURSEKIT_MAIL_FROM="Acme Academy <learn@acme.example>"
148
+ COURSEKIT_PUBLIC_URL=https://learn.acme.example # needed for links and unsubscribe links
149
+ ```
150
+
151
+ - **SMTP URL.** Percent-encode special characters in the password (`p@ss` becomes `p%40ss`). Query parameters become nodemailer options, for example `?pool=true`.
152
+ - **Local testing.** Set `COURSEKIT_MAIL_TRANSPORT=log` to try email without a mail server. Each email is saved to `<data dir>/emails/` as an `.eml` and an `.html` file.
153
+ - **Outbox.** Requests only queue emails in an outbox table, and the server sends them in the background. Failures are retried with growing delays, up to 8 tries over about 11 hours. Several servers can share one database without sending anything twice.
154
+ - **Preferences.** People choose on their profile page: immediately, daily digest, weekly digest or off. They can also switch off categories such as discussions or grades. Anyone who hasn't chosen gets the site default.
155
+ - **Digests.** The digest hour, weekday and time zone are set under **Administration → Email**. That page also shows delivery status and can send a test email.
156
+ - **Unsubscribe.** Every email has an unsubscribe link that works without signing in, plus `List-Unsubscribe` headers for mail apps' one-click unsubscribe.
157
+
158
+ To use another provider, pass a transport in code. Throw to have the message retried, or throw an error with `permanent: true` to give up.
159
+
160
+ ```ts
161
+ const lms = await createCoursekit({
162
+ publicUrl: 'https://learn.acme.example',
163
+ email: {
164
+ from: 'Acme Academy <learn@acme.example>',
165
+ transport: {
166
+ name: 'My provider',
167
+ async send(message) {
168
+ // { id, from, to, subject, html, text, headers }; id stays the same across retries
169
+ await myProvider.send(message);
170
+ },
171
+ },
172
+ },
173
+ });
174
+ ```
175
+
176
+ To send from cron instead of the web server, set `COURSEKIT_MAIL_WORKER=false` and run `coursekit send-digests` every hour with the same settings. It sends the digests that are due, then everything queued. `lms.email.sendDigests()` and `lms.email.processOutbox()` do the same in code.
123
177
 
124
178
  ## Use it as a library
125
179
 
@@ -157,7 +211,7 @@ const response = await lms.fetch(new Request('http://localhost/api/health'));
157
211
 
158
212
  Coursekit expects to own the root path of its (sub)domain, e.g. `learn.example.com`.
159
213
 
160
- **Events:** `user.created`, `user.login`, `course.created`, `course.updated`, `course.deleted`, `enrolment.created`, `enrolment.deleted`, `activity.created`, `activity.completed`, `submission.submitted`, `grade.updated`, `quiz.attempt.finished`, `forum.post.created`, `announcement.created`.
214
+ **Events:** `user.created`, `user.login`, `course.created`, `course.updated`, `course.deleted`, `enrolment.created`, `enrolment.deleted`, `activity.created`, `activity.completed`, `submission.submitted`, `grade.updated`, `gradebook.setup.updated`, `quiz.attempt.submitted`, `quiz.attempt.finished`, `forum.post.created`, `announcement.created`, `course.completed`, `certificate.issued`, `certificate.revoked`, `badge.awarded`, `badge.revoked`, `group.created`, `group.updated`, `group.deleted`, `group.member.added`, `group.member.removed`, `cohort.created`, `cohort.updated`, `cohort.deleted`, `cohort.member.added`, `cohort.member.removed`, `cohort.linked`, `cohort.unlinked`, `email.sent`, `email.failed`.
161
215
 
162
216
  **File storage:** uploads go to `<dataDir>/uploads` by default. Pass `storage` with your own `put`/`get`/`delete` implementation to use S3, R2 or similar.
163
217
 
@@ -173,18 +227,63 @@ Site roles decide what someone can do across the site; course roles decide what
173
227
  | Instructor | Create courses (and becomes their teacher) |
174
228
  | Student | Enrol in courses |
175
229
 
176
- | Capability | Teacher | Teaching assistant | Student |
177
- | ----------------------------------- | :-----: | :----------------: | :-----: |
178
- | View course, post in forums | ✓ | ✓ | ✓ |
179
- | See hidden activities | ✓ | ✓ | |
180
- | Edit content and settings | ✓ | | |
181
- | Manage participants | ✓ | | |
182
- | View and edit all grades | ✓ | ✓ | |
183
- | Moderate forums, post announcements | ✓ | ✓ | |
184
- | Submit assignments | | | ✓ |
230
+ | Capability | Teacher | Teaching assistant | Student |
231
+ | ------------------------------------------------------- | :-----: | :----------------: | :-----: |
232
+ | View course, post in forums | ✓ | ✓ | ✓ |
233
+ | See hidden activities | ✓ | ✓ | |
234
+ | Edit content and settings | ✓ | | |
235
+ | Manage participants | ✓ | | |
236
+ | View and edit all grades | ✓ | ✓ | |
237
+ | Moderate forums, post announcements | ✓ | ✓ | |
238
+ | Manage groups | ✓ | ✓ | |
239
+ | See the completion report, award badges | ✓ | ✓ | |
240
+ | Set completion criteria and certificates, create badges | ✓ | | |
241
+ | Manage the question bank | ✓ | | |
242
+ | Set up grade categories and weights | ✓ | | |
243
+ | Submit assignments | | | ✓ |
185
244
 
186
245
  Capabilities live in [`src/shared/permissions.ts`](src/shared/permissions.ts). The server enforces them and the UI reads the same table.
187
246
 
247
+ ## Groups and cohorts
248
+
249
+ **Groups** belong to one course. Teachers and teaching assistants manage them on the course's **Groups** tab. They can add enrolled people by hand (someone can be in several groups) or **auto-create** groups. Auto-create shuffles the students into N groups, or into groups of at most N, with even sizes. In the group names, `#` becomes a number and `@` a letter, so `Group @` makes Group A, Group B and so on. Participants, assignment submissions and the gradebook can be filtered by group. Students see only their own groups.
250
+
251
+ **Cohorts** are site-wide and managed under **Administration → Cohorts**. Add people one at a time or paste a list of email addresses. Link a cohort to a course with a course role, from the course's Participants page or the cohort's page, and everyone in it is enrolled, including people who join the cohort later. Unlinking a cohort, removing someone from it or deleting it never removes an enrolment.
252
+
253
+ ## Question banks and question types
254
+
255
+ Every course has a **question bank**, on the course's **Question bank** tab. Teachers write each question once, file it in a category (categories can be nested) and reuse it in any quiz in the course.
256
+
257
+ - A quiz is a list of **slots**. Each slot holds either a specific question or **random questions** from a category. Random questions are picked again for every attempt and never repeat within one.
258
+ - Each attempt keeps a copy of its questions, so editing the bank never changes an attempt that has already started.
259
+ - **Essay** questions have optional word limits and notes for graders. Attempts with essays wait for a teacher or teaching assistant to mark them on the attempt's review page. The grade is recorded once the last essay has a mark.
260
+ - **Matching** gives an equal share of the marks for each correct match, with optional distractors.
261
+ - **Ordering** gives an equal share for each pair of neighbours in the right order. Students drag the items, or move them with keyboard-friendly buttons.
262
+
263
+ When you upgrade from 0.1.x, each quiz's questions move into its course's bank, in a category named after the quiz.
264
+
265
+ ## Grade categories and weights
266
+
267
+ In a course, go to **Grades → Categories & weights** to group graded activities into categories and choose how the course total is calculated:
268
+
269
+ - **Natural (points)**, the default and how 0.1.x worked: the points earned out of the points possible. Categories add subtotals.
270
+ - **Weighted categories**: each category is worth a share of the total, however many points it has. An activity's weight sets its share of its category.
271
+
272
+ Only graded work counts. **Drop the lowest N** leaves out each student's N lowest grades in a category. Categories without grades yet are left out and the other weights are scaled up, so weights don't have to add up to 100%. Activities without a category count in _Uncategorised_. The gradebook and the CSV export show category subtotals, and students see their grades grouped by category.
273
+
274
+ ## Course completion, certificates and badges
275
+
276
+ **Completion.** In a course's **Settings**, turn on course completion and choose the criteria: every activity that tracks completion, or a chosen set, plus an optional minimum course grade. Coursekit checks automatically when a student finishes an activity or gets a grade. Students see a checklist on the course page, and staff see a report on the **Completion** tab. Completion is permanent: changing the criteria later never takes it away.
277
+
278
+ **Certificates.** Turn on certificates to give students a printable A4 certificate in your brand colour when they complete the course. Write its text with `{name}`, `{course}`, `{date}`, `{code}` and `{site}` placeholders.
279
+
280
+ - Each certificate has a verification code that anyone can check at `/verify` without signing in.
281
+ - Issued certificates keep their text, even if you edit it later.
282
+ - Teachers can revoke a certificate and restore it.
283
+ - To get a PDF, choose **Download PDF**, then _Save as PDF_ in the print dialog.
284
+
285
+ **Badges.** Teachers create course badges on a course's **Badges** tab, and administrators create site badges under **Administration → Badges**. A badge is awarded by hand, on completing the course, or (for site badges) on completing a set of courses. Earned badges and certificates appear on the profile.
286
+
188
287
  ## Development
189
288
 
190
289
  ```bash
@@ -218,8 +317,9 @@ src/
218
317
  shared/ Types, permissions and constants used by server and UI
219
318
  server/
220
319
  db/ Kysely setup, node:sqlite adapter, migrations
221
- routes/ REST API (auth, admin, courses, content, activities, quizzes, forums, grades, files, me)
222
- services/ Access control, progress, grading, quiz engine, notifications
320
+ routes/ REST API (auth, admin, courses, content, activities, quizzes, question bank, forums,
321
+ grades, groups, cohorts, completion, certificates, badges, email, files, me)
322
+ services/ Access control, progress, gradebook, quiz engine, completion, notifications, email outbox
223
323
  seed/ Demo content
224
324
  index.ts createCoursekit() programmatic API
225
325
  cli/ The `coursekit` command
@@ -237,6 +337,7 @@ test/ API integration tests
237
337
  - Uploaded files are only served to people allowed to see them, with `nosniff`, and anything that could execute in a browser (HTML, SVG…) is served as a download
238
338
  - Markdown is sanitised with DOMPurify before rendering; links in resources must be `http(s)`
239
339
  - Credential endpoints are rate limited
340
+ - Unsubscribe links are HMAC-signed, and the public certificate check shows only the name, course, date and whether the certificate is valid
240
341
 
241
342
  Please report vulnerabilities privately to the maintainers rather than opening a public issue.
242
343
 
@@ -244,10 +345,10 @@ Please report vulnerabilities privately to the maintainers rather than opening a
244
345
 
245
346
  Coursekit covers the core of an LMS today. Things on the list:
246
347
 
247
- - Email notifications and digests
248
- - Groups/cohorts, course completion certificates and badges
249
- - Question banks, more question types (essay, matching, ordering) and grade categories/weights
250
348
  - LTI 1.3 and SCORM/xAPI packages
349
+ - Group modes (activities and forums restricted to a group)
350
+ - Question import and export (GIFT, Moodle XML) and sharing questions between courses
351
+ - Open Badges export
251
352
  - Internationalisation
252
353
  - Pluggable activity types in the web UI (the server-side registry is in `src/server/services/activity-types.ts`)
253
354
  - S3-compatible storage adapter, Docker image