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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@citolab/tspci-tao

v2.4.8

Published

create a zip file that can be imported into TAO

Downloads

90

Readme

@citolab/tspci-tao

release notes

Features

  • building a package(.zip) to import in TAO
  • configure PCI in TAO
  • set correct response in TAO

This package allows the @citolab/tspci-bundler to create a package which can be imported in the TAO platform.

PCI's can be imported in TAO as a ZIP file. The ZIP generated contains the PCI itself and metadata enabling the PCI to be shown in the TAO creator platform. Configuration of a PCI can be done by the author because this packager reads the config.json file in the src folder

If scoring can be done with a MATCH_CORRECT (single string comparison) the item author can provide the correct answer in TAO by interaction with the PCI. This way one PCI can be re-used in different configurations supporting multiple items.

Cli

To add TAO support to an existing tspci PCI you can run:

 tspci add --target tao

This command and all the TAO specific changes that are needed to build importable TAO zip file. This will work for a new project created by tspci init. For PCI's that are modified, it will do best effort to fully implement TAO specific changes. Please read the rest of this file in case tspci init fails on your PCI.

The cli will ask a few things before the script is executed:

  • short: name on the interaction icon in TAO.
  • label: label of the interaction
  • scoringMethod: the MATCH CORRECT scoring can be applied on the PCI. The user can interacted with the PCI to provide the correct response. To be able to show the correct response in the author system after the author provided the correct response; the setResponse function of the TAO interface should be implemented. Scoring can (for now) only be done using a string comparison. But sinces the PCI developer implement the getResponse method, as string comparison can be done to compare JSON of formatted numbers.

Changes

To be able to add an IMS-PCI to the TAO authoring system properties are added to the package.json and implemented lifecycle events that should be implemented in the PCI.

or

 npm run tspci -- add --target tao

To create the zip file that can be added in TAO run:

 tspci --target tao

or

 npm run tspci -- --target tao

life cycle methods

To be TAO compliant the TAOpci interface should be implemented:

class App implements IMSpci<PropTypes>, TAOpci {
  // ============== OMMITED IMS IMPLEMENTATION =====================

  // ============== HERE THE EXTRA TAO IMPLEMENTATION =====================
  off = () => {}; // called when setting correct response in tao, if not implemented TAO gives an error
  on = (val) => {};

  // THIS IS USED TO RESTORE THE CORRECT ANSWER IN THE AUTHORING PART OF TAO.
  setResponse = (response: any) => {
    try {
      // this is an example of how a string response can be restored.
      if (response.base && response.base.string) {
        // set the response to the pci
      }
    } catch {
      // ignore
    }
    this.render();
  };

  resetResponse = () => {
    // reset the pci to its initial state
    this.render();
  };

  // RERENDER THE PCI HERE, SO CHANGING CONFIG PROPERTIES IS DIRECTLY VISIBLE IN TAO.
  trigger = (event: string, value: any) => {
    this.config.properties[event] = value;
    this.render();
  };
}

Configuration

package.json

The version and description fields of the package.json are used while creating the zip file and are mandatory.

Other config properties should be placed under: config -> tspci:

 "config": {
  "tspci": {
    "typeIdentifier": "myPci",
    ...
  }
 }
  • typeIdentifier: a field 'typeIdentifier' should be added. This should match the 'typeIdentifier' value in the PCI entry file (The one that implements IMSPci). Only (alpha)numeric values are allowed. This because a hyphen in the identifier causes an error in TAO. To be sure, only alphanumeric are allowed.
  • label: used as label in TAO
  • short: short name used in TAO to label the PCI where you can drag it in an item.
  • score: Array of: "MATCH_CORRECT", "CUSTOM" or "NONE". Can contain one or all three values. The first provided value will be used as default.
    • MATCH_CORRECT: If the item author should be able to set the correct response in TAO; MATCH_CORRECT is the only option. With the MATCH_CORRECT, the item author can interact with the PCI to provide the correct answer.
    • CUSTOM: "CUSTOM" allows to add custom response processing in TAO. This is needed if a string comparison is not possible. The item author cannot interact with the PCI to provided the correct answer. The correct answer should in the response processing template.
    • NONE: if the PCI is used as a tool and/or scoring is not needed the scoring method should be set to NONE.

provide scoring for the PCI in TAO

icon

Add a svg file with the name {typeIdentifier}.svg in the root of the PCI directory to have a custom icon for the PCI in TAO.

custom icon