Skip to content

Add Apple module content statistics - #377

Merged
lastcow merged 1 commit into
mainfrom
codex/add-apple-module-content-statistics
Aug 5, 2026
Merged

Add Apple module content statistics#377
lastcow merged 1 commit into
mainfrom
codex/add-apple-module-content-statistics

Conversation

@lastcow

@lastcow lastcow commented Aug 5, 2026

Copy link
Copy Markdown
Owner

What changed

  • added per-module counts for materials, presentations, assignments, quizzes, and discussions to the existing Modules API response
  • aggregated all counts in the module-list query instead of issuing additional client requests
  • kept student counts permission-aware so draft content is not disclosed
  • added four aligned Apple module metrics: teaching materials, assignments, quizzes, and discussions
  • added English and Simplified Chinese labels plus model, integration, accessibility, and UI-test coverage

Why

The module roadmap showed sequence and schedule but not the amount of learning content or assessment work inside each module. The new metrics make module workload and content density scannable without opening each module.

Validation

  • iPhone 17 Pro simulator (iOS 26.5): 15/15 tests passed
  • iPad Pro 13-inch M5 simulator (iOS 26.5): 15/15 tests passed
  • API tests: 415 passed, 92 integration tests skipped without a local database
  • TypeScript typecheck, ESLint, and workspace production build passed
  • focused visual UI tests passed on iPhone light mode and iPad split-view dark mode
  • Apple Release simulator build succeeded
  • Release artifact contains no UI-test fixture account or sample course markers
  • English and Simplified Chinese localization plists lint successfully
  • git diff --check passes

No database migration is required; the change only adds aggregate fields to an existing API query.

@lastcow
lastcow merged commit 87e156c into main Aug 5, 2026
4 checks passed
@lastcow
lastcow deleted the codex/add-apple-module-content-statistics branch August 5, 2026 05:57

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b7313d416a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

module: modules,
materialsCount: sql<number>`(
SELECT count(*)::int FROM ${readingMaterials} rm
WHERE rm.module_id = ${modules.id} ${materialVisibility}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Add course scoping to module content counts

When a course item has a moduleId that points at a module in another course (the current PATCH handlers for assignments/presentations/quizzes/discussions accept moduleId directly without rechecking the module's course), these new aggregates key only on module_id, so /courses/:courseId/modules will count that foreign item for this module; for students this can also disclose that a published item exists in a course they cannot access. Please also constrain each count subquery by the item's course_id so stale or cross-course links cannot inflate or leak counts.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants