Owner Nikunj

Block

1. What is a Block?

A Block is the smallest reusable unit of study content in Keystone. It carries one piece of authored material — rich PlateJS — together with its links to the MCQs that reference it.

If a Docket is a chapter, a Block is a paragraph or figure inside that chapter — addressable on its own, reorderable, and reusable.

2. Structure

A block is an independent content record, parented to a docket and scoped to a course:

BLOCK   "Area of Circle — Intro"   (BLK1A2B3C4D)
 └─ Course:  NEET
 └─ Parent docket:  DOC-001
 └─ Type:    PLATEJS
 └─ Content:
     [{ "type": "p", "children": [{ "text": "The area of a circle is the region enclosed…" }] }]
 └─ MCQ links:
     ├─ Primary   →  MCQ9F8E  (PYQ)
     └─ Secondary →  MCQ4D7C  (DQ),  MCQ2A1B  (PYQ)
  • Identityshort_uid (BLK…), MongoDB _id, optional legacy old_uuid
  • Scope — every block has a course_id and an originating docket_id
  • Content — PlateJS payload only; stored as plaintext (content) plus at-rest ciphertext (conte) for learner-facing surfaces
  • MCQ links — denormalised both ways: each block knows the MCQs that point to it; each MCQ knows the blocks it references
  • Ordering — the docket owns block order via its block_ids list, not the block itself

3. Parameters of a Block

  • _id — Unique Id
  • short_uid — auto-generated unique ID like BLK1A2B3C4D; used for cross-references from MCQs, AI runs, reviews, and deep-linking
  • docket_id — originating / current parent docket; nullable when the block is detached
  • course_id — the course this block belongs to (NEET, UPSC, etc.); used for scoping and access control
  • title — optional plaintext title
  • content — PlateJS payload (plaintext JSON); required
  • conte — encrypted content
  • type — always PLATEJS
  • linked_mcq_ids — denormalised list of all MCQ short UIDs that link to this block (any kind of link)
  • pri_mcq_ids — MCQ short UIDs where this block is the primary link (i.e. the block came from the MCQ’s own L4 docket)
  • sec_mcq_ids — MCQ short UIDs where this block is a secondary link (the block came from a different docket)
  • pri_mcq_count — denormalised counts of primary-linked MCQs, split by type: pyq, dq, eq
  • sec_mcq_count — denormalised counts of secondary-linked MCQs, split by type: pyq, dq, eq
  • is_deleted — soft-delete flag
  • created_at / updated_at — epoch-ms timestamps (UTC)
  • created_by / updated_by — user IDs of the author and last editor