Socket
Socket
Sign inDemoInstall

@pie-api/pie-element-extensions

Package Overview
Dependencies
Maintainers
2
Versions
121
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pie-api/pie-element-extensions - npm Package Compare versions

Comparing version 1.6.9 to 1.7.0

dist/pies/cssUtils-b8faa077.js

12

dist/index.js

@@ -193,3 +193,6 @@ /**

flex-direction: column;
font-size: ${18}px;
font-size: var(
--pie-live-session-font-size-large,
${18}px
);
height: var(

@@ -213,3 +216,6 @@ --pie-live-session-response-height,

height: var(--pie-live-session-cell-height, ${32}px);
font-size: ${12}px;
font-size: var(
--pie-live-session-font-size-small,
${12}px
);
overflow: hidden;

@@ -254,3 +260,3 @@ width: var(--pie-live-session-cell-width, ${96}px);

.correctness-indicator {
font-size: ${10}px;
font-size: var(--pie-live-session-font-size-small, ${12}px)
vertical-align: top;

@@ -257,0 +263,0 @@ }

@@ -1,2 +0,2 @@

import{L as t,c as e,h as s}from"./cssUtils-4ab6f935.js";class r extends t{static get styles(){return[e]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return s`<div class="cell"></div>`}}export default r;export{r as CategorizeCell};
import{L as t,c as e,h as s}from"./cssUtils-b8faa077.js";class r extends t{static get styles(){return[e]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return s`<div class="cell"></div>`}}export default r;export{r as CategorizeCell};
//# sourceMappingURL=CategorizeCell.js.map

@@ -1,2 +0,2 @@

import{e,h as t}from"./cssUtils-4ab6f935.js";import{C as s}from"./CustomLitElement-abdf1128.js";class r extends s{static get styles(){return[e]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return t`<div class="response">
import{e,h as t}from"./cssUtils-b8faa077.js";import{C as s}from"./CustomLitElement-7984855f.js";class r extends s{static get styles(){return[e]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return t`<div class="response">
Expand to see student response

@@ -3,0 +3,0 @@ <div class="magnifier">&#9906;</div>

@@ -1,2 +0,2 @@

import{L as t,c as e,h as s}from"./cssUtils-4ab6f935.js";class r extends t{static get styles(){return[e]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return s`<div class="cell"></div>`}}export default r;export{r as ChartingCell};
import{L as t,c as e,h as s}from"./cssUtils-b8faa077.js";class r extends t{static get styles(){return[e]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return s`<div class="cell"></div>`}}export default r;export{r as ChartingCell};
//# sourceMappingURL=ChartingCell.js.map

@@ -1,2 +0,2 @@

import{e,h as t}from"./cssUtils-4ab6f935.js";import{C as s}from"./CustomLitElement-abdf1128.js";class r extends s{static get styles(){return[e]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return t`<div class="response">
import{e,h as t}from"./cssUtils-b8faa077.js";import{C as s}from"./CustomLitElement-7984855f.js";class r extends s{static get styles(){return[e]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return t`<div class="response">
Expand to see student response

@@ -3,0 +3,0 @@ <div class="magnifier">&#9906;</div>

@@ -1,2 +0,2 @@

import{L as t,c as e,h as s}from"./cssUtils-4ab6f935.js";class r extends t{static get styles(){return[e]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return s`<div class="cell"></div>`}}export default r;export{r as ConstructedCell};
import{L as t,c as e,h as s}from"./cssUtils-b8faa077.js";class r extends t{static get styles(){return[e]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return s`<div class="cell"></div>`}}export default r;export{r as ConstructedCell};
//# sourceMappingURL=ConstructedCell.js.map

@@ -1,4 +0,7 @@

import{a as s,r as e,b as t,d as r,h as a}from"./cssUtils-4ab6f935.js";import{C as n}from"./CustomLitElement-abdf1128.js";import{u as i}from"./unsafe-html-80e1c91a.js";import{p as o,g as p}from"./utils-642f8da2.js";class d extends n{static get styles(){return[s,e,t`
import{a as s,r as e,b as t,d as r,h as a}from"./cssUtils-b8faa077.js";import{C as n}from"./CustomLitElement-7984855f.js";import{u as i}from"./unsafe-html-0ff1e953.js";import{p as o,g as p}from"./utils-871a204f.js";class l extends n{static get styles(){return[s,e,t`
.response {
font-size: ${r}px;
font-size: var(
--pie-live-session-font-size-small,
${r}px
);
}

@@ -15,3 +18,3 @@ p {

${i(this._renderResponse())}
</div>`}}export default d;export{d as ConstructedResponse};
</div>`}}export default l;export{l as ConstructedResponse};
//# sourceMappingURL=ConstructedResponse.js.map

@@ -1,2 +0,2 @@

import{L as t,c as e,h as s}from"./cssUtils-4ab6f935.js";class r extends t{static get styles(){return[e]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return s`<div class="cell"></div>`}}export default r;export{r as DragInTheBlankCell};
import{L as t,c as e,h as s}from"./cssUtils-b8faa077.js";class r extends t{static get styles(){return[e]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return s`<div class="cell"></div>`}}export default r;export{r as DragInTheBlankCell};
//# sourceMappingURL=DragInTheBlankCell.js.map

@@ -1,2 +0,2 @@

import{g as e,j as s,r as t,b as o,h as r}from"./cssUtils-4ab6f935.js";import{C as i}from"./CustomLitElement-abdf1128.js";import"./unsafe-html-80e1c91a.js";import{g as h,r as c}from"./utils-642f8da2.js";class n extends i{static get styles(){return[e,s,t,o`
import{g as e,j as s,r as t,b as o,h as r}from"./cssUtils-b8faa077.js";import{C as i}from"./CustomLitElement-7984855f.js";import"./unsafe-html-0ff1e953.js";import{g as h,r as n}from"./utils-871a204f.js";class c extends i{static get styles(){return[e,s,t,o`
span {

@@ -24,5 +24,5 @@ margin: 2px;

</div>
${c(this.hoveredChoice)}
${n(this.hoveredChoice)}
</div>
`}}export default n;export{n as DragInTheBlankResponse};
`}}export default c;export{c as DragInTheBlankResponse};
//# sourceMappingURL=DragInTheBlankResponse.js.map

@@ -1,2 +0,2 @@

import{L as t,c as e,h as s}from"./cssUtils-4ab6f935.js";class r extends t{static get styles(){return[e]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return s`<div class="cell"></div>`}}export default r;export{r as DrawingCell};
import{L as t,c as e,h as s}from"./cssUtils-b8faa077.js";class r extends t{static get styles(){return[e]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return s`<div class="cell"></div>`}}export default r;export{r as DrawingCell};
//# sourceMappingURL=DrawingCell.js.map

@@ -1,2 +0,2 @@

import{r as t,b as e,k as s,l as i,h as a}from"./cssUtils-4ab6f935.js";import{C as r}from"./CustomLitElement-abdf1128.js";class n extends r{static get styles(){return[t,e`
import{r as e,b as t,k as s,l as i,h as a}from"./cssUtils-b8faa077.js";import{C as r}from"./CustomLitElement-7984855f.js";class n extends r{static get styles(){return[e,t`
.response {

@@ -16,12 +16,12 @@ position: relative;

${s}
font-size: ${i}px;
font-size: var(--pie-live-session-font-size-small, ${i}px);
position: absolute;
transform-origin: left;
}
`]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1},containerDimensions:{type:Object}}}set containerDimensions(t){const e=this._containerDimensions;(!e&&t||e&&t&&(e.width!==t.width||e.height!==t.height))&&(this._containerDimensions=t,this.requestUpdate("containerDimensions",e))}get containerDimensions(){return this._containerDimensions}updated(t){super.updated(t);const{height:e,width:s}=this._containerDimensions||{};this.updateComplete.then(()=>{setTimeout(()=>{const{clientHeight:t,clientWidth:i}=this.shadowRoot.querySelector(".response");t&&i&&(e!==t||s!==i)&&(this.containerDimensions={width:i,height:t})},500)})}_getMinWidthAndHeight(){const{imageDimensions:t}=this.model||{},{drawables:e=[],texts:s=[]}=this.session||{};let{height:i,width:a}=t||{};return s.forEach(({x:t,y:e,width:s,fontSize:r})=>{t+s>a&&(a=t+s),e+r>i&&(i=e+r)}),e.reduce((t,e)=>{const{type:s,startx:i,starty:a,x:r,y:n,height:o,points:h,radius:l,width:c}=e||{};let d,m;switch(s){case"FreePathDrawable":case"EraserDrawable":d=Math.max(...h.filter((t,e)=>e%2==0)),m=Math.max(...h.filter((t,e)=>e%2==1));break;case"LineDrawable":d=Math.max(i,r),m=Math.max(a,n);break;case"RectangleDrawable":d=Math.max(i,i+c),m=Math.max(a,a+o);break;case"CircleDrawable":d=Math.max(i,i+l),m=Math.max(a,a+l)}return d>t.width&&(t.width=d),m>t.height&&(t.height=m),t},{width:a,height:i})}static _renderDrawing(t,e,s){const i=document.createElement("canvas"),r=i.getContext("2d");i.width=e,i.height=s,i.style.position="absolute",i.style.top="0",i.style.left="0";const{type:n,fillColor:o,outlineColor:h}=t;switch(r.fillStyle=o,r.strokeStyle=h,r.lineWidth=2,r.beginPath(),n){case"FreePathDrawable":case"EraserDrawable":{const{points:e}=t;"EraserDrawable"===n&&(r.strokeStyle="#fff",r.lineWidth=5);for(let t=0;t<e.length;t+=1)t%2!=0&&r.lineTo(e[t+1],e[t]);break}case"LineDrawable":{const{startx:e,starty:s,x:i,y:a}=t;r.moveTo(e,s),r.lineTo(i,a);break}case"RectangleDrawable":{const{startx:e,starty:s,width:i,height:a}=t;r.fillRect(e,s,i,a),r.strokeRect(e,s,i,a);break}case"CircleDrawable":{const{radius:e,startx:s,starty:i}=t;r.arc(s,i,e,0,2*Math.PI),r.fill();break}}return r.stroke(),a`${i}`}static _renderText({text:t,x:e,y:s,rotation:i,scaleX:r,scaleY:n}){return a`<span class="drawableText" style="${`top: ${s-3}px; left: ${e}px; transform: rotate(${i}deg) scaleX(${r}) scaleY(${n});`}">${t}</span>`}_renderImage(){const{imageUrl:t,imageDimensions:e}=this.model||{},{height:s,width:i}=e||{};return t?a`<img
`]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1},containerDimensions:{type:Object}}}set containerDimensions(e){const t=this._containerDimensions;(!t&&e||t&&e&&(t.width!==e.width||t.height!==e.height))&&(this._containerDimensions=e,this.requestUpdate("containerDimensions",t))}get containerDimensions(){return this._containerDimensions}updated(e){super.updated(e);const{height:t,width:s}=this._containerDimensions||{};this.updateComplete.then(()=>{setTimeout(()=>{const{clientHeight:e,clientWidth:i}=this.shadowRoot.querySelector(".response");e&&i&&(t!==e||s!==i)&&(this.containerDimensions={width:i,height:e})},500)})}_getMinWidthAndHeight(){const{imageDimensions:e}=this.model||{},{drawables:t=[],texts:s=[]}=this.session||{};let{height:i,width:a}=e||{};return s.forEach(({x:e,y:t,width:s,fontSize:r})=>{e+s>a&&(a=e+s),t+r>i&&(i=t+r)}),t.reduce((e,t)=>{const{type:s,startx:i,starty:a,x:r,y:n,height:o,points:h,radius:l,width:c}=t||{};let d,m;switch(s){case"FreePathDrawable":case"EraserDrawable":d=Math.max(...h.filter((e,t)=>t%2==0)),m=Math.max(...h.filter((e,t)=>t%2==1));break;case"LineDrawable":d=Math.max(i,r),m=Math.max(a,n);break;case"RectangleDrawable":d=Math.max(i,i+c),m=Math.max(a,a+o);break;case"CircleDrawable":d=Math.max(i,i+l),m=Math.max(a,a+l)}return d>e.width&&(e.width=d),m>e.height&&(e.height=m),e},{width:a,height:i})}static _renderDrawing(e,t,s){const i=document.createElement("canvas"),r=i.getContext("2d");i.width=t,i.height=s,i.style.position="absolute",i.style.top="0",i.style.left="0";const{type:n,fillColor:o,outlineColor:h}=e;switch(r.fillStyle=o,r.strokeStyle=h,r.lineWidth=2,r.beginPath(),n){case"FreePathDrawable":case"EraserDrawable":{const{points:t}=e;"EraserDrawable"===n&&(r.strokeStyle="#fff",r.lineWidth=5);for(let e=0;e<t.length;e+=1)e%2!=0&&r.lineTo(t[e+1],t[e]);break}case"LineDrawable":{const{startx:t,starty:s,x:i,y:a}=e;r.moveTo(t,s),r.lineTo(i,a);break}case"RectangleDrawable":{const{startx:t,starty:s,width:i,height:a}=e;r.fillRect(t,s,i,a),r.strokeRect(t,s,i,a);break}case"CircleDrawable":{const{radius:t,startx:s,starty:i}=e;r.arc(s,i,t,0,2*Math.PI),r.fill();break}}return r.stroke(),a`${i}`}static _renderText({text:e,x:t,y:s,rotation:i,scaleX:r,scaleY:n}){return a`<span class="drawableText" style="${`top: ${s-3}px; left: ${t}px; transform: rotate(${i}deg) scaleX(${r}) scaleY(${n});`}">${e}</span>`}_renderImage(){const{imageUrl:e,imageDimensions:t}=this.model||{},{height:s,width:i}=t||{};return e?a`<img
alt="Image"
src="${t}"
src="${e}"
height="${s}px"
width="${i}px"
/>`:a``}_renderContent({height:t,width:e}){const{drawables:s,texts:i}=this.session||{},r=`width: ${e}px; height: ${t}px;`,o=s&&s.map(s=>n._renderDrawing(s,e,t));return a` <div class="scalable">
/>`:a``}_renderContent({height:e,width:t}){const{drawables:s,texts:i}=this.session||{},r=`width: ${t}px; height: ${e}px;`,o=s&&s.map(s=>n._renderDrawing(s,t,e));return a` <div class="scalable">
${this._renderImage()}

@@ -32,5 +32,5 @@

</div>
</div>`}render(){const{height:t,width:e}=this._getMinWidthAndHeight(),{height:s,width:i}=this._containerDimensions||{};return a` <style>
</div>`}render(){const{height:e,width:t}=this._getMinWidthAndHeight(),{height:s,width:i}=this._containerDimensions||{};return a` <style>
.scalable {
transform: scale(min(${s/t}, ${i/e}, 1));
transform: scale(min(${s/e}, ${i/t}, 1));
}

@@ -40,4 +40,4 @@ </style>

<div class="response">
${this._containerDimensions&&this._renderContent({height:t,width:e})}
${this._containerDimensions&&this._renderContent({height:e,width:t})}
</div>`}}export default n;export{n as DrawingResponse};
//# sourceMappingURL=DrawingResponse.js.map

@@ -1,2 +0,2 @@

import{g as e,c as t,j as s,a as o,b as i,m as r,h}from"./cssUtils-4ab6f935.js";import{C as a}from"./CustomLitElement-abdf1128.js";import"./unsafe-html-80e1c91a.js";import{a as l,r as c}from"./utils-642f8da2.js";class n extends a{static get styles(){return[e,t,s,o,i`
import{g as e,c as t,j as s,a as o,b as i,m as r,h}from"./cssUtils-b8faa077.js";import{C as a}from"./CustomLitElement-7984855f.js";import"./unsafe-html-0ff1e953.js";import{a as l,r as n}from"./utils-871a204f.js";class c extends a{static get styles(){return[e,t,s,o,i`
:host {

@@ -27,5 +27,5 @@ color: var(--pie-live-session-text-color, black);

<div class="cell-content">${e}</div>
${c(this.hoveredChoice)}
${n(this.hoveredChoice)}
</div>
`}}export default n;export{n as EBSRCell};
`}}export default c;export{c as EBSRCell};
//# sourceMappingURL=EBSRCell.js.map

@@ -1,2 +0,2 @@

import{g as e,j as t,a as s,r as o,b as r,h as i}from"./cssUtils-4ab6f935.js";import{C as h}from"./CustomLitElement-abdf1128.js";import"./unsafe-html-80e1c91a.js";import{a as n,r as a}from"./utils-642f8da2.js";class u extends h{static get styles(){return[e,t,s,o,r`
import{g as e,j as t,a as s,r as o,b as r,h as i}from"./cssUtils-b8faa077.js";import{C as h}from"./CustomLitElement-7984855f.js";import"./unsafe-html-0ff1e953.js";import{a as n,r as a}from"./utils-871a204f.js";class u extends h{static get styles(){return[e,t,s,o,r`
.response {

@@ -3,0 +3,0 @@ align-items: center;

@@ -1,2 +0,2 @@

import{L as t,c as e,h as s}from"./cssUtils-4ab6f935.js";class r extends t{static get styles(){return[e]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return s`<div class="cell"></div>`}}export default r;export{r as GraphingCell};
import{L as t,c as e,h as s}from"./cssUtils-b8faa077.js";class r extends t{static get styles(){return[e]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return s`<div class="cell"></div>`}}export default r;export{r as GraphingCell};
//# sourceMappingURL=GraphingCell.js.map

@@ -1,2 +0,2 @@

import{e,h as t}from"./cssUtils-4ab6f935.js";import{C as s}from"./CustomLitElement-abdf1128.js";class r extends s{static get styles(){return[e]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return t`<div class="response">
import{e,h as t}from"./cssUtils-b8faa077.js";import{C as s}from"./CustomLitElement-7984855f.js";class r extends s{static get styles(){return[e]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return t`<div class="response">
Expand to see student response

@@ -3,0 +3,0 @@ <div class="magnifier">&#9906;</div>

@@ -1,2 +0,2 @@

import{L as t,c as e,h as s}from"./cssUtils-4ab6f935.js";class r extends t{static get styles(){return[e]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return s`<div class="cell"></div>`}}export default r;export{r as HotspotCell};
import{L as t,c as e,h as s}from"./cssUtils-b8faa077.js";class r extends t{static get styles(){return[e]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return s`<div class="cell"></div>`}}export default r;export{r as HotspotCell};
//# sourceMappingURL=HotspotCell.js.map

@@ -1,2 +0,2 @@

import{e,h as t}from"./cssUtils-4ab6f935.js";import{C as s}from"./CustomLitElement-abdf1128.js";class r extends s{static get styles(){return[e]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return t`<div class="response">
import{e,h as t}from"./cssUtils-b8faa077.js";import{C as s}from"./CustomLitElement-7984855f.js";class r extends s{static get styles(){return[e]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return t`<div class="response">
Expand to see student response

@@ -3,0 +3,0 @@ <div class="magnifier">&#9906;</div>

@@ -1,2 +0,2 @@

import{L as t,c as e,h as s}from"./cssUtils-4ab6f935.js";class r extends t{static get styles(){return[e]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return s`<div class="cell"></div>`}}export default r;export{r as InlineDropdownCell};
import{L as t,c as e,h as s}from"./cssUtils-b8faa077.js";class r extends t{static get styles(){return[e]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return s`<div class="cell"></div>`}}export default r;export{r as InlineDropdownCell};
//# sourceMappingURL=InlineDropdownCell.js.map

@@ -1,2 +0,2 @@

import{g as e,j as s,r as t,b as o,h as r}from"./cssUtils-4ab6f935.js";import{C as i}from"./CustomLitElement-abdf1128.js";import"./unsafe-html-80e1c91a.js";import{g as h,r as c}from"./utils-642f8da2.js";class a extends i{static get styles(){return[e,s,t,o`
import{g as e,j as s,r as t,b as o,h as r}from"./cssUtils-b8faa077.js";import{C as i}from"./CustomLitElement-7984855f.js";import"./unsafe-html-0ff1e953.js";import{g as h,r as c}from"./utils-871a204f.js";class a extends i{static get styles(){return[e,s,t,o`
p {

@@ -3,0 +3,0 @@ margin: 2px;

@@ -1,2 +0,2 @@

import{L as t,c as e,h as s}from"./cssUtils-4ab6f935.js";class r extends t{static get styles(){return[e]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return s`<div class="cell"></div>`}}export default r;export{r as MatchCell};
import{L as t,c as e,h as s}from"./cssUtils-b8faa077.js";class r extends t{static get styles(){return[e]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return s`<div class="cell"></div>`}}export default r;export{r as MatchCell};
//# sourceMappingURL=MatchCell.js.map

@@ -1,2 +0,2 @@

import{L as t,c as e,h as s}from"./cssUtils-4ab6f935.js";class r extends t{static get styles(){return[e]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return s`<div class="cell"></div>`}}export default r;export{r as MatchListCell};
import{L as t,c as e,h as s}from"./cssUtils-b8faa077.js";class r extends t{static get styles(){return[e]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return s`<div class="cell"></div>`}}export default r;export{r as MatchListCell};
//# sourceMappingURL=MatchListCell.js.map

@@ -1,2 +0,2 @@

import{e,h as t}from"./cssUtils-4ab6f935.js";import{C as s}from"./CustomLitElement-abdf1128.js";class r extends s{static get styles(){return[e]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return t`<div class="response">
import{e,h as t}from"./cssUtils-b8faa077.js";import{C as s}from"./CustomLitElement-7984855f.js";class r extends s{static get styles(){return[e]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return t`<div class="response">
Expand to see student response

@@ -3,0 +3,0 @@ <div class="magnifier">&#9906;</div>

@@ -1,4 +0,7 @@

import{g as e,r as t,b as s,d as o,m as r,h as i}from"./cssUtils-4ab6f935.js";import{C as c}from"./CustomLitElement-abdf1128.js";import"./unsafe-html-80e1c91a.js";import{g as h,r as d}from"./utils-642f8da2.js";class a extends c{static get styles(){return[e,t,s`
import{g as e,r as s,b as t,d as o,m as r,h as i}from"./cssUtils-b8faa077.js";import{C as c}from"./CustomLitElement-7984855f.js";import"./unsafe-html-0ff1e953.js";import{g as a,r as h}from"./utils-871a204f.js";class l extends c{static get styles(){return[e,s,t`
.response {
font-size: ${o}px;
font-size: var(
--pie-live-session-font-size-small,
${o}px
);
padding: 4px 8px;

@@ -8,3 +11,4 @@ overflow: visible;

.response-content {
overflow: hidden;
overflow: scroll;
width: 100%;
}

@@ -19,3 +23,6 @@ p {

width: 12px;
font-size: ${o}px;
font-size: var(
--pie-live-session-font-size-small,
${o}px
);
text-align: center;

@@ -38,8 +45,8 @@ color: white;

}
`]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1},hoveredChoice:{type:Object}}}set hoveredChoice(e){const t=this._hoveredChoice;t&&e&&t.value===e.value||(this._hoveredChoice=e,this.requestUpdate("hoveredChoice",t))}get hoveredChoice(){return this._hoveredChoice}constructor(){super(),this._hoveredChoice=null}mouseover(e,t){const s=e.target.closest(".choice-value"),{offsetTop:o,offsetHeight:r,offsetLeft:i,offsetWidth:c}=s;this.hoveredChoice={top:o+r+4,value:t,left:i+c+10}}mouseout(){this.hoveredChoice=null}_renderResponse(){const{headers:e,rows:t,choiceMode:s}=this.model||{},{answers:o}=this.session||{};return e&&t?i`<table>
`]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1},hoveredChoice:{type:Object}}}set hoveredChoice(e){const s=this._hoveredChoice;s&&e&&s.value===e.value||(this._hoveredChoice=e,this.requestUpdate("hoveredChoice",s))}get hoveredChoice(){return this._hoveredChoice}constructor(){super(),this._hoveredChoice=null}mouseover(e,s){const t=e.target.closest(".choice-value"),{offsetTop:o,offsetHeight:r,offsetLeft:i,offsetWidth:c}=t;this.hoveredChoice={top:o+r+4,value:s,left:i+c+10}}mouseout(){this.hoveredChoice=null}_renderResponse(){const{headers:e,rows:s,choiceMode:t}=this.model||{},{answers:o}=this.session||{};return e&&s?i`<table>
<tr>
${e.map((e,t)=>i`<td>${t?"C"+t:"Q-id"}</td>`)}
${e.map((e,s)=>i`<td>${s?"C"+s:"Q-id"}</td>`)}
</tr>
${t.map(e=>{const{values:t,title:r}=e,c=o?o[e.id]:[];return i` <tr
${s.map(e=>{const{values:s,title:r}=e,c=o?o[e.id]:[];return i` <tr
class="choice-value"

@@ -51,5 +58,5 @@ @mouseover=${e=>this.mouseover(e,r)}

${(t||c).map((e,o)=>{let r="";const d=c&&c[o];return d&&(r=h(t[o])),i`
${(s||c).map((e,o)=>{let r="";const h=c&&c[o];return h&&(r=a(s[o])),i`
<td>
<div class="choice ${s} is-${d}">
<div class="choice ${t} is-${h}">
${r}

@@ -65,5 +72,5 @@ </div>

</div>
${d(this.hoveredChoice)}
${h(this.hoveredChoice)}
</div>
`}}export default a;export{a as MatchResponse};
`}}export default l;export{l as MatchResponse};
//# sourceMappingURL=MatchResponse.js.map

@@ -1,2 +0,2 @@

import{L as t,c as e,h as s}from"./cssUtils-4ab6f935.js";class r extends t{static get styles(){return[e]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return s`<div class="cell"></div>`}}export default r;export{r as MathInlineCell};
import{L as t,c as e,h as s}from"./cssUtils-b8faa077.js";class r extends t{static get styles(){return[e]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return s`<div class="cell"></div>`}}export default r;export{r as MathInlineCell};
//# sourceMappingURL=MathInlineCell.js.map

@@ -1,4 +0,11 @@

import{L as t,r as e,h as s}from"./cssUtils-4ab6f935.js";import{u as o}from"./unsafe-html-80e1c91a.js";const a={ROUND_BRACKETS:"round_brackets",SQUARE_BRACKETS:"square_brackets",DOLLAR:"dollar",DOUBLE_DOLLAR:"double_dollar"},n={[a.ROUND_BRACKETS]:["\\(","\\)"],[a.SQUARE_BRACKETS]:["\\[","\\]"],[a.DOLLAR]:["$","$"],[a.DOUBLE_DOLLAR]:["$$","$$"]};class r extends t{static get styles(){return[e]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1},imgSrc:{type:String,attribute:!1},svgSrc:{type:String,attribute:!1},mathLoaded:{type:Boolean,attribute:!1}}}constructor(){super(),(t=>{const e=t.createElement("script");e.type="text/javascript",e.async=!0,e.src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js",t.getElementsByTagName("head")[0].appendChild(e)})(document),this.createSvg()}setSvg(t){const e=this;r.mathToSvg(((t,e)=>{let s=e;s===a.SQUARE_BRACKETS&&(console.warn("\\[...\\] is not supported yet"),s=a.ROUND_BRACKETS),s===a.DOUBLE_DOLLAR&&(console.warn("$$...$$ is not supported yet"),s=a.DOLLAR);const[o,r]=n[s]||n[a.ROUND_BRACKETS];return`${o}${t}${r}`})(t)).then(t=>{e.svgSrc=t}).catch(t=>console.error(t))}createSvg(){const t=this;if(window.MathJax){const{completeAnswer:e}=t.session||{};e&&t.setSvg(e)}else window.MathJax={jax:["input/TeX","output/SVG"],extensions:["tex2jax.js","MathMenu.js","MathZoom.js"],showMathMenu:!1,showProcessingMessages:!1,messageStyle:"none",SVG:{useGlobalCache:!1},TeX:{extensions:["AMSmath.js","AMSsymbols.js","autoload-all.js"],inlineMath:[["$","$"],["\\(","\\)"]]},AuthorInit(){window.MathJax.Hub.Register.StartupHook("End",(function(){const{completeAnswer:e}=t.session||{};e&&t.setSvg(e)}))}}}updated(t){const e=t.get("session"),{completeAnswer:s}=e||{};this.session&&s!==this.session.completeAnswer&&this.session.completeAnswer&&(!s&&this.svgSrc||this.setSvg(this.session.completeAnswer))}static mathToSvg(t){return new Promise(e=>{setTimeout(()=>{const s=t,o=document.createElement("div");o.innerHTML=s,window.MathJax&&window.MathJax.Hub&&(window.MathJax.Hub.Queue(["Typeset",window.MathJax.Hub,o]),window.MathJax.Hub.Queue(()=>{const t=o.getElementsByTagName("svg")[0];t.setAttribute("xmlns","http://www.w3.org/2000/svg"),e(t.outerHTML)}))},200)})}render(){return s`<div class="response">
${this.svgSrc?o(this.svgSrc):""}
</div>`}}export default r;export{r as MathInlineResponse};
import{L as t,r as e,b as s,d as o,h as a}from"./cssUtils-b8faa077.js";import{u as n}from"./unsafe-html-0ff1e953.js";const r={ROUND_BRACKETS:"round_brackets",SQUARE_BRACKETS:"square_brackets",DOLLAR:"dollar",DOUBLE_DOLLAR:"double_dollar"},i={[r.ROUND_BRACKETS]:["\\(","\\)"],[r.SQUARE_BRACKETS]:["\\[","\\]"],[r.DOLLAR]:["$","$"],[r.DOUBLE_DOLLAR]:["$$","$$"]};class c extends t{static get styles(){return[e,s`
.response {
font-size: var(
--pie-live-session-font-size-small,
${o}px
);
}
`]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1},imgSrc:{type:String,attribute:!1},svgSrc:{type:String,attribute:!1},mathLoaded:{type:Boolean,attribute:!1}}}constructor(){super(),(t=>{const e=t.createElement("script");e.type="text/javascript",e.async=!0,e.src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js",t.getElementsByTagName("head")[0].appendChild(e)})(document),this.createSvg()}setSvg(t){const e=this;c.mathToSvg(((t,e)=>{let s=e;s===r.SQUARE_BRACKETS&&(console.warn("\\[...\\] is not supported yet"),s=r.ROUND_BRACKETS),s===r.DOUBLE_DOLLAR&&(console.warn("$$...$$ is not supported yet"),s=r.DOLLAR);const[o,a]=i[s]||i[r.ROUND_BRACKETS];return`${o}${t}${a}`})(t)).then(t=>{e.svgSrc=t}).catch(t=>console.error(t))}createSvg(){const t=this;if(window.MathJax){const{completeAnswer:e}=t.session||{};e&&t.setSvg(e)}else window.MathJax={jax:["input/TeX","output/SVG"],extensions:["tex2jax.js","MathMenu.js","MathZoom.js"],showMathMenu:!1,showProcessingMessages:!1,messageStyle:"none",SVG:{useGlobalCache:!1},TeX:{extensions:["AMSmath.js","AMSsymbols.js","autoload-all.js"],inlineMath:[["$","$"],["\\(","\\)"]]},AuthorInit(){window.MathJax.Hub.Register.StartupHook("End",(function(){const{completeAnswer:e}=t.session||{};e&&t.setSvg(e)}))}}}updated(t){const e=t.get("session"),{completeAnswer:s}=e||{};this.session&&s!==this.session.completeAnswer&&this.session.completeAnswer&&(!s&&this.svgSrc||this.setSvg(this.session.completeAnswer))}static mathToSvg(t){return new Promise(e=>{setTimeout(()=>{const s=t,o=document.createElement("div");o.innerHTML=s,window.MathJax&&window.MathJax.Hub&&(window.MathJax.Hub.Queue(["Typeset",window.MathJax.Hub,o]),window.MathJax.Hub.Queue(()=>{const t=o.getElementsByTagName("svg")[0];t.setAttribute("xmlns","http://www.w3.org/2000/svg"),e(t.outerHTML)}))},200)})}render(){return a`<div class="response">
${this.svgSrc?n(this.svgSrc):""}
</div>`}}export default c;export{c as MathInlineResponse};
//# sourceMappingURL=MathInlineResponse.js.map

@@ -1,2 +0,2 @@

import{g as e,c as t,j as s,a as o,b as i,m as r,h}from"./cssUtils-4ab6f935.js";import{C as l}from"./CustomLitElement-abdf1128.js";import"./unsafe-html-80e1c91a.js";import{a as c,r as a}from"./utils-642f8da2.js";class n extends l{static get styles(){return[e,t,s,o,i`
import{g as e,c as t,j as s,a as o,b as i,m as r,h}from"./cssUtils-b8faa077.js";import{C as l}from"./CustomLitElement-7984855f.js";import"./unsafe-html-0ff1e953.js";import{a as c,r as a}from"./utils-871a204f.js";class n extends l{static get styles(){return[e,t,s,o,i`
:host {

@@ -3,0 +3,0 @@ color: var(--pie-live-session-text-color, black);

@@ -1,2 +0,2 @@

import{g as e,j as t,a as s,r as o,b as i,h as r}from"./cssUtils-4ab6f935.js";import{C as h}from"./CustomLitElement-abdf1128.js";import"./unsafe-html-80e1c91a.js";import{a,r as n}from"./utils-642f8da2.js";class c extends h{static get styles(){return[e,t,s,o,i`
import{g as e,j as t,a as s,r as o,b as i,h as r}from"./cssUtils-b8faa077.js";import{C as h}from"./CustomLitElement-7984855f.js";import"./unsafe-html-0ff1e953.js";import{a,r as n}from"./utils-871a204f.js";class c extends h{static get styles(){return[e,t,s,o,i`
.response {

@@ -3,0 +3,0 @@ align-items: center;

@@ -1,2 +0,2 @@

import{L as t,c as e,h as s}from"./cssUtils-4ab6f935.js";class r extends t{static get styles(){return[e]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return s`<div class="cell"></div>`}}export default r;export{r as NumberLineCell};
import{L as t,c as e,h as s}from"./cssUtils-b8faa077.js";class r extends t{static get styles(){return[e]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return s`<div class="cell"></div>`}}export default r;export{r as NumberLineCell};
//# sourceMappingURL=NumberLineCell.js.map

@@ -1,2 +0,2 @@

import{e,h as t}from"./cssUtils-4ab6f935.js";import{C as s}from"./CustomLitElement-abdf1128.js";class r extends s{static get styles(){return[e]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return t`<div class="response">
import{e,h as t}from"./cssUtils-b8faa077.js";import{C as s}from"./CustomLitElement-7984855f.js";class r extends s{static get styles(){return[e]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return t`<div class="response">
Expand to see student response

@@ -3,0 +3,0 @@ <div class="magnifier">&#9906;</div>

@@ -1,2 +0,2 @@

import{L as t,c as e,h as s}from"./cssUtils-4ab6f935.js";class r extends t{static get styles(){return[e]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return s`<div class="cell"></div>`}}export default r;export{r as OrderingCell};
import{L as t,c as e,h as s}from"./cssUtils-b8faa077.js";class r extends t{static get styles(){return[e]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return s`<div class="cell"></div>`}}export default r;export{r as OrderingCell};
//# sourceMappingURL=OrderingCell.js.map

@@ -1,2 +0,2 @@

import{e,h as t}from"./cssUtils-4ab6f935.js";import{C as s}from"./CustomLitElement-abdf1128.js";class r extends s{static get styles(){return[e]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return t`<div class="response">
import{e,h as t}from"./cssUtils-b8faa077.js";import{C as s}from"./CustomLitElement-7984855f.js";class r extends s{static get styles(){return[e]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return t`<div class="response">
Expand to see student response

@@ -3,0 +3,0 @@ <div class="magnifier">&#9906;</div>

@@ -1,2 +0,2 @@

import{L as t,c as e,h as s}from"./cssUtils-4ab6f935.js";class r extends t{static get styles(){return[e]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return s`<div class="cell"></div>`}}export default r;export{r as SelectTextCell};
import{L as t,c as e,h as s}from"./cssUtils-b8faa077.js";class r extends t{static get styles(){return[e]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1}}}render(){return s`<div class="cell"></div>`}}export default r;export{r as SelectTextCell};
//# sourceMappingURL=SelectTextCell.js.map

@@ -1,4 +0,7 @@

import{g as e,j as t,r as s,b as o,d as r,h as i}from"./cssUtils-4ab6f935.js";import{C as h}from"./CustomLitElement-abdf1128.js";import"./unsafe-html-80e1c91a.js";import{g as n,r as c}from"./utils-642f8da2.js";class a extends h{static get styles(){return[e,t,s,o`
import{g as e,j as s,r as t,b as o,d as r,h as i}from"./cssUtils-b8faa077.js";import{C as n}from"./CustomLitElement-7984855f.js";import"./unsafe-html-0ff1e953.js";import{g as h,r as c}from"./utils-871a204f.js";class a extends n{static get styles(){return[e,s,t,o`
.response {
font-size: ${r}px;
font-size: var(
--pie-live-session-font-size-small,
${r}px
);
overflow: visible;

@@ -12,3 +15,3 @@ }

}
`]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1},hoveredChoice:{type:Object}}}set hoveredChoice(e){const t=this._hoveredChoice;t&&e&&t.value===e.value||(this._hoveredChoice=e,this.requestUpdate("hoveredChoice",t))}get hoveredChoice(){return this._hoveredChoice}constructor(){super(),this._hoveredChoice=null}mouseover(e,t){const s=e.target.closest(".choice-value"),{offsetTop:o,offsetHeight:r,offsetLeft:i,offsetWidth:h}=s;this.hoveredChoice={top:o+r/2,value:t,left:i+h}}mouseout(){this.hoveredChoice=null}_renderResponse(){const{tokens:e}=this.model||{},{selectedTokens:t}=this.session||{};return e&&e.length&&t&&t.length?t.map(t=>{const s=e.find(e=>e.start===t.start&&e.end===t.end);if(!s)return i``;const{text:o,correct:r}=s;return i` <div
`]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1},hoveredChoice:{type:Object}}}set hoveredChoice(e){const s=this._hoveredChoice;s&&e&&s.value===e.value||(this._hoveredChoice=e,this.requestUpdate("hoveredChoice",s))}get hoveredChoice(){return this._hoveredChoice}constructor(){super(),this._hoveredChoice=null}mouseover(e,s){const t=e.target.closest(".choice-value"),{offsetTop:o,offsetHeight:r,offsetLeft:i,offsetWidth:n}=t;this.hoveredChoice={top:o+r/2,value:s,left:i+n}}mouseout(){this.hoveredChoice=null}_renderResponse(){const{tokens:e}=this.model||{},{selectedTokens:s}=this.session||{};return e&&e.length&&s&&s.length?s.map(s=>{const t=e.find(e=>e.start===s.start&&e.end===s.end);if(!t)return i``;const{text:o,correct:r}=t;return i` <div
class="choice-value"

@@ -19,3 +22,3 @@ @mouseover=${e=>this.mouseover(e,o)}

<p>
${n(r)}
${h(r)}
${o.length>12?o.slice(0,12)+"...":o}

@@ -22,0 +25,0 @@ </p>

@@ -6,3 +6,3 @@ {

},
"version": "1.6.9",
"version": "1.7.0",
"description": "Extended capabilites for pie-elements",

@@ -9,0 +9,0 @@ "author": "PIE Api Authors",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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