npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@pie-qti/player-elements

v0.1.4

Published

QTI (2.x and 3.0) player web components (custom elements) for framework-agnostic embedding

Downloads

25

Readme

@pie-qti/player-elements

Framework-agnostic Web Components (Custom Elements) for the QTI 2.x players in this repo.

Elements

  • pie-qti-item-player
  • pie-qti-assessment-player

Install

npm install @pie-qti/player-elements

Register elements

import '@pie-qti/player-elements/register';

pie-qti-item-player

Pass QTI

Prefer setting the XML via property (attributes are awkward for large XML strings):

import '@pie-qti/player-elements/register';

const el = document.querySelector('pie-qti-item-player');
el.itemXml = qtiItemXmlString;
el.identifier = 'item-1';
el.title = 'My Item';
el.role = 'candidate'; // QTI 2.x standard role

Listen for interactions/responses

el.addEventListener('response-change', (e) => {
  // e.detail = { responseId, value, responses }
  console.log(e.detail.responseId, e.detail.value);
});

pie-qti-assessment-player

Standard (B): pass assessmentTest XML + base URL for href item resolution

import '@pie-qti/player-elements/register';

const el = document.querySelector('pie-qti-assessment-player');
el.assessmentTestXml = assessmentTestXmlString; // QTI <assessmentTest>...</assessmentTest>
el.itemBaseUrl = 'https://my-cdn.example.com/qti/'; // used to resolve assessmentItemRef@href

Fallback/convenience (A): pass assessmentTest XML + an in-memory item map

import '@pie-qti/player-elements/register';

const el = document.querySelector('pie-qti-assessment-player');
el.assessmentTestXml = assessmentTestXmlString;

// Map keys can be either the assessmentItemRef@href value OR the assessmentItemRef@identifier
el.items = {
  'items/item-1.xml': item1Xml,
  'ITEM-2': item2Xml
};

(Optional) config

el.config = {
  role: 'candidate', // QTI 2.x standard role
  navigationMode: 'nonlinear', // QTI 2.x navigation mode
  showSections: true
};

Listen for lifecycle + state events

el.addEventListener('item-change', (e) => console.log('item', e.detail));
el.addEventListener('section-change', (e) => console.log('section', e.detail));
el.addEventListener('response-change', (e) => console.log('responses', e.detail.responses));
el.addEventListener('submit', (e) => console.log('results', e.detail.results));
el.addEventListener('complete', () => console.log('complete'));

// Optional loading lifecycle (useful if you rely on base-url fetching)
el.addEventListener('load-start', () => console.log('loading...'));
el.addEventListener('load-end', () => console.log('loaded'));
el.addEventListener('load-error', (e) => console.error(e.detail.message));

Imperative API

await el.next();
await el.previous();
await el.navigateTo(0);
await el.navigateToSection('section-1');
const results = await el.submit();
const state = el.getState();
el.restoreState(state);