New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

pie-demo

Package Overview
Dependencies
Maintainers
2
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pie-demo

Custom Element for Demoing PIE Framework Interactions

  • 1.25.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
2
Weekly downloads
 
Created
Source

Built With Stencil

PIE Demo

A Custom Element for demonstrating a PIE interaction designed for use with the pie-cloud packaging service.

<pie-demo
   editor="true" 
   pie="@pie-element/multiple-choice"
  >

</pie-demo>

Setup

npm install

Development

Edit src/index.html with the name and version of the element you want to demo. And also alter the model.

Example

<pie-demo id="demo" editor="true" pie="@pie-element/ebsr@1.2.0"></pie-demo>

  <script>
    const model = {
      "id": "0",
      "element": "pie-element-ebsr",
      "partA": {
        "prompt": "What color is the sky?",
        "choiceMode": "radio",
        "keyMode": "numbers",
        "choices": [
          {
            "value": "yellow",
            "label": "<div>Yellow</div>",
            "correct": false
          },
          {
            "value": "green",
            "label": "<div>Green</div>",
            "correct": false
          },
          {
            "correct": true,
            "value": "blue",
            "label": "<div>Blue</div>"
          }
        ],
        "partialScoring": false,
        "partialScoringLabel": "Each correct response that is correctly checked and each incorrect response\n          that is correctly unchecked will be worth 1 point.\n          The maximum points is the total number of answer choices.",
        "shuffle": false,
        "showCorrect": false
      },
      "partB": {
        "prompt": "What color do you get when you mix Red with your answer in Part 1?",
        "choiceMode": "radio",
        "keyMode": "numbers",
        "choices": [
          {
            "value": "orange",
            "label": "<div>Orange</div>",
            "correct": false
          },
          {
            "correct": true,
            "value": "purple",
            "label": "<div>Purple</div>"
          },
          {
            "value": "pink",
            "label": "<div>Pink</div>"
          },
          {
            "value": "green",
            "label": "<div>Green</div>"
          }
        ],
        "partialScoring": false,
        "partialScoringLabel": "Each correct response that is correctly checked and each incorrect response\n          that is correctly unchecked will be worth 1 point.\n          The maximum points is the total number of answer choices.",
        "shuffle": false
      }
    };
    const configure = {
      promptLabel: "Prompt",
      addChoiceButtonLabel: "Add a choice",
      addChoice: false,
      addFeedBack: true,
      deleteChoice: true,
      showPrompt: true,
      answerChoiceCount: 0,
      settingsSelectChoiceMode: true,
      settingsSelectChoicePrefixes: true,
      settingsSelectChoiceModeLabel: "Response Type",
      settingsChoicePrefixesLabel: "Choice Labels",
      settingsPartialScoring: true,
      settingsConfigShuffle: true
    };
    const pieDemo = document.getElementById("demo");
    pieDemo.model = model;
    pieDemo.configure = configure;
    pieDemo.modelSchemaJSONURI = 'https://raw.githubusercontent.com/pie-framework/pie-elements/develop/packages/categorize/docs/pie-schema.json';
    pieDemo.configureSchemaJSONURI = 'https://raw.githubusercontent.com/pie-framework/pie-elements/develop/packages/categorize/docs/config-schema.json';
  </script>

Testing

Run e2e and unit tests:

npm run test

Local Devt

Launch the local index.html in hot-module-reload server:

npm run start    

Notes

When running npm start the HMR will attampt to re-define the custom element and get an already defined error. Need to refresh the page.

TODO

make script loading optional (but still define custome elements from pre-loaded)

FAQs

Package last updated on 17 Aug 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc