@pie-element/rubric 9.0.2-next.20261007003844 → 9.0.2
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/dist/browser/author/index.js +1178 -1178
- package/dist/browser/author/index.js.map +1 -1
- package/dist/browser/delivery/index.js +2 -2
- package/dist/browser/{dist-Das8lbco.js → dist-V9RU7-eN.js} +3247 -2321
- package/dist/browser/dist-V9RU7-eN.js.map +1 -0
- package/dist/browser/editor-runtime/author/index.js +1241 -1241
- package/dist/browser/editor-runtime/author/index.js.map +1 -1
- package/dist/browser/editor-runtime/delivery/index.js +2 -2
- package/dist/browser/editor-runtime/{dist-DoJ97vep.js → dist-Bm0QsrTD.js} +3247 -2321
- package/dist/browser/editor-runtime/dist-Bm0QsrTD.js.map +1 -0
- package/dist/browser/editor-runtime/main-CMlBnpUH.js +150 -0
- package/dist/browser/editor-runtime/main-CMlBnpUH.js.map +1 -0
- package/dist/browser/editor-runtime/print/index.js +2 -2
- package/dist/browser/main-BKBrG5xT.js +150 -0
- package/dist/browser/main-BKBrG5xT.js.map +1 -0
- package/dist/browser/print/index.js +2 -2
- package/dist/delivery/main.js +19 -18
- package/dist/index.iife.js +48 -46
- package/module/print.js +4511 -3585
- package/module/print.js.map +1 -1
- package/package.json +10 -9
- package/dist/browser/dist-Das8lbco.js.map +0 -1
- package/dist/browser/editor-runtime/dist-DoJ97vep.js.map +0 -1
- package/dist/browser/editor-runtime/main-BvWtvcxv.js +0 -150
- package/dist/browser/editor-runtime/main-BvWtvcxv.js.map +0 -1
- package/dist/browser/main-CKSQT8xs.js +0 -150
- package/dist/browser/main-CKSQT8xs.js.map +0 -1
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { m as e } from "./speech-worker-CP5P4gRS-OkQyXQak.js";
|
|
2
|
+
import { G as t, K as n, M as r, N as i, _ as a, at as o, f as s, j as c, t as l, wt as u, x as d } from "./dist-Bm0QsrTD.js";
|
|
3
|
+
import f from "react";
|
|
4
|
+
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
5
|
+
//#region src/delivery/main.tsx
|
|
6
|
+
var h = /* @__PURE__ */ e(u(), 1);
|
|
7
|
+
function g(e) {
|
|
8
|
+
return typeof e == "function" || typeof e == "object" && !!e && typeof e.$$typeof == "symbol";
|
|
9
|
+
}
|
|
10
|
+
function _(e, t) {
|
|
11
|
+
return !e || g(e) ? e : g(e.default) ? e.default : t && g(e[t]) ? e[t] : t && g(e[t]?.default) ? e[t].default : e;
|
|
12
|
+
}
|
|
13
|
+
var v = _(s, "UiLayout") || _(x.UiLayout, "UiLayout"), y = l, b = y.default, x = b && typeof b == "object" ? b : y, { translator: S } = a, C = o(v)({
|
|
14
|
+
color: r.text(),
|
|
15
|
+
backgroundColor: r.background(),
|
|
16
|
+
"&:not(.MathJax) table": { borderCollapse: "collapse" },
|
|
17
|
+
"&:not(.MathJax) table td, &:not(.MathJax) table th": {
|
|
18
|
+
padding: "8px 12px",
|
|
19
|
+
textAlign: "left"
|
|
20
|
+
},
|
|
21
|
+
"& ul p, & ol p": {
|
|
22
|
+
marginBottom: 0,
|
|
23
|
+
marginTop: 0,
|
|
24
|
+
lineHeight: "normal"
|
|
25
|
+
}
|
|
26
|
+
}), w = o(n)({
|
|
27
|
+
display: "flex",
|
|
28
|
+
flexDirection: "column",
|
|
29
|
+
alignItems: "flex-start",
|
|
30
|
+
padding: "12px 0px"
|
|
31
|
+
}), T = o("div")({ color: r.text() }), E = o("h3")({
|
|
32
|
+
color: r.text(),
|
|
33
|
+
fontSize: "16px",
|
|
34
|
+
fontWeight: "700",
|
|
35
|
+
margin: 0,
|
|
36
|
+
paddingBottom: "6px"
|
|
37
|
+
}), D = o("h4")({
|
|
38
|
+
color: r.text(),
|
|
39
|
+
fontSize: "16px",
|
|
40
|
+
fontWeight: "normal",
|
|
41
|
+
margin: 0,
|
|
42
|
+
paddingBottom: "6px"
|
|
43
|
+
}), O = o("button")(({ theme: e }) => ({
|
|
44
|
+
display: "flex",
|
|
45
|
+
alignItems: "center",
|
|
46
|
+
width: "100%",
|
|
47
|
+
padding: 0,
|
|
48
|
+
border: 0,
|
|
49
|
+
background: "transparent",
|
|
50
|
+
font: "inherit",
|
|
51
|
+
textAlign: "inherit",
|
|
52
|
+
cursor: "pointer",
|
|
53
|
+
userSelect: "none",
|
|
54
|
+
fontSize: e.typography.fontSize,
|
|
55
|
+
fontWeight: "500",
|
|
56
|
+
color: r.tertiary(),
|
|
57
|
+
margin: 0,
|
|
58
|
+
minHeight: 24
|
|
59
|
+
})), k = o("span")({
|
|
60
|
+
display: "inline-flex",
|
|
61
|
+
transition: "transform 0.2s",
|
|
62
|
+
marginLeft: 2,
|
|
63
|
+
alignSelf: "center"
|
|
64
|
+
}), A = o("h2")({
|
|
65
|
+
position: "absolute",
|
|
66
|
+
width: "1px",
|
|
67
|
+
height: "1px",
|
|
68
|
+
padding: 0,
|
|
69
|
+
margin: "-1px",
|
|
70
|
+
overflow: "hidden",
|
|
71
|
+
clip: "rect(0,0,0,0)",
|
|
72
|
+
border: 0,
|
|
73
|
+
whiteSpace: "nowrap"
|
|
74
|
+
}), j = h.default.shape({
|
|
75
|
+
excludeZero: h.default.bool,
|
|
76
|
+
points: h.default.arrayOf(h.default.string),
|
|
77
|
+
sampleAnswers: h.default.arrayOf(h.default.string),
|
|
78
|
+
animationsDisabled: h.default.bool
|
|
79
|
+
}), M = class extends f.Component {
|
|
80
|
+
dudUrl = "javascript:;";
|
|
81
|
+
idPrefix = d("rubric");
|
|
82
|
+
constructor(e) {
|
|
83
|
+
super(e), this.state = { rubricOpen: !1 }, this.toggleRubric = this.toggleRubric.bind(this);
|
|
84
|
+
}
|
|
85
|
+
static propTypes = {
|
|
86
|
+
model: h.default.object.isRequired,
|
|
87
|
+
animationsDisabled: h.default.bool,
|
|
88
|
+
value: j
|
|
89
|
+
};
|
|
90
|
+
toggleRubric() {
|
|
91
|
+
this.setState({ rubricOpen: !this.state.rubricOpen });
|
|
92
|
+
}
|
|
93
|
+
shouldRenderPoint = (e, t) => !t.excludeZero || e !== 0;
|
|
94
|
+
render() {
|
|
95
|
+
let { model: e, value: n } = this.props, { animationsDisabled: r } = this.props;
|
|
96
|
+
if (r ||= n.animationsDisabled, n && n.points) {
|
|
97
|
+
let { extraCSSRules: a } = e || {}, { points: o, sampleAnswers: s } = n, l = /* @__PURE__ */ p(t, { children: o.slice(0).reverse().map((e, t) => {
|
|
98
|
+
t = o.length - t - 1;
|
|
99
|
+
let r = n.excludeZero ? t + 1 : t;
|
|
100
|
+
return /* @__PURE__ */ m(f.Fragment, { children: [/* @__PURE__ */ m(w, { children: [/* @__PURE__ */ p(E, { children: r === 1 ? `${r} PT` : `${r} PTS` }), /* @__PURE__ */ p(T, { dangerouslySetInnerHTML: { __html: c(e) } })] }, `P${t}`), s && s[t] && /* @__PURE__ */ m(w, { children: [/* @__PURE__ */ p(D, { children: "Sample Answer" }), /* @__PURE__ */ p(T, { dangerouslySetInnerHTML: { __html: c(s[t]) } })] }, `S${t}`)] }, t);
|
|
101
|
+
}) });
|
|
102
|
+
return /* @__PURE__ */ m(C, {
|
|
103
|
+
extraCSSRules: a,
|
|
104
|
+
children: [/* @__PURE__ */ p(A, { children: S.t("rubric.rubric", { lng: n.language }) }), r ? l : /* @__PURE__ */ m(f.Fragment, { children: [/* @__PURE__ */ m(O, {
|
|
105
|
+
type: "button",
|
|
106
|
+
id: `${this.idPrefix}-toggle`,
|
|
107
|
+
"aria-expanded": this.state.rubricOpen,
|
|
108
|
+
"aria-controls": `${this.idPrefix}-content`,
|
|
109
|
+
onClick: this.toggleRubric,
|
|
110
|
+
children: [S.t(this.state.rubricOpen ? "rubric.hideRubric" : "rubric.showRubric", { lng: n.language }), /* @__PURE__ */ p(k, {
|
|
111
|
+
"aria-hidden": "true",
|
|
112
|
+
children: this.state.rubricOpen ? /* @__PURE__ */ p("svg", {
|
|
113
|
+
width: "20",
|
|
114
|
+
height: "20",
|
|
115
|
+
viewBox: "0 0 24 24",
|
|
116
|
+
fill: "none",
|
|
117
|
+
stroke: "currentColor",
|
|
118
|
+
strokeWidth: "2",
|
|
119
|
+
strokeLinecap: "round",
|
|
120
|
+
strokeLinejoin: "round",
|
|
121
|
+
children: /* @__PURE__ */ p("polyline", { points: "18 15 12 9 6 15" })
|
|
122
|
+
}) : /* @__PURE__ */ p("svg", {
|
|
123
|
+
width: "20",
|
|
124
|
+
height: "20",
|
|
125
|
+
viewBox: "0 0 24 24",
|
|
126
|
+
fill: "none",
|
|
127
|
+
stroke: "currentColor",
|
|
128
|
+
strokeWidth: "2",
|
|
129
|
+
strokeLinecap: "round",
|
|
130
|
+
strokeLinejoin: "round",
|
|
131
|
+
children: /* @__PURE__ */ p("polyline", { points: "6 9 12 15 18 9" })
|
|
132
|
+
})
|
|
133
|
+
})]
|
|
134
|
+
}), /* @__PURE__ */ p(i, {
|
|
135
|
+
id: `${this.idPrefix}-content`,
|
|
136
|
+
in: this.state.rubricOpen,
|
|
137
|
+
timeout: {
|
|
138
|
+
enter: 225,
|
|
139
|
+
exit: 195
|
|
140
|
+
},
|
|
141
|
+
children: l
|
|
142
|
+
})] })]
|
|
143
|
+
});
|
|
144
|
+
} else return null;
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
//#endregion
|
|
148
|
+
export { M as t };
|
|
149
|
+
|
|
150
|
+
//# sourceMappingURL=main-CMlBnpUH.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main-CMlBnpUH.js","names":[],"sources":["../../../src/delivery/main.tsx"],"sourcesContent":["// @ts-nocheck\n\nimport React from 'react';\nimport { styled } from '@mui/material/styles';\nimport ListItem from '@mui/material/ListItem';\nimport List from '@mui/material/List';\nimport Collapse from '@mui/material/Collapse';\nimport { color, createUniqueId, UiLayout as UiLayoutImport } from '@pie-lib/render-ui';\n\nfunction isRenderableReactInteropType(value: any) {\n return (\n typeof value === 'function' ||\n (typeof value === 'object' && value !== null && typeof value.$$typeof === 'symbol')\n );\n}\n\nfunction unwrapReactInteropSymbol(maybeSymbol: any, namedExport?: string) {\n if (!maybeSymbol) return maybeSymbol;\n if (isRenderableReactInteropType(maybeSymbol)) return maybeSymbol;\n if (isRenderableReactInteropType(maybeSymbol.default)) return maybeSymbol.default;\n if (namedExport && isRenderableReactInteropType(maybeSymbol[namedExport])) {\n return maybeSymbol[namedExport];\n }\n if (namedExport && isRenderableReactInteropType(maybeSymbol[namedExport]?.default)) {\n return maybeSymbol[namedExport].default;\n }\n return maybeSymbol;\n}\nconst UiLayout = unwrapReactInteropSymbol(UiLayoutImport, 'UiLayout') || unwrapReactInteropSymbol(renderUi.UiLayout, 'UiLayout');\nimport * as RenderUiNamespace from '@pie-lib/render-ui';\nconst renderUiNamespaceAny = RenderUiNamespace as any;\nconst renderUiDefaultMaybe = renderUiNamespaceAny['default'];\nconst renderUi =\n renderUiDefaultMaybe && typeof renderUiDefaultMaybe === 'object'\n ? renderUiDefaultMaybe\n : renderUiNamespaceAny;\nimport PropTypes from 'prop-types';\nimport Translator from '@pie-lib/translator';\nimport { sanitizeModelHtml } from '@pie-element/shared-utils';\n\nconst { translator } = Translator;\n\nconst StyledUiLayout: any = styled(UiLayout)({\n color: color.text(),\n backgroundColor: color.background(),\n // apply styles to tables to match the rest of the UI\n '&:not(.MathJax) table': {\n borderCollapse: 'collapse',\n },\n '&:not(.MathJax) table td, &:not(.MathJax) table th': {\n padding: '8px 12px',\n textAlign: 'left',\n },\n // reset paragraph margins and line-height inside lists to override client styles\n '& ul p, & ol p': {\n marginBottom: 0,\n marginTop: 0,\n lineHeight: 'normal',\n },\n});\n\nconst StyledListItem: any = styled(ListItem)({\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'flex-start',\n padding: '12px 0px',\n});\n\nconst Text: any = styled('div')({\n color: color.text(),\n});\n\nconst TitleText: any = styled('h3')({\n color: color.text(),\n fontSize: '16px',\n fontWeight: '700',\n margin: 0,\n paddingBottom: '6px',\n});\n\nconst SampleTitleText: any = styled('h4')({\n color: color.text(),\n fontSize: '16px',\n fontWeight: 'normal',\n margin: 0,\n paddingBottom: '6px',\n});\n\n// A native button handles Enter and Space without scrolling the page; the resets drop the\n// browser's button chrome and keep it full width.\nconst RubricToggle: any = styled('button')(({ theme }) => ({\n display: 'flex',\n alignItems: 'center',\n width: '100%',\n padding: 0,\n border: 0,\n background: 'transparent',\n font: 'inherit',\n textAlign: 'inherit',\n cursor: 'pointer',\n userSelect: 'none',\n fontSize: theme.typography.fontSize,\n fontWeight: '500',\n color: color.tertiary(),\n margin: 0,\n minHeight: 24,\n}));\n\nconst ChevronStyle: any = styled('span')({\n display: 'inline-flex',\n transition: 'transform 0.2s',\n marginLeft: 2,\n alignSelf: 'center',\n});\n\nconst HiddenScreenReader: any = styled('h2')({\n position: 'absolute',\n width: '1px',\n height: '1px',\n padding: 0,\n margin: '-1px',\n overflow: 'hidden',\n clip: 'rect(0,0,0,0)',\n border: 0,\n whiteSpace: 'nowrap',\n});\n\nexport const RubricType = PropTypes.shape({\n excludeZero: PropTypes.bool,\n points: PropTypes.arrayOf(PropTypes.string),\n sampleAnswers: PropTypes.arrayOf(PropTypes.string),\n animationsDisabled: PropTypes.bool,\n});\n\nclass Rubric extends React.Component {\n dudUrl = 'javascript:;';\n idPrefix = createUniqueId('rubric');\n\n constructor(props) {\n super(props);\n this.state = {\n rubricOpen: false,\n };\n this.toggleRubric = this.toggleRubric.bind(this);\n }\n\n static propTypes = {\n model: PropTypes.object.isRequired,\n animationsDisabled: PropTypes.bool,\n value: RubricType,\n };\n\n toggleRubric() {\n this.setState({ rubricOpen: !this.state.rubricOpen });\n }\n\n shouldRenderPoint: any = (index, value) => {\n if (!value.excludeZero) {\n return true;\n } else {\n return index !== 0;\n }\n };\n\n render() {\n const { model, value } = this.props;\n let { animationsDisabled } = this.props;\n animationsDisabled = animationsDisabled || value.animationsDisabled;\n\n if (value && value.points) {\n const { extraCSSRules } = model || {};\n const { points, sampleAnswers } = value;\n\n const rubricList = (\n <List>\n {points\n .slice(0)\n .reverse()\n .map((desc, index) => {\n index = points.length - index - 1;\n const pointsLabel = value.excludeZero ? index + 1 : index;\n\n return (\n <React.Fragment key={index}>\n <StyledListItem key={`P${index}`}>\n <TitleText>\n {pointsLabel === 1 ? `${pointsLabel} PT` : `${pointsLabel} PTS`}\n </TitleText>\n <Text dangerouslySetInnerHTML={{ __html: sanitizeModelHtml(desc) }} />\n </StyledListItem>\n\n {sampleAnswers && sampleAnswers[index] && (\n <StyledListItem key={`S${index}`}>\n <SampleTitleText>\n Sample Answer\n </SampleTitleText>\n <Text dangerouslySetInnerHTML={{ __html: sanitizeModelHtml(sampleAnswers[index]) }} />\n </StyledListItem>\n )}\n </React.Fragment>\n );\n })}\n </List>\n );\n\n return (\n <StyledUiLayout extraCSSRules={extraCSSRules}>\n {/* screen reader only heading for navigation as per PD-5057 */}\n <HiddenScreenReader>{translator.t('rubric.rubric', { lng: value.language })}</HiddenScreenReader>\n {!animationsDisabled ? (\n <React.Fragment>\n <RubricToggle\n type=\"button\"\n id={`${this.idPrefix}-toggle`}\n aria-expanded={this.state.rubricOpen}\n aria-controls={`${this.idPrefix}-content`}\n onClick={this.toggleRubric}\n >\n {translator.t(this.state.rubricOpen ? 'rubric.hideRubric' : 'rubric.showRubric', {\n lng: value.language,\n })}\n <ChevronStyle aria-hidden=\"true\">\n {this.state.rubricOpen ? (\n <svg\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <polyline points=\"18 15 12 9 6 15\"></polyline>\n </svg>\n ) : (\n <svg\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <polyline points=\"6 9 12 15 18 9\"></polyline>\n </svg>\n )}\n </ChevronStyle>\n </RubricToggle>\n <Collapse\n id={`${this.idPrefix}-content`}\n in={this.state.rubricOpen}\n timeout={{ enter: 225, exit: 195 }}\n >\n {rubricList}\n </Collapse>\n </React.Fragment>\n ) : (\n rubricList\n )}\n </StyledUiLayout>\n );\n } else {\n return null;\n }\n }\n}\n\nexport default Rubric;\n"],"mappings":";;;;;;AASA,SAAS,EAA6B,GAAY;CAChD,OACE,OAAO,KAAU,cAChB,OAAO,KAAU,cAAY,KAAkB,OAAO,EAAM,YAAa;AAE9E;AAEA,SAAS,EAAyB,GAAkB,GAAsB;CAUxE,OATI,CAAC,KACD,EAA6B,CAAW,IAAU,IAClD,EAA6B,EAAY,OAAO,IAAU,EAAY,UACtE,KAAe,EAA6B,EAAY,EAAY,IAC/D,EAAY,KAEjB,KAAe,EAA6B,EAAY,EAAY,EAAE,OAAO,IACxE,EAAY,EAAY,CAAC,UAE3B;AACT;AACA,IAAM,IAAW,EAAyB,GAAgB,UAAU,KAAK,EAAyB,EAAS,UAAU,UAAU,GAEzH,IAAuB,GACvB,IAAuB,EAAqB,SAC5C,IACJ,KAAwB,OAAO,KAAyB,WACpD,IACA,GAKA,EAAE,kBAAe,GAEjB,IAAsB,EAAO,CAAQ,CAAC,CAAC;CAC3C,OAAO,EAAM,KAAK;CAClB,iBAAiB,EAAM,WAAW;CAElC,yBAAyB,EACvB,gBAAgB,WAClB;CACA,sDAAsD;EACpD,SAAS;EACT,WAAW;CACb;CAEA,kBAAkB;EAChB,cAAc;EACd,WAAW;EACX,YAAY;CACd;AACF,CAAC,GAEK,IAAsB,EAAO,CAAQ,CAAC,CAAC;CAC3C,SAAS;CACT,eAAe;CACf,YAAY;CACZ,SAAS;AACX,CAAC,GAEK,IAAY,EAAO,KAAK,CAAC,CAAC,EAC9B,OAAO,EAAM,KAAK,EACpB,CAAC,GAEK,IAAiB,EAAO,IAAI,CAAC,CAAC;CAClC,OAAO,EAAM,KAAK;CAClB,UAAU;CACV,YAAY;CACZ,QAAQ;CACR,eAAe;AACjB,CAAC,G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G,EAAW,EAAE,KAAK,MAAM,aAAa,sBAAsB,qBAAqB,EAC/E,KAAK,EAAM,SACb,CAAC,GACD,kBAAC,GAAD;MAAc,eAAY;gBACvB,KAAK,MAAM,aACV,kBAAC,OAAD;OACE,OAAM;OACN,QAAO;OACP,SAAQ;OACR,MAAK;OACL,QAAO;OACP,aAAY;OACZ,eAAc;OACd,gBAAe;iBAEf,kBAAC,YAAD,EAAU,QAAO,kBAA4B,CAAA;MAC1C,CAAA,IAEL,kBAAC,OAAD;OACE,OAAM;OACN,QAAO;OACP,SAAQ;OACR,MAAK;OACL,QAAO;OACP,aAAY;OACZ,eAAc;OACd,gBAAe;iBAEf,kBAAC,YAAD,EAAU,QAAO,iBAA2B,CAAA;MACzC,CAAA;KAEK,CAAA,CACF;QACd,kBAAC,GAAD;KACE,IAAI,GAAG,KAAK,SAAS;KACrB,IAAI,KAAK,MAAM;KACf,SAAS;MAAE,OAAO;MAAK,MAAM;KAAI;eAEhC;IACO,CAAA,CACI,EAAA,CAAA,CAIJ;;EAEpB,OACE,OAAO;CAEX;AACF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { m as e } from "../speech-worker-CP5P4gRS-OkQyXQak.js";
|
|
2
|
-
import { S as t, v as n } from "../dist-
|
|
3
|
-
import { t as r } from "../main-
|
|
2
|
+
import { S as t, v as n } from "../dist-Bm0QsrTD.js";
|
|
3
|
+
import { t as r } from "../main-CMlBnpUH.js";
|
|
4
4
|
import { o as i } from "../dist-nY_63J99.js";
|
|
5
5
|
import a from "react";
|
|
6
6
|
import { createRoot as o } from "react-dom/client";
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { p as e } from "./speech-worker-CP5P4gRS-G4rtBs8u.js";
|
|
2
|
+
import { G as t, K as n, M as r, N as i, _ as a, at as o, f as s, j as c, t as l, wt as u, x as d } from "./dist-V9RU7-eN.js";
|
|
3
|
+
import f from "react";
|
|
4
|
+
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
5
|
+
//#region src/delivery/main.tsx
|
|
6
|
+
var h = /* @__PURE__ */ e(u(), 1);
|
|
7
|
+
function g(e) {
|
|
8
|
+
return typeof e == "function" || typeof e == "object" && !!e && typeof e.$$typeof == "symbol";
|
|
9
|
+
}
|
|
10
|
+
function _(e, t) {
|
|
11
|
+
return !e || g(e) ? e : g(e.default) ? e.default : t && g(e[t]) ? e[t] : t && g(e[t]?.default) ? e[t].default : e;
|
|
12
|
+
}
|
|
13
|
+
var v = _(s, "UiLayout") || _(x.UiLayout, "UiLayout"), y = l, b = y.default, x = b && typeof b == "object" ? b : y, { translator: S } = a, C = o(v)({
|
|
14
|
+
color: r.text(),
|
|
15
|
+
backgroundColor: r.background(),
|
|
16
|
+
"&:not(.MathJax) table": { borderCollapse: "collapse" },
|
|
17
|
+
"&:not(.MathJax) table td, &:not(.MathJax) table th": {
|
|
18
|
+
padding: "8px 12px",
|
|
19
|
+
textAlign: "left"
|
|
20
|
+
},
|
|
21
|
+
"& ul p, & ol p": {
|
|
22
|
+
marginBottom: 0,
|
|
23
|
+
marginTop: 0,
|
|
24
|
+
lineHeight: "normal"
|
|
25
|
+
}
|
|
26
|
+
}), w = o(n)({
|
|
27
|
+
display: "flex",
|
|
28
|
+
flexDirection: "column",
|
|
29
|
+
alignItems: "flex-start",
|
|
30
|
+
padding: "12px 0px"
|
|
31
|
+
}), T = o("div")({ color: r.text() }), E = o("h3")({
|
|
32
|
+
color: r.text(),
|
|
33
|
+
fontSize: "16px",
|
|
34
|
+
fontWeight: "700",
|
|
35
|
+
margin: 0,
|
|
36
|
+
paddingBottom: "6px"
|
|
37
|
+
}), D = o("h4")({
|
|
38
|
+
color: r.text(),
|
|
39
|
+
fontSize: "16px",
|
|
40
|
+
fontWeight: "normal",
|
|
41
|
+
margin: 0,
|
|
42
|
+
paddingBottom: "6px"
|
|
43
|
+
}), O = o("button")(({ theme: e }) => ({
|
|
44
|
+
display: "flex",
|
|
45
|
+
alignItems: "center",
|
|
46
|
+
width: "100%",
|
|
47
|
+
padding: 0,
|
|
48
|
+
border: 0,
|
|
49
|
+
background: "transparent",
|
|
50
|
+
font: "inherit",
|
|
51
|
+
textAlign: "inherit",
|
|
52
|
+
cursor: "pointer",
|
|
53
|
+
userSelect: "none",
|
|
54
|
+
fontSize: e.typography.fontSize,
|
|
55
|
+
fontWeight: "500",
|
|
56
|
+
color: r.tertiary(),
|
|
57
|
+
margin: 0,
|
|
58
|
+
minHeight: 24
|
|
59
|
+
})), k = o("span")({
|
|
60
|
+
display: "inline-flex",
|
|
61
|
+
transition: "transform 0.2s",
|
|
62
|
+
marginLeft: 2,
|
|
63
|
+
alignSelf: "center"
|
|
64
|
+
}), A = o("h2")({
|
|
65
|
+
position: "absolute",
|
|
66
|
+
width: "1px",
|
|
67
|
+
height: "1px",
|
|
68
|
+
padding: 0,
|
|
69
|
+
margin: "-1px",
|
|
70
|
+
overflow: "hidden",
|
|
71
|
+
clip: "rect(0,0,0,0)",
|
|
72
|
+
border: 0,
|
|
73
|
+
whiteSpace: "nowrap"
|
|
74
|
+
}), j = h.default.shape({
|
|
75
|
+
excludeZero: h.default.bool,
|
|
76
|
+
points: h.default.arrayOf(h.default.string),
|
|
77
|
+
sampleAnswers: h.default.arrayOf(h.default.string),
|
|
78
|
+
animationsDisabled: h.default.bool
|
|
79
|
+
}), M = class extends f.Component {
|
|
80
|
+
dudUrl = "javascript:;";
|
|
81
|
+
idPrefix = d("rubric");
|
|
82
|
+
constructor(e) {
|
|
83
|
+
super(e), this.state = { rubricOpen: !1 }, this.toggleRubric = this.toggleRubric.bind(this);
|
|
84
|
+
}
|
|
85
|
+
static propTypes = {
|
|
86
|
+
model: h.default.object.isRequired,
|
|
87
|
+
animationsDisabled: h.default.bool,
|
|
88
|
+
value: j
|
|
89
|
+
};
|
|
90
|
+
toggleRubric() {
|
|
91
|
+
this.setState({ rubricOpen: !this.state.rubricOpen });
|
|
92
|
+
}
|
|
93
|
+
shouldRenderPoint = (e, t) => !t.excludeZero || e !== 0;
|
|
94
|
+
render() {
|
|
95
|
+
let { model: e, value: n } = this.props, { animationsDisabled: r } = this.props;
|
|
96
|
+
if (r ||= n.animationsDisabled, n && n.points) {
|
|
97
|
+
let { extraCSSRules: a } = e || {}, { points: o, sampleAnswers: s } = n, l = /* @__PURE__ */ p(t, { children: o.slice(0).reverse().map((e, t) => {
|
|
98
|
+
t = o.length - t - 1;
|
|
99
|
+
let r = n.excludeZero ? t + 1 : t;
|
|
100
|
+
return /* @__PURE__ */ m(f.Fragment, { children: [/* @__PURE__ */ m(w, { children: [/* @__PURE__ */ p(E, { children: r === 1 ? `${r} PT` : `${r} PTS` }), /* @__PURE__ */ p(T, { dangerouslySetInnerHTML: { __html: c(e) } })] }, `P${t}`), s && s[t] && /* @__PURE__ */ m(w, { children: [/* @__PURE__ */ p(D, { children: "Sample Answer" }), /* @__PURE__ */ p(T, { dangerouslySetInnerHTML: { __html: c(s[t]) } })] }, `S${t}`)] }, t);
|
|
101
|
+
}) });
|
|
102
|
+
return /* @__PURE__ */ m(C, {
|
|
103
|
+
extraCSSRules: a,
|
|
104
|
+
children: [/* @__PURE__ */ p(A, { children: S.t("rubric.rubric", { lng: n.language }) }), r ? l : /* @__PURE__ */ m(f.Fragment, { children: [/* @__PURE__ */ m(O, {
|
|
105
|
+
type: "button",
|
|
106
|
+
id: `${this.idPrefix}-toggle`,
|
|
107
|
+
"aria-expanded": this.state.rubricOpen,
|
|
108
|
+
"aria-controls": `${this.idPrefix}-content`,
|
|
109
|
+
onClick: this.toggleRubric,
|
|
110
|
+
children: [S.t(this.state.rubricOpen ? "rubric.hideRubric" : "rubric.showRubric", { lng: n.language }), /* @__PURE__ */ p(k, {
|
|
111
|
+
"aria-hidden": "true",
|
|
112
|
+
children: this.state.rubricOpen ? /* @__PURE__ */ p("svg", {
|
|
113
|
+
width: "20",
|
|
114
|
+
height: "20",
|
|
115
|
+
viewBox: "0 0 24 24",
|
|
116
|
+
fill: "none",
|
|
117
|
+
stroke: "currentColor",
|
|
118
|
+
strokeWidth: "2",
|
|
119
|
+
strokeLinecap: "round",
|
|
120
|
+
strokeLinejoin: "round",
|
|
121
|
+
children: /* @__PURE__ */ p("polyline", { points: "18 15 12 9 6 15" })
|
|
122
|
+
}) : /* @__PURE__ */ p("svg", {
|
|
123
|
+
width: "20",
|
|
124
|
+
height: "20",
|
|
125
|
+
viewBox: "0 0 24 24",
|
|
126
|
+
fill: "none",
|
|
127
|
+
stroke: "currentColor",
|
|
128
|
+
strokeWidth: "2",
|
|
129
|
+
strokeLinecap: "round",
|
|
130
|
+
strokeLinejoin: "round",
|
|
131
|
+
children: /* @__PURE__ */ p("polyline", { points: "6 9 12 15 18 9" })
|
|
132
|
+
})
|
|
133
|
+
})]
|
|
134
|
+
}), /* @__PURE__ */ p(i, {
|
|
135
|
+
id: `${this.idPrefix}-content`,
|
|
136
|
+
in: this.state.rubricOpen,
|
|
137
|
+
timeout: {
|
|
138
|
+
enter: 225,
|
|
139
|
+
exit: 195
|
|
140
|
+
},
|
|
141
|
+
children: l
|
|
142
|
+
})] })]
|
|
143
|
+
});
|
|
144
|
+
} else return null;
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
//#endregion
|
|
148
|
+
export { M as t };
|
|
149
|
+
|
|
150
|
+
//# sourceMappingURL=main-BKBrG5xT.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main-BKBrG5xT.js","names":[],"sources":["../../src/delivery/main.tsx"],"sourcesContent":["// @ts-nocheck\n\nimport React from 'react';\nimport { styled } from '@mui/material/styles';\nimport ListItem from '@mui/material/ListItem';\nimport List from '@mui/material/List';\nimport Collapse from '@mui/material/Collapse';\nimport { color, createUniqueId, UiLayout as UiLayoutImport } from '@pie-lib/render-ui';\n\nfunction isRenderableReactInteropType(value: any) {\n return (\n typeof value === 'function' ||\n (typeof value === 'object' && value !== null && typeof value.$$typeof === 'symbol')\n );\n}\n\nfunction unwrapReactInteropSymbol(maybeSymbol: any, namedExport?: string) {\n if (!maybeSymbol) return maybeSymbol;\n if (isRenderableReactInteropType(maybeSymbol)) return maybeSymbol;\n if (isRenderableReactInteropType(maybeSymbol.default)) return maybeSymbol.default;\n if (namedExport && isRenderableReactInteropType(maybeSymbol[namedExport])) {\n return maybeSymbol[namedExport];\n }\n if (namedExport && isRenderableReactInteropType(maybeSymbol[namedExport]?.default)) {\n return maybeSymbol[namedExport].default;\n }\n return maybeSymbol;\n}\nconst UiLayout = unwrapReactInteropSymbol(UiLayoutImport, 'UiLayout') || unwrapReactInteropSymbol(renderUi.UiLayout, 'UiLayout');\nimport * as RenderUiNamespace from '@pie-lib/render-ui';\nconst renderUiNamespaceAny = RenderUiNamespace as any;\nconst renderUiDefaultMaybe = renderUiNamespaceAny['default'];\nconst renderUi =\n renderUiDefaultMaybe && typeof renderUiDefaultMaybe === 'object'\n ? renderUiDefaultMaybe\n : renderUiNamespaceAny;\nimport PropTypes from 'prop-types';\nimport Translator from '@pie-lib/translator';\nimport { sanitizeModelHtml } from '@pie-element/shared-utils';\n\nconst { translator } = Translator;\n\nconst StyledUiLayout: any = styled(UiLayout)({\n color: color.text(),\n backgroundColor: color.background(),\n // apply styles to tables to match the rest of the UI\n '&:not(.MathJax) table': {\n borderCollapse: 'collapse',\n },\n '&:not(.MathJax) table td, &:not(.MathJax) table th': {\n padding: '8px 12px',\n textAlign: 'left',\n },\n // reset paragraph margins and line-height inside lists to override client styles\n '& ul p, & ol p': {\n marginBottom: 0,\n marginTop: 0,\n lineHeight: 'normal',\n },\n});\n\nconst StyledListItem: any = styled(ListItem)({\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'flex-start',\n padding: '12px 0px',\n});\n\nconst Text: any = styled('div')({\n color: color.text(),\n});\n\nconst TitleText: any = styled('h3')({\n color: color.text(),\n fontSize: '16px',\n fontWeight: '700',\n margin: 0,\n paddingBottom: '6px',\n});\n\nconst SampleTitleText: any = styled('h4')({\n color: color.text(),\n fontSize: '16px',\n fontWeight: 'normal',\n margin: 0,\n paddingBottom: '6px',\n});\n\n// A native button handles Enter and Space without scrolling the page; the resets drop the\n// browser's button chrome and keep it full width.\nconst RubricToggle: any = styled('button')(({ theme }) => ({\n display: 'flex',\n alignItems: 'center',\n width: '100%',\n padding: 0,\n border: 0,\n background: 'transparent',\n font: 'inherit',\n textAlign: 'inherit',\n cursor: 'pointer',\n userSelect: 'none',\n fontSize: theme.typography.fontSize,\n fontWeight: '500',\n color: color.tertiary(),\n margin: 0,\n minHeight: 24,\n}));\n\nconst ChevronStyle: any = styled('span')({\n display: 'inline-flex',\n transition: 'transform 0.2s',\n marginLeft: 2,\n alignSelf: 'center',\n});\n\nconst HiddenScreenReader: any = styled('h2')({\n position: 'absolute',\n width: '1px',\n height: '1px',\n padding: 0,\n margin: '-1px',\n overflow: 'hidden',\n clip: 'rect(0,0,0,0)',\n border: 0,\n whiteSpace: 'nowrap',\n});\n\nexport const RubricType = PropTypes.shape({\n excludeZero: PropTypes.bool,\n points: PropTypes.arrayOf(PropTypes.string),\n sampleAnswers: PropTypes.arrayOf(PropTypes.string),\n animationsDisabled: PropTypes.bool,\n});\n\nclass Rubric extends React.Component {\n dudUrl = 'javascript:;';\n idPrefix = createUniqueId('rubric');\n\n constructor(props) {\n super(props);\n this.state = {\n rubricOpen: false,\n };\n this.toggleRubric = this.toggleRubric.bind(this);\n }\n\n static propTypes = {\n model: PropTypes.object.isRequired,\n animationsDisabled: PropTypes.bool,\n value: RubricType,\n };\n\n toggleRubric() {\n this.setState({ rubricOpen: !this.state.rubricOpen });\n }\n\n shouldRenderPoint: any = (index, value) => {\n if (!value.excludeZero) {\n return true;\n } else {\n return index !== 0;\n }\n };\n\n render() {\n const { model, value } = this.props;\n let { animationsDisabled } = this.props;\n animationsDisabled = animationsDisabled || value.animationsDisabled;\n\n if (value && value.points) {\n const { extraCSSRules } = model || {};\n const { points, sampleAnswers } = value;\n\n const rubricList = (\n <List>\n {points\n .slice(0)\n .reverse()\n .map((desc, index) => {\n index = points.length - index - 1;\n const pointsLabel = value.excludeZero ? index + 1 : index;\n\n return (\n <React.Fragment key={index}>\n <StyledListItem key={`P${index}`}>\n <TitleText>\n {pointsLabel === 1 ? `${pointsLabel} PT` : `${pointsLabel} PTS`}\n </TitleText>\n <Text dangerouslySetInnerHTML={{ __html: sanitizeModelHtml(desc) }} />\n </StyledListItem>\n\n {sampleAnswers && sampleAnswers[index] && (\n <StyledListItem key={`S${index}`}>\n <SampleTitleText>\n Sample Answer\n </SampleTitleText>\n <Text dangerouslySetInnerHTML={{ __html: sanitizeModelHtml(sampleAnswers[index]) }} />\n </StyledListItem>\n )}\n </React.Fragment>\n );\n })}\n </List>\n );\n\n return (\n <StyledUiLayout extraCSSRules={extraCSSRules}>\n {/* screen reader only heading for navigation as per PD-5057 */}\n <HiddenScreenReader>{translator.t('rubric.rubric', { lng: value.language })}</HiddenScreenReader>\n {!animationsDisabled ? (\n <React.Fragment>\n <RubricToggle\n type=\"button\"\n id={`${this.idPrefix}-toggle`}\n aria-expanded={this.state.rubricOpen}\n aria-controls={`${this.idPrefix}-content`}\n onClick={this.toggleRubric}\n >\n {translator.t(this.state.rubricOpen ? 'rubric.hideRubric' : 'rubric.showRubric', {\n lng: value.language,\n })}\n <ChevronStyle aria-hidden=\"true\">\n {this.state.rubricOpen ? (\n <svg\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <polyline points=\"18 15 12 9 6 15\"></polyline>\n </svg>\n ) : (\n <svg\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <polyline points=\"6 9 12 15 18 9\"></polyline>\n </svg>\n )}\n </ChevronStyle>\n </RubricToggle>\n <Collapse\n id={`${this.idPrefix}-content`}\n in={this.state.rubricOpen}\n timeout={{ enter: 225, exit: 195 }}\n >\n {rubricList}\n </Collapse>\n </React.Fragment>\n ) : (\n rubricList\n )}\n </StyledUiLayout>\n );\n } else {\n return null;\n }\n }\n}\n\nexport default Rubric;\n"],"mappings":";;;;;;AASA,SAAS,EAA6B,GAAY;CAChD,OACE,OAAO,KAAU,cAChB,OAAO,KAAU,cAAY,KAAkB,OAAO,EAAM,YAAa;AAE9E;AAEA,SAAS,EAAyB,GAAkB,GAAsB;CAUxE,OATI,CAAC,KACD,EAA6B,CAAW,IAAU,IAClD,EAA6B,EAAY,OAAO,IAAU,EAAY,UACtE,KAAe,EAA6B,EAAY,EAAY,IAC/D,EAAY,KAEjB,KAAe,EAA6B,EAAY,EAAY,EAAE,OAAO,IACxE,EAAY,EAAY,CAAC,UAE3B;AACT;AACA,IAAM,IAAW,EAAyB,GAAgB,UAAU,KAAK,EAAyB,EAAS,UAAU,UAAU,GAEzH,IAAuB,GACvB,IAAuB,EAAqB,SAC5C,IACJ,KAAwB,OAAO,KAAyB,WACpD,IACA,GAKA,EAAE,kBAAe,GAEjB,IAAsB,EAAO,CAAQ,CAAC,CAAC;CAC3C,OAAO,EAAM,KAAK;CAClB,iBAAiB,EAAM,WAAW;CAElC,yBAAyB,EACvB,gBAAgB,WAClB;CACA,sDAAsD;EACpD,SAAS;EACT,WAAW;CACb;CAEA,kBAAkB;EAChB,cAAc;EACd,WAAW;EACX,YAAY;CACd;AACF,CAAC,GAEK,IAAsB,EAAO,CAAQ,CAAC,CAAC;CAC3C,SAAS;CACT,eAAe;CACf,YAAY;CACZ,SAAS;AACX,CAAC,GAEK,IAAY,EAAO,KAAK,CAAC,CAAC,EAC9B,OAAO,EAAM,KAAK,EACpB,CAAC,GAEK,IAAiB,EAAO,IAAI,CAAC,CAAC;CAClC,OAAO,EAAM,KAAK;CAClB,UAAU;CACV,YAAY;CACZ,QAAQ;CACR,eAAe;AACjB,CAAC,GAEK,IAAuB,EAAO,IAAI,CAAC,CAAC;CACxC,OAAO,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,EAC/E,KAAK,EAAM,SACb,CAAC,GACD,kBAAC,GAAD;MAAc,eAAY;gBACvB,KAAK,MAAM,aACV,kBAAC,OAAD;OACE,OAAM;OACN,QAAO;OACP,SAAQ;OACR,MAAK;OACL,QAAO;OACP,aAAY;OACZ,eAAc;OACd,gBAAe;iBAEf,kBAAC,YAAD,EAAU,QAAO,kBAA4B,CAAA;MAC1C,CAAA,IAEL,kBAAC,OAAD;OACE,OAAM;OACN,QAAO;OACP,SAAQ;OACR,MAAK;OACL,QAAO;OACP,aAAY;OACZ,eAAc;OACd,gBAAe;iBAEf,kBAAC,YAAD,EAAU,QAAO,iBAA2B,CAAA;MACzC,CAAA;KAEK,CAAA,CACF;QACd,kBAAC,GAAD;KACE,IAAI,GAAG,KAAK,SAAS;KACrB,IAAI,KAAK,MAAM;KACf,SAAS;MAAE,OAAO;MAAK,MAAM;KAAI;eAEhC;IACO,CAAA,CACI,EAAA,CAAA,CAIJ;;EAEpB,OACE,OAAO;CAEX;AACF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { p as e } from "../speech-worker-CP5P4gRS-G4rtBs8u.js";
|
|
2
|
-
import { S as t, v as n } from "../dist-
|
|
3
|
-
import { t as r } from "../main-
|
|
2
|
+
import { S as t, v as n } from "../dist-V9RU7-eN.js";
|
|
3
|
+
import { t as r } from "../main-BKBrG5xT.js";
|
|
4
4
|
import { o as i } from "../dist-nY_63J99.js";
|
|
5
5
|
import a from "react";
|
|
6
6
|
import { createRoot as o } from "react-dom/client";
|
package/dist/delivery/main.js
CHANGED
|
@@ -8,14 +8,15 @@ import { UiLayout as o, color as s, createUniqueId as c } from "@pie-lib/render-
|
|
|
8
8
|
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
9
9
|
import d from "prop-types";
|
|
10
10
|
import f from "@pie-lib/translator";
|
|
11
|
+
import { sanitizeModelHtml as p } from "@pie-element/shared-utils";
|
|
11
12
|
//#region src/delivery/main.tsx
|
|
12
|
-
function
|
|
13
|
+
function m(e) {
|
|
13
14
|
return typeof e == "function" || typeof e == "object" && !!e && typeof e.$$typeof == "symbol";
|
|
14
15
|
}
|
|
15
|
-
function
|
|
16
|
-
return !e ||
|
|
16
|
+
function h(e, t) {
|
|
17
|
+
return !e || m(e) ? e : m(e.default) ? e.default : t && m(e[t]) ? e[t] : t && m(e[t]?.default) ? e[t].default : e;
|
|
17
18
|
}
|
|
18
|
-
var
|
|
19
|
+
var g = h(o, "UiLayout") || h(y.UiLayout, "UiLayout"), _ = a, v = _.default, y = v && typeof v == "object" ? v : _, { translator: b } = f, x = t(g)({
|
|
19
20
|
color: s.text(),
|
|
20
21
|
backgroundColor: s.background(),
|
|
21
22
|
"&:not(.MathJax) table": { borderCollapse: "collapse" },
|
|
@@ -28,24 +29,24 @@ var h = m(o, "UiLayout") || m(v.UiLayout, "UiLayout"), g = a, _ = g.default, v =
|
|
|
28
29
|
marginTop: 0,
|
|
29
30
|
lineHeight: "normal"
|
|
30
31
|
}
|
|
31
|
-
}),
|
|
32
|
+
}), S = t(n)({
|
|
32
33
|
display: "flex",
|
|
33
34
|
flexDirection: "column",
|
|
34
35
|
alignItems: "flex-start",
|
|
35
36
|
padding: "12px 0px"
|
|
36
|
-
}),
|
|
37
|
+
}), C = t("div")({ color: s.text() }), w = t("h3")({
|
|
37
38
|
color: s.text(),
|
|
38
39
|
fontSize: "16px",
|
|
39
40
|
fontWeight: "700",
|
|
40
41
|
margin: 0,
|
|
41
42
|
paddingBottom: "6px"
|
|
42
|
-
}),
|
|
43
|
+
}), T = t("h4")({
|
|
43
44
|
color: s.text(),
|
|
44
45
|
fontSize: "16px",
|
|
45
46
|
fontWeight: "normal",
|
|
46
47
|
margin: 0,
|
|
47
48
|
paddingBottom: "6px"
|
|
48
|
-
}),
|
|
49
|
+
}), E = t("button")(({ theme: e }) => ({
|
|
49
50
|
display: "flex",
|
|
50
51
|
alignItems: "center",
|
|
51
52
|
width: "100%",
|
|
@@ -61,12 +62,12 @@ var h = m(o, "UiLayout") || m(v.UiLayout, "UiLayout"), g = a, _ = g.default, v =
|
|
|
61
62
|
color: s.tertiary(),
|
|
62
63
|
margin: 0,
|
|
63
64
|
minHeight: 24
|
|
64
|
-
})),
|
|
65
|
+
})), D = t("span")({
|
|
65
66
|
display: "inline-flex",
|
|
66
67
|
transition: "transform 0.2s",
|
|
67
68
|
marginLeft: 2,
|
|
68
69
|
alignSelf: "center"
|
|
69
|
-
}),
|
|
70
|
+
}), O = t("h2")({
|
|
70
71
|
position: "absolute",
|
|
71
72
|
width: "1px",
|
|
72
73
|
height: "1px",
|
|
@@ -76,12 +77,12 @@ var h = m(o, "UiLayout") || m(v.UiLayout, "UiLayout"), g = a, _ = g.default, v =
|
|
|
76
77
|
clip: "rect(0,0,0,0)",
|
|
77
78
|
border: 0,
|
|
78
79
|
whiteSpace: "nowrap"
|
|
79
|
-
}),
|
|
80
|
+
}), k = d.shape({
|
|
80
81
|
excludeZero: d.bool,
|
|
81
82
|
points: d.arrayOf(d.string),
|
|
82
83
|
sampleAnswers: d.arrayOf(d.string),
|
|
83
84
|
animationsDisabled: d.bool
|
|
84
|
-
}),
|
|
85
|
+
}), A = class extends e.Component {
|
|
85
86
|
dudUrl = "javascript:;";
|
|
86
87
|
idPrefix = c("rubric");
|
|
87
88
|
constructor(e) {
|
|
@@ -90,7 +91,7 @@ var h = m(o, "UiLayout") || m(v.UiLayout, "UiLayout"), g = a, _ = g.default, v =
|
|
|
90
91
|
static propTypes = {
|
|
91
92
|
model: d.object.isRequired,
|
|
92
93
|
animationsDisabled: d.bool,
|
|
93
|
-
value:
|
|
94
|
+
value: k
|
|
94
95
|
};
|
|
95
96
|
toggleRubric() {
|
|
96
97
|
this.setState({ rubricOpen: !this.state.rubricOpen });
|
|
@@ -102,17 +103,17 @@ var h = m(o, "UiLayout") || m(v.UiLayout, "UiLayout"), g = a, _ = g.default, v =
|
|
|
102
103
|
let { extraCSSRules: o } = t || {}, { points: s, sampleAnswers: c } = n, d = /* @__PURE__ */ l(r, { children: s.slice(0).reverse().map((t, r) => {
|
|
103
104
|
r = s.length - r - 1;
|
|
104
105
|
let i = n.excludeZero ? r + 1 : r;
|
|
105
|
-
return /* @__PURE__ */ u(e.Fragment, { children: [/* @__PURE__ */ u(
|
|
106
|
+
return /* @__PURE__ */ u(e.Fragment, { children: [/* @__PURE__ */ u(S, { children: [/* @__PURE__ */ l(w, { children: i === 1 ? `${i} PT` : `${i} PTS` }), /* @__PURE__ */ l(C, { dangerouslySetInnerHTML: { __html: p(t) } })] }, `P${r}`), c && c[r] && /* @__PURE__ */ u(S, { children: [/* @__PURE__ */ l(T, { children: "Sample Answer" }), /* @__PURE__ */ l(C, { dangerouslySetInnerHTML: { __html: p(c[r]) } })] }, `S${r}`)] }, r);
|
|
106
107
|
}) });
|
|
107
|
-
return /* @__PURE__ */ u(
|
|
108
|
+
return /* @__PURE__ */ u(x, {
|
|
108
109
|
extraCSSRules: o,
|
|
109
|
-
children: [/* @__PURE__ */ l(
|
|
110
|
+
children: [/* @__PURE__ */ l(O, { children: b.t("rubric.rubric", { lng: n.language }) }), a ? d : /* @__PURE__ */ u(e.Fragment, { children: [/* @__PURE__ */ u(E, {
|
|
110
111
|
type: "button",
|
|
111
112
|
id: `${this.idPrefix}-toggle`,
|
|
112
113
|
"aria-expanded": this.state.rubricOpen,
|
|
113
114
|
"aria-controls": `${this.idPrefix}-content`,
|
|
114
115
|
onClick: this.toggleRubric,
|
|
115
|
-
children: [
|
|
116
|
+
children: [b.t(this.state.rubricOpen ? "rubric.hideRubric" : "rubric.showRubric", { lng: n.language }), /* @__PURE__ */ l(D, {
|
|
116
117
|
"aria-hidden": "true",
|
|
117
118
|
children: this.state.rubricOpen ? /* @__PURE__ */ l("svg", {
|
|
118
119
|
width: "20",
|
|
@@ -150,4 +151,4 @@ var h = m(o, "UiLayout") || m(v.UiLayout, "UiLayout"), g = a, _ = g.default, v =
|
|
|
150
151
|
}
|
|
151
152
|
};
|
|
152
153
|
//#endregion
|
|
153
|
-
export {
|
|
154
|
+
export { k as RubricType, A as default };
|