Policy Precedence Resolver
Run the Policy Precedence Resolver MicroSim Fullscreen
Edit in the p5.js Editor
About This MicroSim
An instrumented MicroSim's xAPI policy has two main keys: compact (fold exposure evidence into
one summary per session, or send the Full stream) and teaching (show the statement log panel,
or stay silent). Five places can set them. The runtime consults them in a fixed order, lowest
priority first:
- the runtime's built-in defaults (
compact: true,teaching: false) - the book's
lrs-config.jsxapiblock - the
policyoption a page passes toLRSSim.create - the MicroSim's own
metadata.jsonxapiblock - the
?xapi=URL switch, for one visit only
Resolution is per key: the highest layer that sets a key wins that key, and a layer that sets
only teaching leaves compact to the layers below. The URL tokens are teaching,
production, full and compact, and they combine; a lone ?xapi=teaching also starts the
panel on Full, exactly as the runtime's urlPolicy() does.
Set the layers, predict both values and the layer that supplies each, then press Resolve.
A highlight climbs from the bottom bar, overwriting the running value wherever a layer sets a
key. Worked example loads the case from Chapter 17: the book says compact: true, teaching:
false, the MicroSim's metadata.json says compact: false, teaching: true, and the reader
opens the page with ?xapi=production.
Learning objective: The learner will determine the final compact and teaching values
for a MicroSim by applying the five policy layers in order, and will identify which layer
supplied each value.
Bloom's taxonomy level: Apply (verb: determine)
How to Use
- Choose a value for each layer with the Book config, Page option, metadata.json and URL switch dropdowns. The runtime defaults are fixed.
- Write down your prediction for
compactandteaching, and the layer each comes from. - Press Resolve and watch the climb. Check Show which layer won to label each value with its source layer and ring the winning boxes in gold.
- Hover any bar to see which file that layer lives in.
- Reset returns every layer to its starting state (the reference book's
compact: true, teaching: falseand nothing else set).
Iframe Embed Code
You can add this MicroSim to any web page by adding this to your HTML:
1 2 3 4 | |
Lesson Plan
Audience
Teachers, instructional designers, learning-technology developers and learning-analytics practitioners (college undergraduate and professional development).
Duration
10-15 minutes
Prerequisites
- Full and Compact modes (Chapter 16)
- The LRS config file and teaching mode (Chapter 17)
Activities
- Worked example (3 min): Load the worked example, predict, then resolve. Explain why
compactcomes frommetadata.jsonwhileteachingcomes from the URL switch. - Per-key practice (5 min): Set
metadata.jsontoteaching trueonly and the book tocompact false. Predict and resolve. Then add?xapi=teaching,compact. - Design a policy (5 min): A teacher wants every MicroSim silent and compact, except one that teaches xAPI and should open on Full with the panel. Decide which files to change, set the layers, and verify with Resolve.
Assessment
- The learner predicts both resolved values and their source layers correctly for three new layer settings.
- The learner explains why a lone
?xapi=teachingalso setscompactto false. - The learner names the file to edit for a change to one MicroSim, to the whole book, and to a single visit.
References
- Experience API - Wikipedia. The xAPI standard the runtime's statements follow.
- Query string - Wikipedia. The
?xapi=part of the URL that carries the switch. - URLSearchParams - MDN. The browser API the runtime uses to read the switch.
- p5.js createSelect() reference - p5.js. The dropdown control used for each layer.