Reported issues
{Object.values(s.issues ?? {}).length ? Object.values(s.issues).map((i) =>
{i.subject} · {fmtDate(i.createdAt)}
) :
No reports.
}
Profile
diff --git a/packages/features/src/domain.check.ts b/packages/features/src/domain.check.ts
index 0abe376..d751212 100644
--- a/packages/features/src/domain.check.ts
+++ b/packages/features/src/domain.check.ts
@@ -1,7 +1,7 @@
// Runnable check for the money/access rules: `pnpm test`. Test IDs from SPEC §13.2.
import assert from 'node:assert/strict';
import type { Course, Student } from '@lms/data';
-import { applyHeartbeat, applyPaymentEvent, createOrder, dashboardMetrics, effectiveStatus, isStudentVisible, lessonAccess, publishProblems, validateLocation, validPassword } from './domain.ts';
+import { applyHeartbeat, DomainError, gradeAssessment, applyPaymentEvent, createOrder, dashboardMetrics, effectiveStatus, isStudentVisible, lessonAccess, publishProblems, validateLocation, validPassword } from './domain.ts';
const lesson = (id: string, extra = {}) => ({ id, sortOrder: Number(id.slice(-1)), isPreview: false, isPublished: true, durationSec: 100, videoStatus: 'READY' as const, translations: { en: { title: id } }, ...extra });
const course = (id: string, extra: Partial
= {}): Course => ({
@@ -79,4 +79,13 @@ assert.ok(validPassword('abcdefgh')); assert.ok(!validPassword('short'));
assert.equal(validateLocation('ET', 'Nairobi'), 'CITY_NOT_IN_LIST');
assert.equal(validateLocation('KE', 'Nairobi'), null);
+// assessments: grading, best score kept, a pass is never lost, incomplete attempts rejected
+const quiz = { id: 'q', passPct: 70, translations: { en: { title: 'Q' } }, questions: [0, 1, 2].map((answer, i) => ({ id: 'q' + i, answer, translations: { en: { prompt: 'p', options: ['a', 'b', 'c'] } } })) };
+const g1 = gradeAssessment(A, quiz, [0, 1, 2], undefined, now);
+assert.deepEqual([g1.score, g1.total, g1.bestPct, g1.passed, g1.attempts], [3, 3, 100, true, 1]);
+const g2 = gradeAssessment(A, quiz, [0, 0, 0], g1, now);
+assert.deepEqual([g2.score, g2.bestPct, g2.passed, g2.attempts], [1, 100, true, 2]);
+assert.equal(gradeAssessment(A, quiz, [1, 1, 1], undefined, now).passed, false);
+assert.throws(() => gradeAssessment(A, quiz, [0, 1], undefined, now), DomainError);
+
console.log('domain checks: all passed');
diff --git a/packages/features/src/domain.ts b/packages/features/src/domain.ts
index 382f840..3d0b67e 100644
--- a/packages/features/src/domain.ts
+++ b/packages/features/src/domain.ts
@@ -1,5 +1,5 @@
// Pure business rules shared by demo and production screens. No React, no I/O.
-import type { Course, Currency, Lesson, LessonProgress, Locale, Order, OrderStatus, Student, Tr, AdminRole } from '@lms/data';
+import type { Assessment, AssessmentResult, Course, Currency, Lesson, LessonProgress, Locale, Order, OrderStatus, Student, Tr, AdminRole } from '@lms/data';
export const ORDER_TTL_MS = 30 * 60 * 1000;
export const COMPLETE_AT = 0.9;
@@ -92,6 +92,15 @@ export function applyHeartbeat(prev: LessonProgress | undefined, courseId: strin
export class DomainError extends Error { code: string; constructor(code: string) { super(code); this.code = code; } }
+/** Score an attempt and fold it into the previous result: best score and a pass are kept, attempts are counted. */
+export function gradeAssessment(c: Course, a: Assessment, answers: number[], prev: AssessmentResult | undefined, now: Date): AssessmentResult {
+ const total = a.questions.length;
+ if (answers.length !== total || answers.some((x) => !Number.isInteger(x) || x < 0)) throw new DomainError('INCOMPLETE');
+ const score = a.questions.filter((q, i) => answers[i] === q.answer).length;
+ const pct = total ? Math.round((score / total) * 100) : 0;
+ return { courseId: c.id, score, total, bestPct: Math.max(pct, prev?.bestPct ?? 0), passed: !!prev?.passed || pct >= a.passPct, attempts: (prev?.attempts ?? 0) + 1, answers, submittedAt: now.toISOString() };
+}
+
export function effectiveStatus(o: Order, now = Date.now()): OrderStatus {
return o.status === 'PENDING' && Date.parse(o.expiresAt) < now ? 'EXPIRED' : o.status;
}
diff --git a/packages/features/src/payLogos.ts b/packages/features/src/payLogos.ts
new file mode 100644
index 0000000..345e317
--- /dev/null
+++ b/packages/features/src/payLogos.ts
@@ -0,0 +1,11 @@
+// Generated from design/payment-logos/*.svg (svgo-minified). Telebirr and CBE Birr come from ethiopianlogos.com
+// (github.com/Chapa-Et/ethiopianlogos), Visa/Mastercard/PayPal from github.com/gilbarbara/logos, Zelle from Simple Icons.
+// Inlined as data URIs so the single-file artifact build needs no extra requests.
+export const PAY_LOGOS: Record = {
+ TELEBIRR: 'data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%22682.667%22 height=%22682.667%22%3E%3Cpath d=%22M510.68 657.133c-73.803-10.748-127.896-64.936-138.854-139.098-2.308-15.626-1.985-42.115.692-56.75.738-4.033 4.673-26.233 8.744-49.333s11.297-64.076 16.059-91.058 9.559-50.8 10.66-52.93 4.207-5.555 6.9-7.61l4.898-3.735h289.093l3.891 4.355c7.26 8.126 4.293 20.558-6.672 27.947-4.488 3.025-4.617 3.031-56.635 3.035-56.63.004-68.121.858-91.154 6.77-54.666 14.034-106.667 56.885-132.293 109.016-31.605 64.292-23.696 132.948 20.305 176.26C488.5 625.526 554.8 634.31 611.46 605.876c51.72-25.953 86.529-85.107 78.002-132.554-6.795-37.814-38.98-63.916-78.93-64.014-39.098-.096-78.008 31.406-86.624 70.133-7.097 31.899 10.08 57.144 41.205 60.561 7.876.865 9.978 1.633 12.504 4.569 3.52 4.091 3.806 7.357 1.104 12.582-3.564 6.891-7.862 8.566-19.954 7.775-24.843-1.625-44.43-14.548-55.31-36.494-14.71-29.663-4.237-73.557 25.048-104.983 14.444-15.5 40.513-31.09 60.814-36.37 12.631-3.283 40.385-3.232 52.664.098 40.7 11.039 67.39 40.883 73.416 82.098 4.171 28.531-5.985 69.309-24.77 99.447-27.92 44.797-76.263 78.131-127.369 87.826-11.828 2.244-39.096 2.546-52.58.582M307.74 474c-2.336-1.016-5.26-3.807-6.5-6.203-1.97-3.812-2.065-5.7-.751-15.1 9.842-70.436-25.966-131.726-89.2-152.678-12.573-4.166-24.206-6.37-39.302-7.445-7.333-.522-14.855-1.725-16.714-2.672-4.938-2.517-7.098-7.45-6.313-14.415.863-7.654 5.33-13.862 12.228-16.995 5.165-2.346 10.705-2.483 100.799-2.506 92.169-.024 95.475.062 99.594 2.573 8.775 5.351 9.026 2.524-9.485 107.056-9.187 51.881-17.563 95.981-18.613 98-2.614 5.025-7.287 9.007-12.695 10.818-5.74 1.923-7.788 1.855-13.048-.433m117.317-256.978c-2.962-1.431-7.07-8.475-7.07-12.123 0-5.868 33.755-191.228 35.404-194.418 3.14-6.073 10.851-10.53 18.218-10.53 5.123 0 7.17.747 10.69 3.9 4.312 3.862 4.348 3.998 3.716 13.667-.35 5.372-.623 19.367-.605 31.1.028 17.906.52 23.154 3.064 32.667 6.831 25.54 16.898 43.503 34.1 60.844 18.719 18.87 37.964 29.837 64.144 36.553 10.591 2.718 16.215 3.15 49.936 3.833 41.722.845 42.194.94 46.092 9.153 2.513 5.295 1.636 10.927-2.762 17.742-6.292 9.75 1.409 9.219-132.199 9.118-81.598-.062-120.732-.542-122.728-1.506%22 style=%22fill:%230172bb;stroke-width:1.33333%22 transform=%22translate(-87.77 13.021)%22/%3E%3C/svg%3E',
+ CBE_BIRR: 'data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%22512%22 height=%22356%22 viewBox=%220 0 135.47 94.192%22%3E%3Cpath fill-rule=%22evenodd%22 d=%22M.009.006h135.385v93.81H.01z%22/%3E%3Cg fill=%22%23882b7a%22%3E%3Cpath d=%22M.008 46.906V.001h135.385v93.81H.008zm36.55 24.064c1.184-.092 2.197-.21 2.25-.237.052-.04.565-.158 1.144-.276 4.697-.96 8.486-2.881 11.513-5.855 2.342-2.316 3.802-4.868 4.394-7.697.684-3.368-.632-6.868-3.17-8.38-.396-.238-.711-.461-.711-.514 0-.04.342-.302.763-.579 2.21-1.46 4.118-3.25 4.868-4.552.579-1.053 1.026-2.408 1.21-3.737.145-1.026.145-1.329-.04-2.21-.96-4.67-5.683-7.578-13.182-8.118-2.553-.184-7.447.105-10.329.605-.184.027-.894.145-1.579.25-2.065.33-6 1.263-6.196 1.474-.053.053-.277.816-.514 1.684-.223.868-.973 3.684-1.657 6.25a915 915 0 0 0-1.5 5.591c-.132.513-.356 1.369-.5 1.908-.592 2.21-1.763 6.592-2.092 7.828-.184.724-.54 2.027-.776 2.895s-1.027 3.855-1.764 6.644-1.368 5.171-1.394 5.29c-.092.315.223.42 2.473.815 2.671.474 4.671.697 7.54.868 1.38.08 2.683.172 2.894.185.973.105 4.394.026 6.355-.132m31.853-1.473c.144-.487.579-2.092.987-3.58.723-2.736 1.842-6.84 2.591-9.604.224-.829.606-2.223.843-3.092s.578-2.144.763-2.828.67-2.487 1.092-4.013c.408-1.513.842-3.105.96-3.526.197-.724.197-.79-.053-1.25-.407-.763-.855-.895-3-.921-1.026-.013-2.92-.066-4.196-.106l-2.342-.092v-.302c0-.171.065-.58.158-.908.092-.316.118-.618.078-.658-.131-.132-1.039-.105-1.184.04-.158.157-.592 1.67-3.591 12.854-.737 2.71-2.435 9.065-2.908 10.854-.316 1.198-.921 3.46-1.342 5.026-.434 1.58-.75 2.882-.737 2.908.013.013 2.645.04 5.829.053l5.789.026zm15.42.302c.394-1.566 1.21-4.578 1.434-5.328.237-.803.46-1.671 1.92-7.303.33-1.223.79-2.947 1.027-3.815.25-.868.632-2.29.855-3.158.698-2.618.58-2.408 1.671-2.907.54-.237 1.342-.54 1.79-.658 1-.263 3.026-.58 3.17-.487.053.026.671.079 1.382.105 1.381.066 2.579.237 3.684.553.395.105.723.17.737.144.079-.092 1.355-4.789 1.657-6.091.08-.342-.065-.448-.815-.566-3.803-.645-9.065-.434-14.091.579-2.224.447-5.08 1.263-6 1.723s-.54-.67-3.302 9.842c-.79 3.04-1.54 5.855-1.645 6.25-.829 3-3.053 11.525-3.026 11.578.026.04 2.144.065 4.723.065H83.7zm24.09.263c.053-.144.58-2.065 1.158-4.276 1.145-4.328 2.079-7.815 3.684-13.815.303-1.118.658-2.486.803-3.026s.355-1.079.486-1.197c.237-.224 1.737-.829 3.119-1.25.657-.21 1.197-.25 3.092-.237 2.223.013 2.92.106 5.197.658.236.066.302-.066.578-1.158.171-.67.527-2.052.803-3.065s.513-1.934.54-2.04c.065-.263-1.066-.473-3.5-.657-4.342-.303-9.526.263-14.526 1.592-1.368.355-3.342 1.078-3.605 1.315-.065.04-.29.737-.486 1.513-.211.79-.71 2.684-1.119 4.197-.408 1.527-1.052 3.974-1.447 5.46-.382 1.487-.921 3.5-1.184 4.474s-.71 2.67-.987 3.75c-.671 2.592-1.487 5.683-1.829 6.894-.145.54-.25 1.013-.223 1.052s2.144.08 4.697.08c4.473-.014 4.644-.014 4.75-.264m-70.68-45.05c.62-.17 1.198-.38 1.29-.473.092-.079.277-.566.408-1.066s.29-1.026.355-1.157c.08-.211.053-.237-.158-.158-2.21.907-4.118 1.302-5.026 1.026-.605-.184-1.17-.697-1.42-1.303-.303-.71-.237-2.342.131-3.236.592-1.421 1.618-2.619 2.684-3.132 1.197-.579 2.434-.46 4.408.435.487.223.908.381.92.355.066-.08.62-2.171.62-2.329s-1.33-.605-2.461-.829c-3.474-.658-7.079 1.158-8.592 4.29-.881 1.841-1.184 3.539-.855 4.815.408 1.592 1.21 2.486 2.645 2.92 1 .316 3.63.224 5.052-.157m9.382.25c1.552-.223 3.263-1.144 4.092-2.197.473-.592 1-1.815 1-2.341 0-.553-.421-1.421-.869-1.764l-.381-.302.329-.263c1.381-1.092 1.842-1.921 1.644-2.96-.21-1.158-1.092-1.83-2.96-2.224-.908-.197-2.803-.197-3.75-.013-.145.04-.658.131-1.145.223s-.96.224-1.065.316c-.106.08-.5 1.303-.882 2.71s-.829 3.066-.987 3.684c-.46 1.671-1.25 4.698-1.25 4.763 0 .053.79.21 2.237.421.71.092 3.132.066 3.987-.052m15.367-1.118c.132-.5.25-.96.25-1.013 0-.066-1.447-.105-3.223-.105-2.987 0-3.224-.013-3.224-.224 0-.25.619-2.539.698-2.631.039-.026 1.368-.053 2.96-.066l2.894-.026.224-.79c.118-.447.25-.907.276-1.026.066-.223-.131-.237-2.828-.237-2.342 0-2.908-.04-2.908-.17 0-.238.5-2.172.592-2.33.053-.078 1.408-.131 3.276-.131h3.21l.21-.829c.106-.46.238-.934.29-1.066.08-.197-.276-.21-4.63-.184l-4.698.04-.566 1.973c-.618 2.197-2.552 9.552-2.552 9.71 0 .053 2.144.079 4.75.066l4.75-.04z%22/%3E%3Cpath d=%22M31.519 63.602c-1.237-.158-2.171-.355-2.171-.447 0-.066.21-.869.46-1.803.25-.92.882-3.315 1.421-5.302l.974-3.618 4.131-.04c4.881-.039 6.355.08 7.605.645.473.224 1 .526 1.184.684.447.421.802 1.25.802 1.934 0 .75-.447 2.605-.776 3.263-.763 1.487-2.276 2.803-4.144 3.618-1.96.843-3.013 1.027-6.263 1.08-1.553.026-3 .013-3.223-.014M58.622 68.55c-.118-.198.053-.895.29-1.12.263-.262 1.723-.275 1.828-.012.04.105 0 .42-.079.723l-.144.54h-.908c-.5 0-.948-.066-.987-.132M62.056 68.576c-.026-.053 0-.356.079-.658.105-.421.21-.58.46-.632.33-.092 1.58-.013 1.684.105.04.027-.013.316-.105.645l-.17.579-.935.04c-.513.026-.974-.014-1.013-.08M65.569 68.155c.105-.79.263-.921 1.131-.921 1.04 0 1.145.092.921.802l-.184.579-1.947.079zM59.385 65.72c-.026-.092 0-.407.079-.697.118-.434.21-.54.553-.605.579-.105 1.197-.092 1.42.04.172.105.119.763-.118 1.184-.131.236-1.842.315-1.934.078M63.49 65.8c-.645-.08-.658-.093-.605-.474.092-.816.21-.895 1.42-.895.803 0 .856.079.593.79-.25.697-.303.71-1.408.578M67.108 65.786c-.473-.04-.855-.118-.855-.197.013-.421.25-1 .434-1.105.277-.132 1.592-.08 1.75.079.145.144-.092 1.026-.316 1.17-.079.066-.54.093-1.013.053M60.188 62.47c.131-.828.25-.907 1.25-.868.986.04 1.078.158.75.948l-.198.473h-1.894zM63.608 62.852c-.026-.092.014-.408.106-.697l.17-.513h.922c1.04 0 1.144.105.802.908l-.197.473h-.868c-.592 0-.882-.052-.935-.17M67.042 62.892c-.105-.171.185-1.08.382-1.21.224-.159 1.592-.12 1.75.039.092.092.092.29-.026.684l-.158.553-.934.039c-.553.026-.96-.013-1.014-.105M61.109 59.997c-.21-.21.092-1.21.408-1.316.342-.118 1.513-.052 1.67.106s-.092 1.026-.328 1.17c-.264.159-1.592.198-1.75.04M64.516 59.905c-.04-.105-.013-.42.08-.697.144-.487.17-.5.841-.553 1.316-.092 1.513.092 1.066 1.013-.197.421-.21.434-1.053.434-.631 0-.881-.052-.934-.197M67.95 59.931c-.118-.29.053-.828.342-1.118.263-.263.935-.342 1.553-.184.329.092.395.579.118 1.092-.144.276-.263.316-1.052.355-.698.04-.908 0-.96-.145M65.608 55.813c-.04-.066 0-.381.092-.697l.171-.579.843-.013c1.092-.026 1.21.066 1 .776l-.158.553-.935.04c-.513.026-.973-.014-1.013-.08M43.912 23.184c-.092-.132.514-2.697.724-3.092.118-.224.276-.25 1.75-.21 1.42.052 1.67.092 2 .328.776.606.237 2.106-.974 2.698-.513.25-.894.315-2.026.355-.816.04-1.434 0-1.474-.08M45.268 17.855c0-.473.579-2.42.763-2.552.29-.237 2.157-.224 2.723.013.553.237.71.526.619 1.171-.08.671-.737 1.342-1.421 1.447-.96.158-2.684.106-2.684-.079%22/%3E%3C/g%3E%3Cg fill=%22%23942e7b%22%3E%3Cpath d=%22M32.577 63.602c0-.066-.329-.092-.724-.079-.394.027-.723 0-.723-.066 0-.052-.33-.105-.724-.105-1.17 0-1.263.724.895-7.302l.973-3.618 4.132-.04c4.88-.039 6.354.08 7.604.645 1.027.474 1.421.803 1.737 1.5.316.684.316 1.447-.013 2.802-.303 1.264-.566 1.83-1.303 2.75-1.026 1.303-3.394 2.79-4.157 2.592-.237-.066-.33-.026-.33.119 0 .144-.341.29-1.21.5-.973.236-1.723.302-3.684.355-1.368.026-2.473 0-2.473-.053M36.034 45.696c-1.802-.04-2.407-.093-2.407-.211.013-.079.184-.776.394-1.54.21-.762.724-2.657 1.119-4.21.75-2.894.868-3.157 1.473-3.157.158 0 .553-.092.882-.198.316-.105.987-.223 1.473-.263.5-.04 1.263-.092 1.71-.144 1.08-.106 3.54.25 4.474.644 1.908.816 2.697 2.105 2.408 3.934-.54 3.355-2.96 4.987-7.618 5.131-.829.027-2.592.027-3.908.014M44.168 23.17c-.158-.105-.158-.289.04-1.289.131-.631.315-1.355.42-1.605l.185-.434 1.631.04c1.421.052 1.685.092 2.013.328.448.33.5.527.303 1.21-.184.711-.79 1.356-1.17 1.25-.211-.052-.264-.026-.211.12.065.144-.08.236-.514.354-.697.171-2.434.185-2.697.027M45.34 17.855c0-.473.578-2.42.762-2.552.29-.237 2.158-.224 2.724.013.237.105.5.303.566.434.25.46-.198 1.868-.527 1.671-.17-.105-.855.197-.947.421-.105.263-2.579.276-2.579.013%22/%3E%3C/g%3E%3Cg fill=%22%23e0aa49%22%3E%3Cpath d=%22M93.228 79.162c-.21-.026-.368-.079-.368-.092 0-.184.71-2.17.92-2.592.21-.592.26-.813-.122-.816-.158.053-.14.027-.14-.75v-.934l.486.04c.474.04.487.066.5.526 0 .579.08.671.592.658.434-.013.5.158.198.553q-.494.65.236.592c.54-.053.698.052.79.5.04.21.17.776.276 1.263.119.5.184.947.158 1-.053.065-.421.079-.882.026-.052-.013-.131-.21-.17-.46-.053-.25-.172-.75-.29-1.119-.329-1.131-.868-.829-1.25.724-.158.644-.242 1-.4.974a7 7 0 0 0-.534-.093M74.815 39.73c-.119-.236-1.132-1.815-2.263-3.525-2.816-4.237-2.592-3.71-2.04-4.79.645-1.21 1.816-2.302 3.276-3 .83-.394 1.908-.736 4.171-1.302 4.382-1.079 5.842-1.75 7.21-3.276.356-.408.816-1.053 1-1.434.395-.803.421-.79 1.132.342.237.368.697 1.079 1.026 1.566 1.395 2.065 3.131 4.723 3.21 4.934.106.263-.329 1.131-1 2.039-.96 1.29-2.578 2.237-4.907 2.868-.658.184-1.408.382-1.658.46-.25.066-.987.25-1.645.395-.644.158-1.302.33-1.447.382-.145.066-.592.21-.987.342-1.789.579-3.605 2.092-4.394 3.658-.197.407-.395.75-.421.75s-.145-.185-.263-.408%22/%3E%3C/g%3E%3Cg fill=%22%23e3a756%22 stroke-width=%22.497%22%3E%3Cpath d=%22M79.186 79.13c-.846-.419-1.104-.68-1.143-3.193l-.027-2.04h.54c.329 0 .579.066.605.172.026.078.04 1.013.026 2.065-.026 2.145.08 2.5.71 2.5.803 0 .961-.5.935-2.895l-.027-1.776h1.027l.04.895.039.881h1.828v.5c0 .434-.052.513-.394.645-.408.158-.527.079-.698-.382-.052-.144-.223-.236-.42-.236-.316 0-.33.039-.33.763 0 1.078-.29 1.592-1.184 2.026-.626.31-.972.218-1.527.075zM103.369 79.077c-.527-.355-.29-.973.368-.973.631 0 .868.552.42.96-.302.276-.42.276-.788.013M56.21 79.077c-.016-.095-.074-.997-.087-2.089-.026-2.079-.118-2.46-.658-2.605-.157-.04-.407.04-.605.184-.302.25-.329.342-.355 1.803l-.04 1.539h-1.052v-1.381c0-2.171.329-2.605 1.934-2.645.947-.026 1.276.119 1.631.724.21.342.25.697.25 2.355.014 1.21-.023 2.065-.115 2.118-.28.029-.653-.009-.902-.003zM58.493 79.104c-.043-.303-.134-.744.01-1.507.198-.974.684-1.79 1.303-2.184.579-.368.592-.368.316-1.026-.119-.263-.172-.54-.132-.592.053-.105.974-.092 1.04.013.012.026.157.474.315 1l.303.947h.92c.803 0 .908.026.908.25 0 .145.04.342.08.46q.078.198-.316.395c-.421.21-.553.158-.724-.342a.41.41 0 0 0-.368-.237c-.25 0-.264.053-.198.435.04.236.224.868.395 1.38.171.527.276.975.224 1-.04.027-.302.026-.565 0l-.43.003-.479-1.581c-.25-.829-.513-1.5-.592-1.5-.17 0-.487.342-.71.763-.08.171-.224.763-.303 1.303-.145.947-.103.898-.33 1.033-.197.014-.558-.008-.667-.013zM65.108 79.05l-.408-.039.04-1.96c.039-2.118.13-2.486.736-2.934.263-.197.553-.263 1.118-.263 1.658.026 1.921.395 1.987 2.908.066 2.223.026 2.38-.526 2.328-.237-.026-.46-.04-.5-.052-.04-.014-.066-.948-.08-2.08l-.035-2.18-.743-.214c-.796.114-.015-.042-.524.053-.315.303-.329.368-.329 2.342 0 2.197.014 2.17-.736 2.092zM72.201 79.077l-.434-.052v-2.75h-.33c-.289 0-.407.118-.802.763-.013.026-.657-.224-.815-.316-.027-.013 0-.237.04-.5l.091-.473h1.816v-1.316h-.684c-.842 0-.948-.079-.987-.605-.026-.33.04-.434.303-.553.473-.223.552-.197.776.237.197.368.25.395.973.395h.777l-.027.763c-.026.408-.013.829.027.92q.06.159.947.159h.895l.052.46c.053.408 0 .487-.342.658-.5.25-.46.263-.618-.197-.119-.316-.224-.395-.513-.395-.474 0-.553.224-.448 1.342.08.908 0 1.565-.184 1.526-.053 0-.29-.04-.513-.066zM87.883 78.866c-.092-.158-.33-.855-.527-1.553-.21-.723-.434-1.29-.526-1.29-.408 0-.96 1.224-1.04 2.356-.052.605-.052.605-.552.605h-.513l.04-.592c.079-1.263.394-1.987 1.157-2.723l.724-.684-.197-.606a7 7 0 0 1-.21-.657c0-.066 1.052.013 1.091.079.026.026.171.486.342 1.013l.303.947h.894c.882 0 .895 0 1.04.408.079.237.144.434.144.46 0 .04-.802.448-.868.448-.026 0-.131-.172-.25-.395-.197-.395-.723-.566-.723-.224 0 .158.539 1.934.71 2.342.079.171 0 .237-.382.276-.381.04-.526 0-.657-.21zM98.106 79.05c-.21-.13-.276-.854-.132-1.328.408-1.355.54-1.592 1.185-2.158l.67-.578-.223-.632a8 8 0 0 1-.21-.67c0-.067 1.065.052 1.105.117.013.027.092.25.17.5.316 1.053 1.342 4.29 1.421 4.487.066.17-.013.236-.394.276-.263.026-.527-.013-.58-.079-.065-.079-.315-.79-.565-1.566-.237-.789-.5-1.434-.566-1.447-.184-.013-.697.776-.855 1.342-.066.263-.131.75-.131 1.105 0 .342-.04.619-.092.632-.066 0-.237.026-.395.04-.158.012-.342 0-.408-.04zM103.29 76.643c-.04-.447-.08-1.25-.08-1.776v-.973h1.053v.763c0 .434-.04 1.223-.08 1.776-.091.986-.091 1.013-.447 1.013-.342 0-.355-.04-.447-.803M73.738 37.194c-.316-.618-.276-.92.132-.92.145 0 .263-.093.263-.198 0-.276.684-.855 1.013-.855s.408.316.145.487c-.092.052-.33.079-.527.052-.289-.026-.368.027-.368.224 0 .145.079.29.158.316.118.04.105.21-.092.644-.355.842-.408.869-.724.25M75.765 35.13c.131-.157.197-.355.145-.42-.04-.08.013-.145.118-.145.303 0 .25.17-.145.54-.302.262-.329.262-.118.026M77.49 33.649c-.079-.145.434-.342.566-.21.052.039 0 .131-.106.197-.25.158-.355.158-.46.013M78.345 33.358c0-.382.618-.618 1.815-.684.158 0 .29-.066.29-.132 0-.052.118-.079.263-.04.144.04.263.014.263-.052s.092-.118.197-.118c.421 0 .171.236-.42.394-.356.08-.75.198-.895.25-.869.33-1.513.487-1.513.382M81.501 32.352c0-.144.908-.355 1.026-.236.119.131-.052.223-.552.302-.29.04-.474.027-.474-.066M82.686 32.167c0-.237.75-.513.842-.302.04.092.066.092.066-.013.013-.198.408-.237.408-.04 0 .066-.158.158-.355.21-.21.04-.5.119-.658.185-.224.092-.303.079-.303-.04M84.134 31.665c0-.066.079-.132.184-.132s.237.066.276.132c.04.079-.04.131-.184.131-.158 0-.276-.052-.276-.131M85.449 31.268c0-.066.092-.132.197-.132s.197.066.197.132c0 .079-.092.131-.197.131s-.197-.052-.197-.131M86.068 31.056c-.119-.118-.119-.303.013-.29a.82.82 0 0 0 .723-.21c.29-.29.882-.395.882-.158 0 .105-.29.316-.671.474-.737.302-.816.316-.947.184M89.171 28.807c-.25-.04-.276-.092-.17-.29.118-.236.578-.236.723 0 .105.172-.237.343-.553.29%22/%3E%3C/g%3E%3C/svg%3E',
+ VISA: 'data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%22256%22 height=%2283%22 preserveAspectRatio=%22xMidYMid%22%3E%3Cdefs%3E%3ClinearGradient id=%22a%22 x1=%2245.974%25%22 x2=%2254.877%25%22 y1=%22-2.006%25%22 y2=%22100%25%22%3E%3Cstop offset=%220%25%22 stop-color=%22%23222357%22/%3E%3Cstop offset=%22100%25%22 stop-color=%22%23254AA5%22/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath fill=%22url(%23a)%22 d=%22M132.397 56.24c-.146-11.516 10.263-17.942 18.104-21.763 8.056-3.92 10.762-6.434 10.73-9.94-.06-5.365-6.426-7.733-12.383-7.825-10.393-.161-16.436 2.806-21.24 5.05l-3.744-17.519c4.82-2.221 13.745-4.158 23-4.243 21.725 0 35.938 10.724 36.015 27.351.085 21.102-29.188 22.27-28.988 31.702.069 2.86 2.798 5.912 8.778 6.688 2.96.392 11.131.692 20.395-3.574l3.636 16.95c-4.982 1.814-11.385 3.551-19.357 3.551-20.448 0-34.83-10.87-34.946-26.428m89.241 24.968c-3.967 0-7.31-2.314-8.802-5.865L181.803 1.245h21.709l4.32 11.939h26.528l2.506-11.939H256l-16.697 79.963zm3.037-21.601 6.265-30.027h-17.158zm-118.599 21.6L88.964 1.246h20.687l17.104 79.963zm-30.603 0L53.941 26.782l-8.71 46.277c-1.022 5.166-5.058 8.149-9.54 8.149H.493L0 78.886c7.226-1.568 15.436-4.097 20.41-6.803 3.044-1.653 3.912-3.098 4.912-7.026L41.819 1.245H63.68l33.516 79.963z%22 transform=%22matrix(1 0 0 -1 0 82.668)%22/%3E%3C/svg%3E',
+ MASTERCARD: 'data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%22256%22 height=%22199%22 preserveAspectRatio=%22xMidYMid%22%3E%3Cpath d=%22M46.54 198.011V184.84c0-5.05-3.074-8.342-8.343-8.342-2.634 0-5.488.878-7.464 3.732-1.536-2.415-3.731-3.732-7.024-3.732-2.196 0-4.39.658-6.147 3.073v-2.634h-4.61v21.074h4.61v-11.635c0-3.731 1.976-5.488 5.05-5.488 3.072 0 4.61 1.976 4.61 5.488v11.635h4.61v-11.635c0-3.731 2.194-5.488 5.048-5.488 3.074 0 4.61 1.976 4.61 5.488v11.635zm68.271-21.074h-7.463v-6.366h-4.61v6.366h-4.171v4.17h4.17v9.66c0 4.83 1.976 7.683 7.245 7.683 1.976 0 4.17-.658 5.708-1.536l-1.318-3.952c-1.317.878-2.853 1.098-3.951 1.098-2.195 0-3.073-1.317-3.073-3.513v-9.44h7.463zm39.076-.44c-2.634 0-4.39 1.318-5.488 3.074v-2.634h-4.61v21.074h4.61v-11.854c0-3.512 1.536-5.488 4.39-5.488.878 0 1.976.22 2.854.439l1.317-4.39c-.878-.22-2.195-.22-3.073-.22m-59.052 2.196c-2.196-1.537-5.269-2.195-8.562-2.195-5.268 0-8.78 2.634-8.78 6.805 0 3.513 2.634 5.488 7.244 6.147l2.195.22c2.415.438 3.732 1.097 3.732 2.195 0 1.536-1.756 2.634-4.83 2.634s-5.488-1.098-7.025-2.195l-2.195 3.512c2.415 1.756 5.708 2.634 9 2.634 6.147 0 9.66-2.853 9.66-6.805 0-3.732-2.854-5.708-7.245-6.366l-2.195-.22c-1.976-.22-3.512-.658-3.512-1.975 0-1.537 1.536-2.415 3.951-2.415 2.635 0 5.269 1.097 6.586 1.756zm122.495-2.195c-2.635 0-4.391 1.317-5.489 3.073v-2.634h-4.61v21.074h4.61v-11.854c0-3.512 1.537-5.488 4.39-5.488.879 0 1.977.22 2.855.439l1.317-4.39c-.878-.22-2.195-.22-3.073-.22m-58.833 10.976c0 6.366 4.39 10.976 11.196 10.976 3.073 0 5.268-.658 7.463-2.414l-2.195-3.732c-1.756 1.317-3.512 1.975-5.488 1.975-3.732 0-6.366-2.634-6.366-6.805 0-3.951 2.634-6.586 6.366-6.805 1.976 0 3.732.658 5.488 1.976l2.195-3.732c-2.195-1.757-4.39-2.415-7.463-2.415-6.806 0-11.196 4.61-11.196 10.976m42.588 0v-10.537h-4.61v2.634c-1.537-1.975-3.732-3.073-6.586-3.073-5.927 0-10.537 4.61-10.537 10.976s4.61 10.976 10.537 10.976c3.073 0 5.269-1.097 6.586-3.073v2.634h4.61zm-16.904 0c0-3.732 2.415-6.805 6.366-6.805 3.732 0 6.367 2.854 6.367 6.805 0 3.732-2.635 6.805-6.367 6.805-3.951-.22-6.366-3.073-6.366-6.805m-55.1-10.976c-6.147 0-10.538 4.39-10.538 10.976s4.39 10.976 10.757 10.976c3.073 0 6.147-.878 8.562-2.853l-2.196-3.293c-1.756 1.317-3.951 2.195-6.146 2.195-2.854 0-5.708-1.317-6.367-5.05h15.587v-1.755c.22-6.806-3.732-11.196-9.66-11.196m0 3.951c2.853 0 4.83 1.757 5.268 5.05h-10.976c.439-2.854 2.415-5.05 5.708-5.05m114.372 7.025v-18.879h-4.61v10.976c-1.537-1.975-3.732-3.073-6.586-3.073-5.927 0-10.537 4.61-10.537 10.976s4.61 10.976 10.537 10.976c3.074 0 5.269-1.097 6.586-3.073v2.634h4.61zm-16.903 0c0-3.732 2.414-6.805 6.366-6.805 3.732 0 6.366 2.854 6.366 6.805 0 3.732-2.634 6.805-6.366 6.805-3.952-.22-6.366-3.073-6.366-6.805m-154.107 0v-10.537h-4.61v2.634c-1.537-1.975-3.732-3.073-6.586-3.073-5.927 0-10.537 4.61-10.537 10.976s4.61 10.976 10.537 10.976c3.074 0 5.269-1.097 6.586-3.073v2.634h4.61zm-17.123 0c0-3.732 2.415-6.805 6.366-6.805 3.732 0 6.367 2.854 6.367 6.805 0 3.732-2.635 6.805-6.367 6.805-3.951-.22-6.366-3.073-6.366-6.805%22/%3E%3Cpath fill=%22%23FF5F00%22 d=%22M93.298 16.903h69.15v124.251h-69.15z%22/%3E%3Cpath fill=%22%23EB001B%22 d=%22M97.689 79.029c0-25.245 11.854-47.637 30.074-62.126C114.373 6.366 97.47 0 79.03 0 35.343 0 0 35.343 0 79.029s35.343 79.029 79.029 79.029c18.44 0 35.343-6.366 48.734-16.904-18.22-14.269-30.074-36.88-30.074-62.125%22/%3E%3Cpath fill=%22%23F79E1B%22 d=%22M255.746 79.029c0 43.685-35.343 79.029-79.029 79.029-18.44 0-35.343-6.366-48.734-16.904 18.44-14.488 30.075-36.88 30.075-62.125s-11.855-47.637-30.075-62.126C141.373 6.366 158.277 0 176.717 0c43.686 0 79.03 35.563 79.03 79.029%22/%3E%3C/svg%3E',
+ PAYPAL: 'data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%22256%22 height=%22302%22 preserveAspectRatio=%22xMidYMid%22%3E%3Cpath fill=%22%2327346A%22 d=%22M217.168 23.507C203.234 7.625 178.046.816 145.823.816h-93.52A13.39 13.39 0 0 0 39.076 12.11L.136 259.077c-.774 4.87 2.997 9.28 7.933 9.28h57.736l14.5-91.971-.45 2.88c1.033-6.501 6.593-11.296 13.177-11.296h27.436c53.898 0 96.101-21.892 108.429-85.221.366-1.873.683-3.696.957-5.477q-2.334-1.236 0 0c3.671-23.407-.025-39.34-12.686-53.765%22/%3E%3Cpath fill=%22%2327346A%22 d=%22M102.397 68.84a11.7 11.7 0 0 1 5.053-1.14h73.318c8.682 0 16.78.565 24.18 1.756a102 102 0 0 1 6.177 1.182 90 90 0 0 1 8.59 2.347c3.638 1.215 7.026 2.63 10.14 4.287 3.67-23.416-.026-39.34-12.687-53.765C203.226 7.625 178.046.816 145.823.816H52.295C45.71.816 40.108 5.61 39.076 12.11L.136 259.068c-.774 4.878 2.997 9.282 7.925 9.282h57.744L95.888 77.58a11.72 11.72 0 0 1 6.509-8.74%22/%3E%3Cpath fill=%22%232790C3%22 d=%22M228.897 82.749c-12.328 63.32-54.53 85.221-108.429 85.221H93.024c-6.584 0-12.145 4.795-13.168 11.296L61.817 293.621c-.674 4.262 2.622 8.124 6.934 8.124h48.67a11.71 11.71 0 0 0 11.563-9.88l.474-2.48 9.173-58.136.591-3.213a11.71 11.71 0 0 1 11.562-9.88h7.284c47.147 0 84.064-19.154 94.852-74.55 4.503-23.15 2.173-42.478-9.739-56.054-3.613-4.112-8.1-7.508-13.327-10.28-.283 1.79-.59 3.604-.957 5.477%22/%3E%3Cpath fill=%22%231F264F%22 d=%22M216.952 72.128a90 90 0 0 0-5.818-1.49 110 110 0 0 0-6.177-1.174c-7.408-1.199-15.5-1.765-24.19-1.765h-73.309a11.6 11.6 0 0 0-5.053 1.149 11.68 11.68 0 0 0-6.51 8.74l-15.582 98.798-.45 2.88c1.025-6.501 6.585-11.296 13.17-11.296h27.444c53.898 0 96.1-21.892 108.428-85.221.367-1.873.675-3.688.958-5.477q-4.682-2.47-10.14-4.279a83 83 0 0 0-2.77-.865%22/%3E%3C/svg%3E',
+ ZELLE: 'data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 fill=%22%236D1ED4%22 viewBox=%220 0 24 24%22%3E%3Cpath d=%22M13.559 24h-2.841a.483.483 0 0 1-.483-.483v-2.765H5.638a.667.667 0 0 1-.666-.666v-2.234a.67.67 0 0 1 .142-.412l8.139-10.382h-7.25a.667.667 0 0 1-.667-.667V3.914c0-.367.299-.666.666-.666h4.23V.483c0-.266.217-.483.483-.483h2.841c.266 0 .483.217.483.483v2.765h4.323c.367 0 .666.299.666.666v2.137a.67.67 0 0 1-.141.41l-8.19 10.481h7.665c.367 0 .666.299.666.666v2.477a.667.667 0 0 1-.666.667h-4.32v2.765a.483.483 0 0 1-.483.483%22/%3E%3C/svg%3E',
+};
diff --git a/packages/features/src/student.tsx b/packages/features/src/student.tsx
index ae1fac2..a9aa06c 100644
--- a/packages/features/src/student.tsx
+++ b/packages/features/src/student.tsx
@@ -1,18 +1,25 @@
'use client';
import { useCallback, useEffect, useMemo, useRef, useState, type ReactNode } from 'react';
import { useTranslations } from 'next-intl';
-import type { Course, Issue, IssueType, Lesson, Locale, Order, Student } from '@lms/data';
+import type { Assessment, AssessmentResult, Course, Issue, IssueType, Lesson, Locale, Order, Student } from '@lms/data';
import { LOCALES, newId } from '@lms/data';
import { LOCALE_NAMES, DRAFT_LOCALES } from '@lms/i18n';
import { lookup, useApp } from './store';
import {
applyHeartbeat, applyPaymentEvent, clock, COUNTRIES, courseDuration, courseProgress, createOrder, DomainError, effectiveStatus,
- ET_CITIES, formatDuration, formatMoney, isCompleted, isStudentVisible, lessonAccess, owns, publishedLessons, resumePoint, tr, validateLocation, validPassword,
+ ET_CITIES, formatDuration, formatMoney, gradeAssessment, isCompleted, isStudentVisible, lessonAccess, owns, publishedLessons, resumePoint, tr, validateLocation, validPassword,
} from './domain';
-import { CopyText, Cover, Empty, FeedbackButton, fmtDate, Icon, Logo, Modal, Ring, Skeleton, StatusPill } from './ui';
+import { CopyText, Cover, Empty, FeedbackButton, fmtDate, Icon, Logo, MakeupBox, Modal, VIMEO_ORIGIN, VIMEO_PLACEHOLDER, Ring, Skeleton, StatusPill } from './ui';
+import { PAY_LOGOS } from './payLogos';
const ISSUE_TYPES: IssueType[] = ['BUG', 'PAYMENT', 'VIDEO', 'ACCOUNT', 'CONTENT', 'OTHER'];
-const METHODS = [{ id: 'TELEBIRR', name: 'Telebirr' }, { id: 'CBE_BIRR', name: 'CBE Birr' }];
+// Demo checkout lists every method we plan to accept; all of them run through the same simulated ETB order.
+const METHODS = [
+ { id: 'TELEBIRR', name: 'Telebirr', via: 'ArifPay' }, { id: 'CBE_BIRR', name: 'CBE Birr', via: 'ArifPay' },
+ { id: 'VISA', name: 'Visa', via: 'ArifPay' }, { id: 'MASTERCARD', name: 'Mastercard', via: 'ArifPay' },
+ { id: 'PAYPAL', name: 'PayPal', via: 'International' }, { id: 'ZELLE', name: 'Zelle', via: 'International' },
+];
+const PayLogo = ({ id }: { id: string }) =>
;
const methodName = (id: string) => METHODS.find((m) => m.id === id)?.name ?? id;
// ---------------------------------------------------------------- helpers
@@ -137,19 +144,36 @@ function UserMenu() {
function Footer() {
const t = useTranslations();
- const { settings, locale, nav, setLocale, categories, viewer } = useApp();
+ const { settings, locale, nav, setLocale, categories, courses, viewer, signedIn, me } = useApp();
+ const instructors = [...new Set(courses.filter((c) => isStudentVisible(c, me) && !c.isTest).map((c) => c.instructorName))].slice(0, 3);
+ const go = (p: string) => nav(`/${locale}${p}`);
return (
+ {vimeo && {t('player.completed')}
{next &&
}
@@ -660,7 +804,7 @@ function Checkout({ slug }: { slug?: string }) {
{METHODS.map((m) => (
))}
@@ -777,6 +921,7 @@ function MyProgress() {
{ct(c, locale).title}
{[...c.chapters].sort((a, b) => a.sortOrder - b.sortOrder).map((ch) =>
{tr(ch.translations, locale)?.title}
{ch.lessons.filter((l) => l.isPublished).sort((a, b) => a.sortOrder - b.sortOrder).map((l) =>
)}
)}
+ {!!c.assessments?.length &&
{t('assess.title')}
{c.assessments.map((a) =>
)}
}
))}
diff --git a/packages/features/src/styles.css b/packages/features/src/styles.css
index 9ae0444..ac63dd3 100644
--- a/packages/features/src/styles.css
+++ b/packages/features/src/styles.css
@@ -521,9 +521,6 @@ h1:lang(en), h2:lang(en), h3:lang(en), h1:lang(om), h2:lang(om), h3:lang(om), .a
.how-panel { background: var(--canvas); border: 1px solid color-mix(in srgb, var(--brand-3) 40%, transparent); }
.steps li::before { background: var(--accent); color: #fff; }
.pay-logo { background: var(--paper); }
-.pay-logo .pay-ic { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff; background: var(--brand-2); }
-.pay-logo:nth-child(2) .pay-ic { background: var(--accent); }
-.pay-logo:nth-child(3) .pay-ic { background: var(--ink); color: var(--on-ink); }
.cta-band { position: relative; overflow: hidden; background: linear-gradient(120deg, #1D3557, #29495E 60%, #457B9D); color: #fff; }
.cta-band::after { content: ''; position: absolute; right: -60px; bottom: -120px; width: 280px; height: 280px; border-radius: 50%; background: #A8DADC; opacity: .18; pointer-events: none; }
.cta-band > * { position: relative; z-index: 1; }
@@ -533,5 +530,62 @@ h1:lang(en), h2:lang(en), h3:lang(en), h1:lang(om), h2:lang(om), h3:lang(om), .a
.a-me { background: linear-gradient(160deg, #1D3557, #29495E); color: #fff; }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); }
.ccard:hover .ccard-cta { background: var(--accent); border-color: var(--accent); color: #fff; }
-.foot { background: var(--canvas); border-top-color: transparent; }
.a-shell { background: var(--paper); }
+.pay-mark { width: 48px; height: 28px; flex: none; display: grid; place-items: center; }
+.pay-mark img { width: 48px; height: 28px; object-fit: contain; }
+.pay-logo { padding: 8px 14px 8px 10px; }
+.screen iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
+
+/* footer (inspo: Juggle about/footer): wordmark + story left, palette art right, quiet uppercase link columns */
+.foot { background: var(--paper); border-top: 1px solid var(--line); margin-top: 48px; padding: 64px 20px calc(96px + env(safe-area-inset-bottom, 0px)); }
+@media (min-width: 900px) { .foot { padding-bottom: 40px; } }
+.foot-wrap { max-width: 1200px; margin: 0 auto; display: flex; flex-direction: column; gap: 56px; }
+.foot-top { display: grid; gap: 40px; }
+@media (min-width: 860px) { .foot-top { grid-template-columns: minmax(0, 1fr) minmax(260px, 340px); align-items: end; } }
+.foot-story { display: flex; flex-direction: column; min-width: 0; }
+.foot-word { font-family: var(--f-head); font-size: clamp(40px, 6.4vw, 68px); font-weight: 800; letter-spacing: -.035em; line-height: 1; color: var(--ink); }
+.foot-tag { margin-top: 18px; font-weight: 700; color: var(--ink); }
+.foot-desc { margin-top: 6px; font-size: var(--fs-sm); color: var(--ink-2); max-width: 42ch; }
+.foot-people { list-style: none; padding: 0; margin: 40px 0 0; display: flex; flex-wrap: wrap; gap: 16px 48px; }
+.foot-people strong { display: block; color: var(--ink); }
+.foot-people span { font-size: var(--fs-sm); color: var(--ink-3); }
+.foot-box { width: 100%; max-width: 340px; justify-self: end; }
+.foot-box svg { display: block; width: 100%; height: auto; filter: drop-shadow(0 18px 30px rgba(29, 53, 87, .18)); transition: transform .4s ease; }
+.foot-box:hover svg { transform: rotate(-1.5deg) translateY(-4px); }
+@media (max-width: 859px) { .foot-box { max-width: 260px; justify-self: start; } }
+.foot-cols { display: grid; gap: 32px 24px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
+@media (min-width: 760px) { .foot-cols { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
+.foot-cols h3 { font-family: var(--f-latin); font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 12px; }
+.foot-cols button, .foot-cols a, .foot-cols span { display: block; width: fit-content; text-align: left; background: none; border: 0; padding: 5px 0; color: var(--ink); text-decoration: none; cursor: pointer; font-size: var(--fs-base); }
+.foot-cols span { cursor: default; color: var(--ink-2); }
+.foot-cols button:hover, .foot-cols a:hover { color: var(--accent); }
+.foot-cols button[aria-current="true"] { font-weight: 700; }
+.foot-base { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
+.foot-rights { margin-left: auto; letter-spacing: .06em; text-transform: none; }
+
+/* assessments */
+.quiz { display: flex; flex-direction: column; gap: 24px; max-width: 760px; width: 100%; margin: 0 auto; }
+.quiz-head { display: flex; gap: 16px; align-items: flex-start; }
+.quiz-head h1 { font-size: clamp(26px, 3.4vw, 34px); }
+.quiz-ic { width: 48px; height: 48px; flex: none; border-radius: 14px; display: grid; place-items: center; background: var(--brand-2-soft); color: var(--brand-2); }
+.quiz-result { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; padding: 16px 18px; border-radius: var(--r-lg); }
+.quiz-result.ok { background: var(--success-soft); } .quiz-result.ok strong { color: var(--success); }
+.quiz-result.bad { background: var(--warn-soft); }
+.quiz-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 16px; }
+.quiz-q fieldset { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; margin: 0; min-width: 0; background: var(--paper); box-shadow: var(--shadow-soft); }
+.quiz-q legend { float: left; width: 100%; display: flex; gap: 12px; align-items: flex-start; font-weight: 700; font-size: var(--fs-lg); line-height: 1.4; margin-bottom: 14px; padding: 0; }
+.quiz-n { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: var(--fs-sm); }
+.quiz-opts { clear: both; display: flex; flex-direction: column; gap: 8px; }
+.quiz-opt { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r-md); cursor: pointer; transition: border-color .15s, background .15s; }
+.quiz-opt:hover { border-color: var(--brand-2); }
+.quiz-opt:has(input:checked) { border-color: var(--brand-2); background: var(--info-soft); }
+.quiz-opt input { width: 20px; height: 20px; margin: 0; accent-color: var(--brand-2); flex: none; }
+.quiz-opt.right, .quiz-opt.right:has(input:checked) { border-color: var(--success); background: var(--success-soft); }
+.quiz-opt.wrong, .quiz-opt.wrong:has(input:checked) { border-color: var(--alert); background: var(--alert-soft); }
+fieldset[disabled] .quiz-opt { cursor: default; }
+.quiz-explain { margin-top: 12px; padding: 10px 12px; border-left: 3px solid var(--brand-3); background: var(--mist); border-radius: 0 var(--r-sm) var(--r-sm) 0; color: var(--ink-2); }
+.quiz-foot { position: sticky; bottom: calc(64px + env(safe-area-inset-bottom, 0px)); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px; background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-soft); }
+@media (min-width: 900px) { .quiz-foot { bottom: 16px; } }
+.ch .lesson-row .pill { flex: none; }
+.lesson-row .quiz-ok, .lesson-row .quiz-todo { display: block; font-weight: 700; }
+.lesson-row .quiz-ok { color: var(--success); } .lesson-row .quiz-todo { color: var(--alert); }
diff --git a/packages/features/src/ui.tsx b/packages/features/src/ui.tsx
index a703616..766fdd7 100644
--- a/packages/features/src/ui.tsx
+++ b/packages/features/src/ui.tsx
@@ -16,6 +16,7 @@ const PATHS: Record