1.25.0 • Published 5 years ago

pie-demo v1.25.0

Weekly downloads
-
License
ISC
Repository
-
Last release
5 years ago

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)

1.25.0

5 years ago

1.24.0

5 years ago

1.23.0

5 years ago

1.22.0

5 years ago

1.21.0

5 years ago

1.20.0

5 years ago

1.19.0

5 years ago

1.18.0

5 years ago

1.17.0

5 years ago

1.16.0

5 years ago

1.15.0

5 years ago

1.14.0

5 years ago

1.13.0

5 years ago

1.12.0

5 years ago

1.11.0

5 years ago

1.10.0

5 years ago

1.9.0

5 years ago

1.8.0

5 years ago

1.7.0

5 years ago

1.6.0

5 years ago

1.5.0

5 years ago

1.4.0

5 years ago

1.3.0

5 years ago

1.2.0

5 years ago

1.1.0

5 years ago

1.0.0

5 years ago

0.0.1

5 years ago