@pie-element/rubric 6.0.1-next.15 → 6.0.1-next.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/module/configure.js +1 -1
- package/module/element.js +1 -1
- package/module/manifest.json +2 -2
- package/module/print.js +1 -1
- package/package.json +2 -2
package/module/element.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_dll_react as e,_dll_material_ui__core_styles as t,_dll_material_ui__core as i,_dll_pie_lib__render_ui as n,_dll_prop_types as r,_dll_react_dom as o,_dll_debug as l}from"../../../@pie-lib/shared-module@^1.14.
|
|
1
|
+
import{_dll_react as e,_dll_material_ui__core_styles as t,_dll_material_ui__core as i,_dll_pie_lib__render_ui as n,_dll_prop_types as r,_dll_react_dom as o,_dll_debug as l}from"../../../@pie-lib/shared-module@^1.14.5/module/index.js";import{_dll_pie_lib__math_rendering as s}from"../../../@pie-lib/math-rendering-module@^2.7.5/module/index.js";const a=e,{withStyles:c}=t,{ListItem:d}=i,{List:m}=i,{Collapse:h}=i,{color:p}=n,{UiLayout:u}=n,g=r,x=g.shape({excludeZero:g.bool,points:g.arrayOf(g.string),sampleAnswers:g.arrayOf(g.string),animationsDisabled:g.bool});class b extends a.Component{__init(){this.dudUrl="javascript:;"}constructor(e){super(e),b.prototype.__init.call(this),b.prototype.__init2.call(this),this.state={rubricOpen:!1,linkPrefix:"Show"},this.toggleRubric=this.toggleRubric.bind(this)}static __initStatic(){this.propTypes={classes:g.object.isRequired,model:g.object.isRequired,animationsDisabled:g.bool,value:x}}toggleRubric(){this.setState({rubricOpen:!this.state.rubricOpen}),this.setState({linkPrefix:this.state.rubricOpen?"Show":"Hide"})}__init2(){this.shouldRenderPoint=(e,t)=>!t.excludeZero||0!==e}render(){const{model:e,value:t,classes:i}=this.props;let{animationsDisabled:n}=this.props;if(n=n||t.animationsDisabled,t&&t.points){const{extraCSSRules:r}=e||{},{points:o,sampleAnswers:l}=t,s=a.createElement(m,{component:"nav"},o.slice(0).reverse().map(((e,n)=>{n=o.length-n-1;const r=t.excludeZero?n+1:n;return a.createElement(a.Fragment,{key:n},a.createElement(d,{key:`P${n}`,className:i.listColumn},a.createElement("h3",{className:i.titleText},1===r?`${r} PT`:`${r} PTS`),a.createElement("div",{className:i.text,dangerouslySetInnerHTML:{__html:e}})),l&&l[n]&&a.createElement(d,{key:`S${n}`,className:i.listColumn},a.createElement("h4",{className:i.titleText,style:{fontWeight:"normal"}},"Sample Answer"),a.createElement("div",{className:i.text,dangerouslySetInnerHTML:{__html:l[n]}})))})));return a.createElement(u,{extraCSSRules:r,className:i.root},a.createElement("h2",{className:i.hiddenScreenReader},"Rubric"),n?s:a.createElement(a.Fragment,null,a.createElement("h2",{id:"rubric-toggle",className:i.rubricToggle,tabIndex:0,role:"button","aria-expanded":this.state.rubricOpen,onClick:this.toggleRubric,onKeyPress:e=>{"Enter"!==e.key&&" "!==e.key||this.toggleRubric()}},this.state.linkPrefix," Rubric",a.createElement("span",{className:i.chevronStyle,"aria-hidden":"true"},this.state.rubricOpen?a.createElement("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("polyline",{points:"18 15 12 9 6 15"})):a.createElement("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("polyline",{points:"6 9 12 15 18 9"})))),a.createElement(h,{in:this.state.rubricOpen,timeout:"auto"},s)))}return null}}b.__initStatic();var f=c((e=>({root:{color:p.text(),backgroundColor:p.background(),"&:not(.MathJax) table":{borderCollapse:"collapse"},"&:not(.MathJax) table td, &:not(.MathJax) table th":{padding:"8px 12px",textAlign:"left"},"& ul p, & ol p":{marginBottom:0,marginTop:0,lineHeight:"normal"}},listColumn:{display:"flex",flexDirection:"column",alignItems:"flex-start",padding:"12px 0px"},listColumnItem:{padding:0},text:{color:p.text()},titleText:{color:p.text(),fontSize:"16px",fontWeight:"700",margin:0,paddingBottom:"6px"},rubricToggle:{display:"flex",alignItems:"center",cursor:"pointer",userSelect:"none",fontSize:e.typography.fontSize,fontWeight:"500",color:p.tertiary(),margin:0},chevronStyle:{display:"inline-flex",transition:"transform 0.2s",marginLeft:2,alignSelf:"center"},hiddenScreenReader:{position:"absolute",width:"1px",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clip:"rect(0,0,0,0)",border:0,whiteSpace:"nowrap"}})))(b);const y=e,S=o,_=l,{renderMath:E}=s;class k extends HTMLElement{constructor(){super(),_.log("constructor called"),this.onModelChanged=this.onModelChanged.bind(this)}set model(e){this._model=e,this._render()}onModelChanged(e){this._model=e,this._render()}connectedCallback(){this._render()}_render(){if(this._model){const e=y.createElement(f,{value:this._model});S.render(e,this,(()=>{E(this)}))}}}export{k as default};
|
package/module/manifest.json
CHANGED
package/module/print.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_dll_react as e,_dll_material_ui__core_styles as t,_dll_material_ui__core as i,_dll_pie_lib__render_ui as n,_dll_prop_types as r,_dll_react_dom as s,_dll_lodash as o,_dll_debug as l}from"../../../@pie-lib/shared-module@^1.14.
|
|
1
|
+
import{_dll_react as e,_dll_material_ui__core_styles as t,_dll_material_ui__core as i,_dll_pie_lib__render_ui as n,_dll_prop_types as r,_dll_react_dom as s,_dll_lodash as o,_dll_debug as l}from"../../../@pie-lib/shared-module@^1.14.5/module/index.js";import{_dll_pie_lib__math_rendering as a}from"../../../@pie-lib/math-rendering-module@^2.7.5/module/index.js";const c=e,{withStyles:d}=t,{ListItem:m}=i,{List:p}=i,{Collapse:h}=i,{color:u}=n,{UiLayout:g}=n,x=r,b=x.shape({excludeZero:x.bool,points:x.arrayOf(x.string),sampleAnswers:x.arrayOf(x.string),animationsDisabled:x.bool});class f extends c.Component{__init(){this.dudUrl="javascript:;"}constructor(e){super(e),f.prototype.__init.call(this),f.prototype.__init2.call(this),this.state={rubricOpen:!1,linkPrefix:"Show"},this.toggleRubric=this.toggleRubric.bind(this)}static __initStatic(){this.propTypes={classes:x.object.isRequired,model:x.object.isRequired,animationsDisabled:x.bool,value:b}}toggleRubric(){this.setState({rubricOpen:!this.state.rubricOpen}),this.setState({linkPrefix:this.state.rubricOpen?"Show":"Hide"})}__init2(){this.shouldRenderPoint=(e,t)=>!t.excludeZero||0!==e}render(){const{model:e,value:t,classes:i}=this.props;let{animationsDisabled:n}=this.props;if(n=n||t.animationsDisabled,t&&t.points){const{extraCSSRules:r}=e||{},{points:s,sampleAnswers:o}=t,l=c.createElement(p,{component:"nav"},s.slice(0).reverse().map(((e,n)=>{n=s.length-n-1;const r=t.excludeZero?n+1:n;return c.createElement(c.Fragment,{key:n},c.createElement(m,{key:`P${n}`,className:i.listColumn},c.createElement("h3",{className:i.titleText},1===r?`${r} PT`:`${r} PTS`),c.createElement("div",{className:i.text,dangerouslySetInnerHTML:{__html:e}})),o&&o[n]&&c.createElement(m,{key:`S${n}`,className:i.listColumn},c.createElement("h4",{className:i.titleText,style:{fontWeight:"normal"}},"Sample Answer"),c.createElement("div",{className:i.text,dangerouslySetInnerHTML:{__html:o[n]}})))})));return c.createElement(g,{extraCSSRules:r,className:i.root},c.createElement("h2",{className:i.hiddenScreenReader},"Rubric"),n?l:c.createElement(c.Fragment,null,c.createElement("h2",{id:"rubric-toggle",className:i.rubricToggle,tabIndex:0,role:"button","aria-expanded":this.state.rubricOpen,onClick:this.toggleRubric,onKeyPress:e=>{"Enter"!==e.key&&" "!==e.key||this.toggleRubric()}},this.state.linkPrefix," Rubric",c.createElement("span",{className:i.chevronStyle,"aria-hidden":"true"},this.state.rubricOpen?c.createElement("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},c.createElement("polyline",{points:"18 15 12 9 6 15"})):c.createElement("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},c.createElement("polyline",{points:"6 9 12 15 18 9"})))),c.createElement(h,{in:this.state.rubricOpen,timeout:"auto"},l)))}return null}}f.__initStatic();var _=d((e=>({root:{color:u.text(),backgroundColor:u.background(),"&:not(.MathJax) table":{borderCollapse:"collapse"},"&:not(.MathJax) table td, &:not(.MathJax) table th":{padding:"8px 12px",textAlign:"left"},"& ul p, & ol p":{marginBottom:0,marginTop:0,lineHeight:"normal"}},listColumn:{display:"flex",flexDirection:"column",alignItems:"flex-start",padding:"12px 0px"},listColumnItem:{padding:0},text:{color:u.text()},titleText:{color:u.text(),fontSize:"16px",fontWeight:"700",margin:0,paddingBottom:"6px"},rubricToggle:{display:"flex",alignItems:"center",cursor:"pointer",userSelect:"none",fontSize:e.typography.fontSize,fontWeight:"500",color:u.tertiary(),margin:0},chevronStyle:{display:"inline-flex",transition:"transform 0.2s",marginLeft:2,alignSelf:"center"},hiddenScreenReader:{position:"absolute",width:"1px",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clip:"rect(0,0,0,0)",border:0,whiteSpace:"nowrap"}})))(f);const y=e,S=s,{debounce:k}=o,E=l,{renderMath:v}=a,w=E("pie-element:rubric:print");class C extends HTMLElement{constructor(){super(),this._options=null,this._model=null,this._session=[],this._rerender=k((()=>{if(this._model&&this._session){const t=(e=this._model,"instructor"===this._options.role?(e.value={...e},e.mode="evaluate",e.animationsDisabled=!0,e):{}),i=this._options&&y.createElement(_,{...t});S.render(i,this,(()=>{w("render complete - render math"),v(this)}))}else w("skip");var e}),50,{leading:!1,trailing:!0})}set options(e){this._options=e}set model(e){this._model=e,this._rerender()}connectedCallback(){}}export{C as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/rubric",
|
|
3
|
-
"version": "6.0.1-next.
|
|
3
|
+
"version": "6.0.1-next.27+c88281e0e",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"module": "src/index.js",
|
|
6
6
|
"description": "Rubric Scoring Interaction",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
},
|
|
17
17
|
"author": "pie framework developers",
|
|
18
18
|
"license": "ISC",
|
|
19
|
-
"gitHead": "
|
|
19
|
+
"gitHead": "c88281e0eab96dc03bffff339aef8a22961d5d3c",
|
|
20
20
|
"scripts": {
|
|
21
21
|
"postpublish": "../../scripts/postpublish"
|
|
22
22
|
},
|