import Configure from './configure.js';
import Element from './element.js';
import * as controller from './controller.js';

var generate = {};

generate.model = (id, element) => ({
  id,
  element,
  points: ['nothing right', 'a teeny bit right', 'mostly right', 'bingo'],
  sampleAnswers: [null, 'just right', 'not left', null],
  maxPoints: 3,
  excludeZero: false,
});

const { model } = generate;

var config = {
  elements: {
    'pie-rubric': '../..',
  },
  models: [model('1', 'pie-rubric')],
};

//Note: demo-el is a custom element loaded in the markup.
  customElements.whenDefined("demo-el").then(() => {
    config.models.forEach((m) => {
      const de = document.createElement("demo-el");
      document.body.appendChild(de);
      de.def = { tagName: m.element, Element, Configure, controller };
      de.model = m;
    });
  });
