@pie-lib/scoring-config 3.23.0 → 3.23.3
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/esm/index.js +65 -0
- package/esm/index.js.map +1 -0
- package/package.json +10 -3
- package/LICENSE.md +0 -5
package/esm/index.js
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Typography from '@material-ui/core/Typography';
|
|
3
|
+
import Checkbox from '@material-ui/core/Checkbox';
|
|
4
|
+
import { withStyles } from '@material-ui/core/styles';
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
6
|
+
|
|
7
|
+
class PartialScoringConfig extends React.Component {
|
|
8
|
+
constructor(props) {
|
|
9
|
+
super(props);
|
|
10
|
+
this.state = {
|
|
11
|
+
checked: false
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
this.onCheckboxChanged = () => {
|
|
15
|
+
const checked = !this.state.checked;
|
|
16
|
+
const {
|
|
17
|
+
onChange
|
|
18
|
+
} = this.props;
|
|
19
|
+
this.setState({
|
|
20
|
+
checked
|
|
21
|
+
});
|
|
22
|
+
onChange(checked);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const {
|
|
26
|
+
partialScoring
|
|
27
|
+
} = props;
|
|
28
|
+
this.state.checked = partialScoring;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
render() {
|
|
32
|
+
const {
|
|
33
|
+
classes,
|
|
34
|
+
label
|
|
35
|
+
} = this.props;
|
|
36
|
+
const {
|
|
37
|
+
checked
|
|
38
|
+
} = this.state;
|
|
39
|
+
const textLabel = label || 'Each correct response is worth 1/X where X is the number of correct answer selections.';
|
|
40
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
41
|
+
className: classes.scoringConfig
|
|
42
|
+
}, /*#__PURE__*/React.createElement(Typography, {
|
|
43
|
+
type: "subheading"
|
|
44
|
+
}, "Partial Scoring Rules"), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement(Typography, null, textLabel), /*#__PURE__*/React.createElement(Checkbox, {
|
|
45
|
+
checked: checked,
|
|
46
|
+
onChange: this.onCheckboxChanged,
|
|
47
|
+
label: ''
|
|
48
|
+
}));
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
}
|
|
52
|
+
PartialScoringConfig.propTypes = {
|
|
53
|
+
label: PropTypes.string,
|
|
54
|
+
partialScoring: PropTypes.bool,
|
|
55
|
+
classes: PropTypes.object.isRequired,
|
|
56
|
+
onChange: PropTypes.func
|
|
57
|
+
};
|
|
58
|
+
var index = withStyles(theme => ({
|
|
59
|
+
scoringConfig: {
|
|
60
|
+
paddingTop: theme.spacing.unit
|
|
61
|
+
}
|
|
62
|
+
}))(PartialScoringConfig);
|
|
63
|
+
|
|
64
|
+
export { PartialScoringConfig, index as default };
|
|
65
|
+
//# sourceMappingURL=index.js.map
|
package/esm/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/index.jsx"],"sourcesContent":["import React from 'react';\nimport Typography from '@material-ui/core/Typography';\nimport Checkbox from '@material-ui/core/Checkbox';\nimport { withStyles } from '@material-ui/core/styles';\nimport PropTypes from 'prop-types';\n\nexport class PartialScoringConfig extends React.Component {\n static propTypes = {\n label: PropTypes.string,\n partialScoring: PropTypes.bool,\n classes: PropTypes.object.isRequired,\n onChange: PropTypes.func,\n };\n\n state = {\n checked: false,\n };\n\n constructor(props) {\n super(props);\n\n const { partialScoring } = props;\n\n this.state.checked = partialScoring;\n }\n\n onCheckboxChanged = () => {\n const checked = !this.state.checked;\n const { onChange } = this.props;\n\n this.setState({\n checked,\n });\n onChange(checked);\n };\n\n render() {\n const { classes, label } = this.props;\n const { checked } = this.state;\n const textLabel = label || 'Each correct response is worth 1/X where X is the number of correct answer selections.';\n\n return (\n <div className={classes.scoringConfig}>\n <Typography type=\"subheading\">Partial Scoring Rules</Typography>\n <br />\n <Typography>{textLabel}</Typography>\n <Checkbox checked={checked} onChange={this.onCheckboxChanged} label={''} />\n </div>\n );\n }\n}\n\nexport default withStyles((theme) => ({\n scoringConfig: {\n paddingTop: theme.spacing.unit,\n },\n}))(PartialScoringConfig);\n"],"names":["PartialScoringConfig","React","Component","constructor","props","state","checked","onCheckboxChanged","onChange","setState","partialScoring","render","classes","label","textLabel","scoringConfig","propTypes","PropTypes","string","bool","object","isRequired","func","withStyles","theme","paddingTop","spacing","unit"],"mappings":";;;;;;AAMO,MAAMA,oBAAN,SAAmCC,KAAK,CAACC,SAAzC,CAAmD;AAYxDC,EAAAA,WAAW,CAACC,KAAD,EAAQ;AACjB,IAAA,KAAA,CAAMA,KAAN,CAAA;AADiB,IAAA,IAAA,CAJnBC,KAImB,GAJX;AACNC,MAAAA,OAAO,EAAE;AADH,KAIW;;AAAA,IAAA,IAAA,CAQnBC,iBARmB,GAQC,MAAM;AACxB,MAAA,MAAMD,OAAO,GAAG,CAAC,IAAA,CAAKD,KAAL,CAAWC,OAA5B;AACA,MAAA,MAAM;AAAEE,QAAAA;AAAF,OAAA,GAAe,KAAKJ,KAA1B;AAEA,MAAA,IAAA,CAAKK,QAAL,CAAc;AACZH,QAAAA;AADY,OAAd,CAAA;AAGAE,MAAAA,QAAQ,CAACF,OAAD,CAAR;AACD,IAAA,CAhBkB;;AAGjB,IAAA,MAAM;AAAEI,MAAAA;AAAF,KAAA,GAAqBN,KAA3B;AAEA,IAAA,IAAA,CAAKC,KAAL,CAAWC,OAAX,GAAqBI,cAArB;AACD,EAAA;;AAYDC,EAAAA,MAAM,GAAG;AACP,IAAA,MAAM;AAAEC,MAAAA,OAAF;AAAWC,MAAAA;AAAX,KAAA,GAAqB,KAAKT,KAAhC;AACA,IAAA,MAAM;AAAEE,MAAAA;AAAF,KAAA,GAAc,KAAKD,KAAzB;AACA,IAAA,MAAMS,SAAS,GAAGD,KAAK,IAAI,wFAA3B;AAEA,IAAA,oBACE,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA;AAAK,MAAA,SAAS,EAAED,OAAO,CAACG;AAAxB,KAAA,eACE,oBAAC,UAAD,EAAA;AAAY,MAAA,IAAI,EAAC;AAAjB,KAAA,EAAA,uBAAA,CADF,eAEE,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA,IAAA,CAFF,eAGE,KAAA,CAAA,aAAA,CAAC,UAAD,QAAaD,SAAb,CAHF,eAIE,KAAA,CAAA,aAAA,CAAC,QAAD,EAAA;AAAU,MAAA,OAAO,EAAER,OAAnB;AAA4B,MAAA,QAAQ,EAAE,IAAA,CAAKC,iBAA3C;AAA8D,MAAA,KAAK,EAAE;AAArE,KAAA,CAJF,CADF;AAQD,EAAA;;AA3CuD;AAA7CP,qBACJgB,YAAY;AACjBH,EAAAA,KAAK,EAAEI,SAAS,CAACC,MADA;AAEjBR,EAAAA,cAAc,EAAEO,SAAS,CAACE,IAFT;AAGjBP,EAAAA,OAAO,EAAEK,SAAS,CAACG,MAAV,CAAiBC,UAHT;AAIjBb,EAAAA,QAAQ,EAAES,SAAS,CAACK;AAJH;AA6CrB,YAAeC,UAAU,CAAEC,KAAD,KAAY;AACpCT,EAAAA,aAAa,EAAE;AACbU,IAAAA,UAAU,EAAED,KAAK,CAACE,OAAN,CAAcC;AADb;AADqB,CAAZ,CAAD,CAAV,CAIX3B,oBAJW,CAAf;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-lib/scoring-config",
|
|
3
|
-
"version": "3.23.
|
|
3
|
+
"version": "3.23.3",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "src/index.jsx",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"dependencies": {
|
|
14
14
|
"@material-ui/core": "^3.8.3",
|
|
15
15
|
"@material-ui/icons": "^3.0.2",
|
|
16
|
-
"@pie-lib/config-ui": "^11.26.
|
|
16
|
+
"@pie-lib/config-ui": "^11.26.3",
|
|
17
17
|
"classnames": "^2.2.6",
|
|
18
18
|
"debug": "^4.1.1",
|
|
19
19
|
"lodash": "^4.17.11",
|
|
@@ -26,5 +26,12 @@
|
|
|
26
26
|
"react": "^16.8.1",
|
|
27
27
|
"react-dom": "^16.9.0"
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "8a327571bd64249e4c88c0c8e750d16d6213f535",
|
|
30
|
+
"exports": {
|
|
31
|
+
".": {
|
|
32
|
+
"import": "./esm/index.js",
|
|
33
|
+
"require": "./lib/index.js",
|
|
34
|
+
"default": "./esm/index.js"
|
|
35
|
+
}
|
|
36
|
+
}
|
|
30
37
|
}
|
package/LICENSE.md
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
Copyright 2019 CoreSpring Inc
|
|
2
|
-
|
|
3
|
-
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
|
|
4
|
-
|
|
5
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|