All skills
dmccreary avatar

/add-xapi-events-to-microsim

@d493f4f

Use when the user wants an existing MicroSim or chapter quiz to record what students do with it. Typical requests are "add xAPI events", "add tracking or analytics", "make this sim feed the LRS or LRS-Lite", "instrument chapter 5's sims", or "what should this sim record?". Use it even if they never say "xAPI". Not for building a new MicroSim (use microsim-generator) or for LRS backend work.

  • 27 files
  • 234.6 KB
  • Updated 5 days ago
  • GitHub

Use this Skill: https://skilld.dev/gh/dmccreary/claude-skills/add-xapi-events-to-microsim

This session only. Nothing lands on disk.

referencesadaptersquiz-page.md

≈677 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Adapter: chapter quiz pages

Status: VERIFIED. Proven by learning-record-store/docs/js/quiz-xapi.js against the real Material-rendered chapter 1 quiz (10 questions), plus a fixture test.

Applies when: the target is a chapter's quiz.md generated by quiz-generator, with numbered #### N. Question headings, a <div class="upper-alpha"> list of options, and a ??? question "Show Answer" block containing "The correct answer is X" and "Concept Tested: …".

This is a site page, not a sim

  • No iframe and no metadata.json. The runtime loads site-wide from mkdocs.yml:

    extra_javascript:
      - js/lrs-config.js
      - js/lrs-xapi.js
      - js/lrs-lite-sim.js
      - js/lrs-sim.js
      - js/xapi-json-viewer.js
      - js/quiz-xapi.js
    extra_css:
      - css/lrs-xapi.css

    Order matters: config first, quiz-xapi.js last.

  • Don't write a per-quiz script. Copy quiz-xapi.js into the book's docs/js/ unchanged. It no-ops on pages without a quiz, parses the answer key from the rendered page (so quiz.md stays the single source of truth), and emits through lrs.question().

  • The policy comes from lrs-config.js quizzes.teaching. It's true only in books that teach xAPI. Every quiz statement is an answer, and answers pass through in both modes, so there is no Full/Compact switch (modeControls: false).

What it emits

  • One answered per question: …/chapters/<ch>/quiz/#q{N}, one-based and matching the displayed number (the order is fixed); success, response = the letter, and durationMs since load.
  • The first choice is the evidence. Later changes are review; the options lock.
  • A peeked answer is not evidence. Opening "Show Answer" before choosing suppresses the statement, and the page says so.

Open follow-up: quiz concept ids

quiz-xapi.js still derives concept_id as a slug of the "Concept Tested" label, not a namespaced learning-graph id. Only about 65% of labels match a ConceptLabel exactly. Until that is fixed, quiz concept ids won't join to Concept vertices. If the user asks for quiz instrumentation in a new book, say so and offer one of two fixes: a label → ConceptID table, or a quiz-generator change that writes the ConceptID. Don't silently ship the slug as if it were a real id.

Verifying

check-xapi.py works on sims, not on rendered site pages. Build the site (mkdocs build -d <scratch>/site), open a quiz page from the build, and read LRSLite.statements after answering. Alternatively, reuse the fixture approach in learning-record-store/tests/test_microsim_compact_xapi.py (test_quiz_answers_pass_through_with_a_log_but_no_mode_switch).

Source: SKILL.md on GitHub

No third-party reports yet.

Signed by skilld at d493f4f. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 19 hours ago.

Activeupdated 5 days ago
metadata
{
  "ibook.version": "0.2",
  "ibook.preferred-model": "opus"
}

README badge

README badge for dmccreary/claude-skills/add-xapi-events-to-microsim