@pie-element/rubric 6.3.3-next.9 → 6.3.4-next.0
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/CHANGELOG.md +11 -0
- package/configure/CHANGELOG.md +11 -0
- package/configure/package.json +4 -4
- package/module/configure.js +1 -1
- package/module/element.js +1 -1
- package/module/index.html +1 -1
- package/module/manifest.json +3 -3
- package/module/print.html +1 -1
- package/module/print.js +1 -1
- package/package.json +4 -4
- package/src/__tests__/__snapshots__/rubric-view.test.jsx.snap +0 -120
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.17.
|
|
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.17.5/module/index.js";import{_dll_pie_lib__math_rendering as s}from"../../../@pie-lib/math-rendering-module@^3.1.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/index.html
CHANGED
package/module/manifest.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/rubric",
|
|
3
|
-
"version": "6.3.
|
|
3
|
+
"version": "6.3.3",
|
|
4
4
|
"modules": [
|
|
5
5
|
{
|
|
6
6
|
"name": "@pie-lib/shared-module",
|
|
7
|
-
"version": "^1.17.
|
|
7
|
+
"version": "^1.17.5"
|
|
8
8
|
},
|
|
9
9
|
{
|
|
10
10
|
"name": "@pie-lib/math-rendering-module",
|
|
11
|
-
"version": "^3.1.
|
|
11
|
+
"version": "^3.1.5"
|
|
12
12
|
}
|
|
13
13
|
]
|
|
14
14
|
}
|
package/module/print.html
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.17.
|
|
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.17.5/module/index.js";import{_dll_pie_lib__math_rendering as a}from"../../../@pie-lib/math-rendering-module@^3.1.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.3.
|
|
3
|
+
"version": "6.3.4-next.0+bb17c7e0a",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"module": "src/index.js",
|
|
6
6
|
"description": "Rubric Scoring Interaction",
|
|
@@ -10,13 +10,13 @@
|
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@material-ui/core": "^3.9.2",
|
|
13
|
-
"@pie-lib/math-rendering": "
|
|
14
|
-
"@pie-lib/render-ui": "
|
|
13
|
+
"@pie-lib/math-rendering": "3.22.1",
|
|
14
|
+
"@pie-lib/render-ui": "4.35.2",
|
|
15
15
|
"prop-types": "^15.7.2"
|
|
16
16
|
},
|
|
17
17
|
"author": "pie framework developers",
|
|
18
18
|
"license": "ISC",
|
|
19
|
-
"gitHead": "
|
|
19
|
+
"gitHead": "bb17c7e0a54b6b5ff139075cccf1e341cc6f859f",
|
|
20
20
|
"scripts": {
|
|
21
21
|
"postpublish": "../../scripts/postpublish"
|
|
22
22
|
},
|
|
@@ -103,36 +103,6 @@ exports[`rubric viewer expanded snapshot renders 1`] = `
|
|
|
103
103
|
},
|
|
104
104
|
},
|
|
105
105
|
"overrides": Object {
|
|
106
|
-
"MuiCheckbox": Object {
|
|
107
|
-
"root": Object {
|
|
108
|
-
"&$checked": Object {
|
|
109
|
-
"color": "#3f51b5 !important",
|
|
110
|
-
},
|
|
111
|
-
},
|
|
112
|
-
},
|
|
113
|
-
"MuiRadio": Object {
|
|
114
|
-
"root": Object {
|
|
115
|
-
"&$checked": Object {
|
|
116
|
-
"color": "#3f51b5 !important",
|
|
117
|
-
},
|
|
118
|
-
},
|
|
119
|
-
},
|
|
120
|
-
"MuiSwitch": Object {
|
|
121
|
-
"root": Object {
|
|
122
|
-
"&$checked": Object {
|
|
123
|
-
"& + $bar": Object {
|
|
124
|
-
"backgroundColor": "#3f51b5 !important",
|
|
125
|
-
"opacity": 0.5,
|
|
126
|
-
},
|
|
127
|
-
"color": "#3f51b5 !important",
|
|
128
|
-
},
|
|
129
|
-
},
|
|
130
|
-
},
|
|
131
|
-
"MuiTabs": Object {
|
|
132
|
-
"root": Object {
|
|
133
|
-
"borderBottom": "1px solid #eee",
|
|
134
|
-
},
|
|
135
|
-
},
|
|
136
106
|
"MuiTypography": Object {
|
|
137
107
|
"root": Object {
|
|
138
108
|
"fontFamily": "inherit",
|
|
@@ -545,36 +515,6 @@ exports[`rubric viewer expanded snapshot renders 1`] = `
|
|
|
545
515
|
},
|
|
546
516
|
},
|
|
547
517
|
"overrides": Object {
|
|
548
|
-
"MuiCheckbox": Object {
|
|
549
|
-
"root": Object {
|
|
550
|
-
"&$checked": Object {
|
|
551
|
-
"color": "#3f51b5 !important",
|
|
552
|
-
},
|
|
553
|
-
},
|
|
554
|
-
},
|
|
555
|
-
"MuiRadio": Object {
|
|
556
|
-
"root": Object {
|
|
557
|
-
"&$checked": Object {
|
|
558
|
-
"color": "#3f51b5 !important",
|
|
559
|
-
},
|
|
560
|
-
},
|
|
561
|
-
},
|
|
562
|
-
"MuiSwitch": Object {
|
|
563
|
-
"root": Object {
|
|
564
|
-
"&$checked": Object {
|
|
565
|
-
"& + $bar": Object {
|
|
566
|
-
"backgroundColor": "#3f51b5 !important",
|
|
567
|
-
"opacity": 0.5,
|
|
568
|
-
},
|
|
569
|
-
"color": "#3f51b5 !important",
|
|
570
|
-
},
|
|
571
|
-
},
|
|
572
|
-
},
|
|
573
|
-
"MuiTabs": Object {
|
|
574
|
-
"root": Object {
|
|
575
|
-
"borderBottom": "1px solid #eee",
|
|
576
|
-
},
|
|
577
|
-
},
|
|
578
518
|
"MuiTypography": Object {
|
|
579
519
|
"root": Object {
|
|
580
520
|
"fontFamily": "inherit",
|
|
@@ -1423,36 +1363,6 @@ exports[`rubric viewer snapshot renders 1`] = `
|
|
|
1423
1363
|
},
|
|
1424
1364
|
},
|
|
1425
1365
|
"overrides": Object {
|
|
1426
|
-
"MuiCheckbox": Object {
|
|
1427
|
-
"root": Object {
|
|
1428
|
-
"&$checked": Object {
|
|
1429
|
-
"color": "#3f51b5 !important",
|
|
1430
|
-
},
|
|
1431
|
-
},
|
|
1432
|
-
},
|
|
1433
|
-
"MuiRadio": Object {
|
|
1434
|
-
"root": Object {
|
|
1435
|
-
"&$checked": Object {
|
|
1436
|
-
"color": "#3f51b5 !important",
|
|
1437
|
-
},
|
|
1438
|
-
},
|
|
1439
|
-
},
|
|
1440
|
-
"MuiSwitch": Object {
|
|
1441
|
-
"root": Object {
|
|
1442
|
-
"&$checked": Object {
|
|
1443
|
-
"& + $bar": Object {
|
|
1444
|
-
"backgroundColor": "#3f51b5 !important",
|
|
1445
|
-
"opacity": 0.5,
|
|
1446
|
-
},
|
|
1447
|
-
"color": "#3f51b5 !important",
|
|
1448
|
-
},
|
|
1449
|
-
},
|
|
1450
|
-
},
|
|
1451
|
-
"MuiTabs": Object {
|
|
1452
|
-
"root": Object {
|
|
1453
|
-
"borderBottom": "1px solid #eee",
|
|
1454
|
-
},
|
|
1455
|
-
},
|
|
1456
1366
|
"MuiTypography": Object {
|
|
1457
1367
|
"root": Object {
|
|
1458
1368
|
"fontFamily": "inherit",
|
|
@@ -1865,36 +1775,6 @@ exports[`rubric viewer snapshot renders 1`] = `
|
|
|
1865
1775
|
},
|
|
1866
1776
|
},
|
|
1867
1777
|
"overrides": Object {
|
|
1868
|
-
"MuiCheckbox": Object {
|
|
1869
|
-
"root": Object {
|
|
1870
|
-
"&$checked": Object {
|
|
1871
|
-
"color": "#3f51b5 !important",
|
|
1872
|
-
},
|
|
1873
|
-
},
|
|
1874
|
-
},
|
|
1875
|
-
"MuiRadio": Object {
|
|
1876
|
-
"root": Object {
|
|
1877
|
-
"&$checked": Object {
|
|
1878
|
-
"color": "#3f51b5 !important",
|
|
1879
|
-
},
|
|
1880
|
-
},
|
|
1881
|
-
},
|
|
1882
|
-
"MuiSwitch": Object {
|
|
1883
|
-
"root": Object {
|
|
1884
|
-
"&$checked": Object {
|
|
1885
|
-
"& + $bar": Object {
|
|
1886
|
-
"backgroundColor": "#3f51b5 !important",
|
|
1887
|
-
"opacity": 0.5,
|
|
1888
|
-
},
|
|
1889
|
-
"color": "#3f51b5 !important",
|
|
1890
|
-
},
|
|
1891
|
-
},
|
|
1892
|
-
},
|
|
1893
|
-
"MuiTabs": Object {
|
|
1894
|
-
"root": Object {
|
|
1895
|
-
"borderBottom": "1px solid #eee",
|
|
1896
|
-
},
|
|
1897
|
-
},
|
|
1898
1778
|
"MuiTypography": Object {
|
|
1899
1779
|
"root": Object {
|
|
1900
1780
|
"fontFamily": "inherit",
|