@instructure/quiz-core 20.7.1-rc.9 → 20.8.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 +18 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/NumericType/ChoiceTypeWithInfo/index.js +1 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/NumericType/ChoiceTypeWithInfo/presenter.js +90 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/NumericType/index.js +1 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/NumericType/presenter.js +255 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/{shared/ChoiceGroupTypeTable → NumericType}/theme.js +1 -2
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/{shared → RichFillBlankType}/ChoiceGroupTypeTable/presenter.js +23 -59
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/RichFillBlankType/ChoiceGroupTypeTable/styles.js +10 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/RichFillBlankType/presenter.js +11 -35
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/ScoreDistributionType/Table/index.js +120 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/ScoreDistributionType/Table/styles.js +38 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/ScoreDistributionType/Table/theme.js +11 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/ScoreDistributionType/index.js +55 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/presenter.js +14 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AfsTableWrapper/presenter.js +8 -2
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ExpandableCard/index.js +1 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ExpandableCard/presenter.js +104 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/{ChoiceGroupTypeTable → ExpandableCard}/styles.js +3 -2
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ExpandableCard/theme.js +7 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/NewItemAnalysis/index.js +4 -1
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/propTypes.js +52 -2
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/NumericType/ChoiceTypeWithInfo/index.js +13 -0
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/NumericType/ChoiceTypeWithInfo/presenter.js +113 -0
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/NumericType/index.js +13 -0
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/NumericType/presenter.js +281 -0
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/{shared/ChoiceGroupTypeTable → NumericType}/theme.js +1 -2
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/{shared → RichFillBlankType}/ChoiceGroupTypeTable/presenter.js +27 -64
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/RichFillBlankType/ChoiceGroupTypeTable/styles.js +18 -0
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/RichFillBlankType/presenter.js +15 -39
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/ScoreDistributionType/Table/index.js +140 -0
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/ScoreDistributionType/Table/styles.js +46 -0
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/ScoreDistributionType/Table/theme.js +19 -0
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/ScoreDistributionType/index.js +80 -0
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/presenter.js +20 -4
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AfsTableWrapper/presenter.js +8 -2
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ExpandableCard/index.js +13 -0
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ExpandableCard/presenter.js +124 -0
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/{ChoiceGroupTypeTable → ExpandableCard}/styles.js +3 -2
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ExpandableCard/theme.js +15 -0
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/NewItemAnalysis/index.js +4 -1
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/propTypes.js +68 -3
- package/package.json +10 -10
- /package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/{RichFillBlankType → NumericType}/styles.js +0 -0
- /package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/{shared → RichFillBlankType}/ChoiceGroupTypeTable/index.js +0 -0
- /package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/RichFillBlankType/{theme.js → ChoiceGroupTypeTable/theme.js} +0 -0
- /package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/{RichFillBlankType → NumericType}/styles.js +0 -0
- /package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/{shared → RichFillBlankType}/ChoiceGroupTypeTable/index.js +0 -0
- /package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/RichFillBlankType/{theme.js → ChoiceGroupTypeTable/theme.js} +0 -0
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = exports.ScoreDistributionTypeTable = void 0;
|
|
9
|
+
|
|
10
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
+
|
|
12
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
|
+
|
|
14
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
15
|
+
|
|
16
|
+
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
|
|
17
|
+
|
|
18
|
+
var _propTypes = require("../../../propTypes.js");
|
|
19
|
+
|
|
20
|
+
var _react = require("react");
|
|
21
|
+
|
|
22
|
+
var _formatMessage = _interopRequireDefault(require("@instructure/quiz-i18n/es/format-message"));
|
|
23
|
+
|
|
24
|
+
var _uiTable = require("@instructure/ui-table");
|
|
25
|
+
|
|
26
|
+
var _propTypes2 = _interopRequireDefault(require("prop-types"));
|
|
27
|
+
|
|
28
|
+
var _emotion = require("@instructure/emotion");
|
|
29
|
+
|
|
30
|
+
var _styles = _interopRequireDefault(require("./styles.js"));
|
|
31
|
+
|
|
32
|
+
var _theme = _interopRequireDefault(require("./theme.js"));
|
|
33
|
+
|
|
34
|
+
var _dec, _class, _class2, _temp;
|
|
35
|
+
|
|
36
|
+
var ScoreDistributionTypeTable = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
37
|
+
(0, _inherits2.default)(ScoreDistributionTypeTable, _Component);
|
|
38
|
+
|
|
39
|
+
var _super = (0, _createSuper2.default)(ScoreDistributionTypeTable);
|
|
40
|
+
|
|
41
|
+
function ScoreDistributionTypeTable() {
|
|
42
|
+
var _this;
|
|
43
|
+
|
|
44
|
+
(0, _classCallCheck2.default)(this, ScoreDistributionTypeTable);
|
|
45
|
+
|
|
46
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
47
|
+
args[_key] = arguments[_key];
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
51
|
+
|
|
52
|
+
_this.renderFirstCell = function (content) {
|
|
53
|
+
return (0, _emotion.jsx)("div", {
|
|
54
|
+
css: _this.props.styles.firstTextContainer
|
|
55
|
+
}, content);
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
_this.renderCell = function (content) {
|
|
59
|
+
return (0, _emotion.jsx)("div", {
|
|
60
|
+
css: _this.props.styles.textContainer
|
|
61
|
+
}, content);
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
_this.renderRow = function (choice, choiceIndex) {
|
|
65
|
+
var count = choice.count,
|
|
66
|
+
score = choice.score,
|
|
67
|
+
percentage = choice.percentage;
|
|
68
|
+
return (0, _emotion.jsx)(_uiTable.Table.Row, {
|
|
69
|
+
key: choiceIndex
|
|
70
|
+
}, (0, _emotion.jsx)(_uiTable.Table.Cell, {
|
|
71
|
+
themeOverride: {
|
|
72
|
+
padding: '0'
|
|
73
|
+
}
|
|
74
|
+
}, _this.renderFirstCell(score)), (0, _emotion.jsx)(_uiTable.Table.Cell, {
|
|
75
|
+
themeOverride: {
|
|
76
|
+
padding: '0'
|
|
77
|
+
}
|
|
78
|
+
}, _this.renderCell(count)), (0, _emotion.jsx)(_uiTable.Table.Cell, {
|
|
79
|
+
themeOverride: {
|
|
80
|
+
padding: '0'
|
|
81
|
+
},
|
|
82
|
+
textAlign: "center"
|
|
83
|
+
}, _this.renderCell("".concat(percentage, "%"))));
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
return _this;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
(0, _createClass2.default)(ScoreDistributionTypeTable, [{
|
|
90
|
+
key: "componentDidMount",
|
|
91
|
+
value: function componentDidMount() {
|
|
92
|
+
this.props.makeStyles();
|
|
93
|
+
}
|
|
94
|
+
}, {
|
|
95
|
+
key: "componentDidUpdate",
|
|
96
|
+
value: function componentDidUpdate() {
|
|
97
|
+
this.props.makeStyles();
|
|
98
|
+
}
|
|
99
|
+
}, {
|
|
100
|
+
key: "render",
|
|
101
|
+
value: function render() {
|
|
102
|
+
var _this$props = this.props,
|
|
103
|
+
scores = _this$props.scores,
|
|
104
|
+
itemId = _this$props.itemId,
|
|
105
|
+
styles = _this$props.styles;
|
|
106
|
+
var pointsHeaderId = "answer-frequency-summary-points-".concat(itemId);
|
|
107
|
+
var respondentsHeaderId = "answer-frequency-summary-respondents-".concat(itemId);
|
|
108
|
+
var percentageHeaderId = "answer-frequency-summary-percentage-".concat(itemId);
|
|
109
|
+
return (0, _emotion.jsx)("div", {
|
|
110
|
+
css: styles.tableContainer
|
|
111
|
+
}, (0, _emotion.jsx)(_uiTable.Table, {
|
|
112
|
+
caption: (0, _formatMessage.default)('Score Frequency Summary'),
|
|
113
|
+
elementRef: this.setTableRef
|
|
114
|
+
}, (0, _emotion.jsx)(_uiTable.Table.Head, null, (0, _emotion.jsx)(_uiTable.Table.Row, null, (0, _emotion.jsx)(_uiTable.Table.ColHeader, {
|
|
115
|
+
id: pointsHeaderId,
|
|
116
|
+
height: "47px"
|
|
117
|
+
}, (0, _formatMessage.default)('Points')), (0, _emotion.jsx)(_uiTable.Table.ColHeader, {
|
|
118
|
+
id: respondentsHeaderId,
|
|
119
|
+
height: "47px",
|
|
120
|
+
textAlign: "center"
|
|
121
|
+
}, (0, _formatMessage.default)('Respondents')), (0, _emotion.jsx)(_uiTable.Table.ColHeader, {
|
|
122
|
+
id: percentageHeaderId,
|
|
123
|
+
height: "47px",
|
|
124
|
+
textAlign: "center"
|
|
125
|
+
}, (0, _formatMessage.default)('%')))), (0, _emotion.jsx)(_uiTable.Table.Body, null, scores.map(this.renderRow))));
|
|
126
|
+
}
|
|
127
|
+
}]);
|
|
128
|
+
ScoreDistributionTypeTable.displayName = "ScoreDistributionTypeTable";
|
|
129
|
+
return ScoreDistributionTypeTable;
|
|
130
|
+
}(_react.Component), _class2.propTypes = {
|
|
131
|
+
itemId: _propTypes2.default.number.isRequired,
|
|
132
|
+
scores: _propTypes2.default.arrayOf(_propTypes.scoreDistributionType).isRequired,
|
|
133
|
+
// eslint-disable-next-line react/require-default-props
|
|
134
|
+
makeStyles: _propTypes2.default.func,
|
|
135
|
+
// eslint-disable-next-line react/require-default-props,react/forbid-prop-types
|
|
136
|
+
styles: _propTypes2.default.object
|
|
137
|
+
}, _temp)) || _class);
|
|
138
|
+
exports.ScoreDistributionTypeTable = ScoreDistributionTypeTable;
|
|
139
|
+
var _default = ScoreDistributionTypeTable;
|
|
140
|
+
exports.default = _default;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var generateStyle = function generateStyle(componentTheme) {
|
|
9
|
+
var borderBottom = "solid 0.0625rem ".concat(componentTheme.colorGray);
|
|
10
|
+
return {
|
|
11
|
+
tableContainer: {
|
|
12
|
+
width: 'calc(25% + 350px)',
|
|
13
|
+
maxWidth: '100%',
|
|
14
|
+
'& table': {
|
|
15
|
+
borderCollapse: 'separate',
|
|
16
|
+
borderSpacing: '0 1px',
|
|
17
|
+
'& thead tr': {
|
|
18
|
+
'& th, & td': {
|
|
19
|
+
borderBottom: borderBottom
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
'& tbody tr': {
|
|
23
|
+
'& th, & td': {
|
|
24
|
+
width: '33.33%',
|
|
25
|
+
borderBottom: borderBottom
|
|
26
|
+
},
|
|
27
|
+
'& th': {
|
|
28
|
+
fontWeight: 400
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
textContainer: {
|
|
34
|
+
height: 'calc(100% - 4px)',
|
|
35
|
+
display: 'flex',
|
|
36
|
+
alignItems: 'center',
|
|
37
|
+
justifyContent: 'center'
|
|
38
|
+
},
|
|
39
|
+
firstTextContainer: {
|
|
40
|
+
padding: componentTheme.cellPadding
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
var _default = generateStyle;
|
|
46
|
+
exports.default = _default;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
9
|
+
var spacing = _ref.spacing,
|
|
10
|
+
colors = _ref.colors;
|
|
11
|
+
return {
|
|
12
|
+
tableBottomPadding: spacing === null || spacing === void 0 ? void 0 : spacing.medium,
|
|
13
|
+
colorGray: colors === null || colors === void 0 ? void 0 : colors.tiara,
|
|
14
|
+
cellPadding: "".concat(spacing === null || spacing === void 0 ? void 0 : spacing.small, " ").concat(spacing === null || spacing === void 0 ? void 0 : spacing.small)
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
var _default = generateComponentTheme;
|
|
19
|
+
exports.default = _default;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
4
|
+
|
|
5
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
exports.default = exports.ScoreDistributionType = void 0;
|
|
11
|
+
|
|
12
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
13
|
+
|
|
14
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
15
|
+
|
|
16
|
+
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
|
|
17
|
+
|
|
18
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
19
|
+
|
|
20
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
21
|
+
|
|
22
|
+
var _index = _interopRequireDefault(require("./Table/index.js"));
|
|
23
|
+
|
|
24
|
+
var _propTypes2 = require("../../propTypes.js");
|
|
25
|
+
|
|
26
|
+
var _index2 = _interopRequireDefault(require("../shared/AggregationTable/index.js"));
|
|
27
|
+
|
|
28
|
+
var _presenter = require("../shared/AfsPartsContainer/presenter.js");
|
|
29
|
+
|
|
30
|
+
var _index3 = _interopRequireDefault(require("../shared/AfsTableWrapper/index.js"));
|
|
31
|
+
|
|
32
|
+
var _formatMessage = _interopRequireDefault(require("@instructure/quiz-i18n/es/format-message"));
|
|
33
|
+
|
|
34
|
+
var ScoreDistributionType = /*#__PURE__*/function (_Component) {
|
|
35
|
+
(0, _inherits2.default)(ScoreDistributionType, _Component);
|
|
36
|
+
|
|
37
|
+
var _super = (0, _createSuper2.default)(ScoreDistributionType);
|
|
38
|
+
|
|
39
|
+
function ScoreDistributionType() {
|
|
40
|
+
var _this;
|
|
41
|
+
|
|
42
|
+
(0, _classCallCheck2.default)(this, ScoreDistributionType);
|
|
43
|
+
|
|
44
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
45
|
+
args[_key] = arguments[_key];
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
49
|
+
|
|
50
|
+
_this.render = function () {
|
|
51
|
+
var _this$props = _this.props,
|
|
52
|
+
answerSummary = _this$props.answerSummary,
|
|
53
|
+
itemId = _this$props.itemId;
|
|
54
|
+
return /*#__PURE__*/_react.default.createElement(_index3.default, {
|
|
55
|
+
tableHeader: (0, _formatMessage.default)('Score Frequency Summary')
|
|
56
|
+
}, /*#__PURE__*/_react.default.createElement(_presenter.AfsPartsContainer, {
|
|
57
|
+
afsTable: /*#__PURE__*/_react.default.createElement(_index.default, {
|
|
58
|
+
itemId: itemId,
|
|
59
|
+
scores: answerSummary.score_distribution
|
|
60
|
+
}),
|
|
61
|
+
aggregationTable: /*#__PURE__*/_react.default.createElement(_index2.default, {
|
|
62
|
+
itemId: itemId,
|
|
63
|
+
answerSummary: answerSummary
|
|
64
|
+
})
|
|
65
|
+
}));
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
return _this;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
return ScoreDistributionType;
|
|
72
|
+
}(_react.Component);
|
|
73
|
+
|
|
74
|
+
exports.ScoreDistributionType = ScoreDistributionType;
|
|
75
|
+
ScoreDistributionType.propTypes = {
|
|
76
|
+
itemId: _propTypes.default.number,
|
|
77
|
+
answerSummary: _propTypes2.scoreDistributionTypeAnswerSummaryPropType
|
|
78
|
+
}.isRequired;
|
|
79
|
+
var _default = ScoreDistributionType;
|
|
80
|
+
exports.default = _default;
|
|
@@ -27,7 +27,11 @@ var _index3 = _interopRequireDefault(require("./RichFillBlankType/index.js"));
|
|
|
27
27
|
|
|
28
28
|
var _index4 = _interopRequireDefault(require("./AggregationType/index.js"));
|
|
29
29
|
|
|
30
|
-
var _index5 = require("./
|
|
30
|
+
var _index5 = _interopRequireDefault(require("./NumericType/index.js"));
|
|
31
|
+
|
|
32
|
+
var _index6 = require("./MatchingType/index.js");
|
|
33
|
+
|
|
34
|
+
var _index7 = require("./ScoreDistributionType/index.js");
|
|
31
35
|
|
|
32
36
|
var _propTypes = require("../propTypes.js");
|
|
33
37
|
|
|
@@ -58,15 +62,15 @@ var AnswerFrequencySummary = /*#__PURE__*/function (_Component) {
|
|
|
58
62
|
}
|
|
59
63
|
|
|
60
64
|
if (afsFlags.matchingEnabled) {
|
|
61
|
-
_this.afsTableComponentMap.set('matching',
|
|
65
|
+
_this.afsTableComponentMap.set('matching', _index6.MatchingType);
|
|
62
66
|
}
|
|
63
67
|
|
|
64
68
|
if (afsFlags.orderingEnabled) {
|
|
65
|
-
_this.afsTableComponentMap.set('ordering',
|
|
69
|
+
_this.afsTableComponentMap.set('ordering', _index6.OrderingType);
|
|
66
70
|
}
|
|
67
71
|
|
|
68
72
|
if (afsFlags.categorizationEnabled) {
|
|
69
|
-
_this.afsTableComponentMap.set('categorization',
|
|
73
|
+
_this.afsTableComponentMap.set('categorization', _index6.CategorizationType);
|
|
70
74
|
}
|
|
71
75
|
|
|
72
76
|
if (afsFlags.trueFalseEnabled) {
|
|
@@ -84,6 +88,18 @@ var AnswerFrequencySummary = /*#__PURE__*/function (_Component) {
|
|
|
84
88
|
if (afsFlags.fillInTheBlankEnabled) {
|
|
85
89
|
_this.afsTableComponentMap.set('rich-fill-blank', _index3.default);
|
|
86
90
|
}
|
|
91
|
+
|
|
92
|
+
if (afsFlags.numericEnabled) {
|
|
93
|
+
_this.afsTableComponentMap.set('numeric', _index5.default);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
if (afsFlags.essayEnabled) {
|
|
97
|
+
_this.afsTableComponentMap.set('essay', _index7.ScoreDistributionType);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
if (afsFlags.fileUploadEnabled) {
|
|
101
|
+
_this.afsTableComponentMap.set('file-upload', _index7.ScoreDistributionType);
|
|
102
|
+
}
|
|
87
103
|
};
|
|
88
104
|
|
|
89
105
|
_this.render = function () {
|
|
@@ -45,6 +45,11 @@ var AfsTableWrapper = (_dec = (0, _emotion.withStyle)(_styles.default, null), _d
|
|
|
45
45
|
|
|
46
46
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
47
47
|
|
|
48
|
+
_this.getHeader = function () {
|
|
49
|
+
var tableHeader = _this.props.tableHeader;
|
|
50
|
+
return tableHeader || (0, _formatMessage.default)('Answer Frequency Summary');
|
|
51
|
+
};
|
|
52
|
+
|
|
48
53
|
_this.render = function () {
|
|
49
54
|
return (0, _emotion.jsx)(_uiFlex.Flex, {
|
|
50
55
|
direction: "row",
|
|
@@ -58,7 +63,7 @@ var AfsTableWrapper = (_dec = (0, _emotion.withStyle)(_styles.default, null), _d
|
|
|
58
63
|
level: "h3",
|
|
59
64
|
weight: "bold",
|
|
60
65
|
color: "primary"
|
|
61
|
-
},
|
|
66
|
+
}, _this.getHeader()), _this.props.children)));
|
|
62
67
|
};
|
|
63
68
|
|
|
64
69
|
return _this;
|
|
@@ -67,6 +72,7 @@ var AfsTableWrapper = (_dec = (0, _emotion.withStyle)(_styles.default, null), _d
|
|
|
67
72
|
return AfsTableWrapper;
|
|
68
73
|
}(_react.Component), _class2.propTypes = {
|
|
69
74
|
children: _propTypes.default.node.isRequired,
|
|
70
|
-
styles: _propTypes.default.object
|
|
75
|
+
styles: _propTypes.default.object,
|
|
76
|
+
tableHeader: _propTypes.default.string
|
|
71
77
|
}, _temp)) || _class);
|
|
72
78
|
exports.AfsTableWrapper = AfsTableWrapper;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "default", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function get() {
|
|
9
|
+
return _presenter.ExpandableCard;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
var _presenter = require("./presenter.js");
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.ExpandableCard = void 0;
|
|
9
|
+
|
|
10
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
+
|
|
12
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
13
|
+
|
|
14
|
+
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
|
|
15
|
+
|
|
16
|
+
var _react = require("react");
|
|
17
|
+
|
|
18
|
+
var _index = _interopRequireDefault(require("../../../../../../../common/components/shared/Card/index.js"));
|
|
19
|
+
|
|
20
|
+
var _uiFlex = require("@instructure/ui-flex");
|
|
21
|
+
|
|
22
|
+
var _emotion = require("@instructure/emotion");
|
|
23
|
+
|
|
24
|
+
var _index2 = _interopRequireDefault(require("../../../../../../../common/components/shared/ExpandButton/index.js"));
|
|
25
|
+
|
|
26
|
+
var _formatMessage = _interopRequireDefault(require("@instructure/quiz-i18n/es/format-message"));
|
|
27
|
+
|
|
28
|
+
var _styles = _interopRequireDefault(require("./styles.js"));
|
|
29
|
+
|
|
30
|
+
var _theme = _interopRequireDefault(require("./theme.js"));
|
|
31
|
+
|
|
32
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
33
|
+
|
|
34
|
+
var _dec, _class, _class2, _temp;
|
|
35
|
+
|
|
36
|
+
var ExpandableCard = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
37
|
+
(0, _inherits2.default)(ExpandableCard, _Component);
|
|
38
|
+
|
|
39
|
+
var _super = (0, _createSuper2.default)(ExpandableCard);
|
|
40
|
+
|
|
41
|
+
function ExpandableCard() {
|
|
42
|
+
var _this;
|
|
43
|
+
|
|
44
|
+
(0, _classCallCheck2.default)(this, ExpandableCard);
|
|
45
|
+
|
|
46
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
47
|
+
args[_key] = arguments[_key];
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
51
|
+
_this.state = {
|
|
52
|
+
bodyExpanded: false
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
_this.handleBodyToggle = function () {
|
|
56
|
+
_this.setState({
|
|
57
|
+
bodyExpanded: !_this.state.bodyExpanded
|
|
58
|
+
});
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
_this.renderGroup = function () {
|
|
62
|
+
var headLine = _this.props.headLine;
|
|
63
|
+
return (0, _emotion.jsx)(_uiFlex.Flex, {
|
|
64
|
+
direction: "row",
|
|
65
|
+
alignItems: "start"
|
|
66
|
+
}, (0, _emotion.jsx)(_uiFlex.Flex.Item, {
|
|
67
|
+
shouldShrink: true,
|
|
68
|
+
shouldGrow: true,
|
|
69
|
+
margin: "xx-small none none none"
|
|
70
|
+
}, headLine), (0, _emotion.jsx)(_uiFlex.Flex.Item, {
|
|
71
|
+
margin: "none none none x-small"
|
|
72
|
+
}, (0, _emotion.jsx)(_index2.default, {
|
|
73
|
+
onClick: _this.handleBodyToggle,
|
|
74
|
+
title: _this.state.bodyExpanded ? (0, _formatMessage.default)('collapse group result') : (0, _formatMessage.default)('expand group result'),
|
|
75
|
+
isExpanded: _this.state.bodyExpanded
|
|
76
|
+
})));
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
_this.renderBody = function () {
|
|
80
|
+
var _this$props = _this.props,
|
|
81
|
+
content = _this$props.content,
|
|
82
|
+
styles = _this$props.styles;
|
|
83
|
+
var bodyContainer = styles.bodyContainer;
|
|
84
|
+
return (0, _emotion.jsx)(_uiFlex.Flex.Item, {
|
|
85
|
+
shouldShrink: true,
|
|
86
|
+
padding: "x-small small x-small small"
|
|
87
|
+
}, (0, _emotion.jsx)("div", {
|
|
88
|
+
css: bodyContainer
|
|
89
|
+
}, content));
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
_this.render = function () {
|
|
93
|
+
var styles = _this.props.styles;
|
|
94
|
+
var groupWrapper = styles.groupWrapper;
|
|
95
|
+
var bodyExpanded = _this.state.bodyExpanded;
|
|
96
|
+
return (0, _emotion.jsx)("div", {
|
|
97
|
+
css: groupWrapper
|
|
98
|
+
}, (0, _emotion.jsx)(_index.default, null, (0, _emotion.jsx)(_uiFlex.Flex, {
|
|
99
|
+
direction: "column",
|
|
100
|
+
justifyItems: "start"
|
|
101
|
+
}, (0, _emotion.jsx)(_uiFlex.Flex.Item, {
|
|
102
|
+
shouldGrow: true,
|
|
103
|
+
shouldShrink: true,
|
|
104
|
+
overflowY: "visible"
|
|
105
|
+
}, (0, _emotion.jsx)(_uiFlex.Flex, {
|
|
106
|
+
direction: "column",
|
|
107
|
+
justifyItems: "start"
|
|
108
|
+
}, (0, _emotion.jsx)(_uiFlex.Flex.Item, {
|
|
109
|
+
shouldShrink: true,
|
|
110
|
+
padding: "x-small small x-small small",
|
|
111
|
+
overflowY: "hidden"
|
|
112
|
+
}, _this.renderGroup()), bodyExpanded && _this.renderBody())))));
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
return _this;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
return ExpandableCard;
|
|
119
|
+
}(_react.Component), _class2.propTypes = {
|
|
120
|
+
headLine: _propTypes.default.node,
|
|
121
|
+
content: _propTypes.default.node,
|
|
122
|
+
styles: _propTypes.default.object
|
|
123
|
+
}.isRequired, _temp)) || _class);
|
|
124
|
+
exports.ExpandableCard = ExpandableCard;
|
|
@@ -13,8 +13,9 @@ var generateStyle = function generateStyle(componentTheme) {
|
|
|
13
13
|
minWidth: componentTheme.cardMinWidth,
|
|
14
14
|
maxWidth: '100%'
|
|
15
15
|
},
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
bodyContainer: {
|
|
17
|
+
overflow: 'auto',
|
|
18
|
+
maxHeight: '600px'
|
|
18
19
|
}
|
|
19
20
|
};
|
|
20
21
|
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var generateComponentTheme = function generateComponentTheme() {
|
|
9
|
+
return {
|
|
10
|
+
cardMinWidth: '500px'
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
var _default = generateComponentTheme;
|
|
15
|
+
exports.default = _default;
|
|
@@ -22,7 +22,10 @@ function mapStateToProps(_state) {
|
|
|
22
22
|
trueFalseEnabled: (0, _featureCheck.featureOn)('ia_true_false_afs'),
|
|
23
23
|
choiceEnabled: (0, _featureCheck.featureOn)('ia_choice_afs'),
|
|
24
24
|
multiAnswerEnabled: (0, _featureCheck.featureOn)('ia_multi_answer_afs'),
|
|
25
|
-
fillInTheBlankEnabled: (0, _featureCheck.featureOn)('ia_rich_fill_blank_afs')
|
|
25
|
+
fillInTheBlankEnabled: (0, _featureCheck.featureOn)('ia_rich_fill_blank_afs'),
|
|
26
|
+
essayEnabled: (0, _featureCheck.featureOn)('ia_essay_afs'),
|
|
27
|
+
fileUploadEnabled: (0, _featureCheck.featureOn)('ia_file_upload_afs'),
|
|
28
|
+
numericEnabled: (0, _featureCheck.featureOn)('ia_numeric_afs')
|
|
26
29
|
}
|
|
27
30
|
};
|
|
28
31
|
}
|
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.afsFlags = exports.itemAnalysisPropType = exports.answerSummaryPropType = exports.richFillBlankTypeAnswerSummaryPropType = exports.matchingTypeAnswerSummaryPropType = exports.choiceTypeAnswerSummaryPropType = exports.choiceTypeObject = exports.onlyAggregatePropType = exports.aggregatePropType = exports.aggregateDetailPropType = exports.quizAnalysisPropType = exports.quizAnalysisMetadata = void 0;
|
|
8
|
+
exports.afsFlags = exports.itemAnalysisPropType = exports.answerSummaryPropType = exports.numericTypeAnswerSummaryPropType = exports.richFillBlankTypeAnswerSummaryPropType = exports.matchingTypeAnswerSummaryPropType = exports.scoreDistributionType = exports.scoreDistributionTypeAnswerSummaryPropType = exports.choiceTypeAnswerSummaryPropType = exports.choiceTypeObject = exports.onlyAggregatePropType = exports.aggregatePropType = exports.aggregateDetailPropType = exports.quizAnalysisPropType = exports.quizAnalysisMetadata = void 0;
|
|
9
9
|
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
11
|
|
|
@@ -81,6 +81,23 @@ var choiceTypeAnswerSummaryPropType = _propTypes.default.shape({
|
|
|
81
81
|
|
|
82
82
|
exports.choiceTypeAnswerSummaryPropType = choiceTypeAnswerSummaryPropType;
|
|
83
83
|
|
|
84
|
+
var scoreDistributionTypeAnswerSummaryPropType = _propTypes.default.shape({
|
|
85
|
+
no_answer: aggregateDetailPropType.isRequired,
|
|
86
|
+
aggregate: aggregatePropType.isRequired,
|
|
87
|
+
graded: aggregateDetailPropType.isRequired,
|
|
88
|
+
score_distribution: _propTypes.default.arrayOf(scoreDistributionType).isRequired
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
exports.scoreDistributionTypeAnswerSummaryPropType = scoreDistributionTypeAnswerSummaryPropType;
|
|
92
|
+
|
|
93
|
+
var scoreDistributionType = _propTypes.default.shape({
|
|
94
|
+
count: _propTypes.default.number.isRequired,
|
|
95
|
+
score: _propTypes.default.number.isRequired,
|
|
96
|
+
percentage: _propTypes.default.number.isRequired
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
exports.scoreDistributionType = scoreDistributionType;
|
|
100
|
+
|
|
84
101
|
var matchingTypeAnswerSummaryPropType = _propTypes.default.shape({
|
|
85
102
|
questions: _propTypes.default.objectOf(_propTypes.default.shape({
|
|
86
103
|
body: _propTypes.default.string,
|
|
@@ -114,7 +131,52 @@ var richFillBlankTypeAnswerSummaryPropType = _propTypes.default.shape({
|
|
|
114
131
|
|
|
115
132
|
exports.richFillBlankTypeAnswerSummaryPropType = richFillBlankTypeAnswerSummaryPropType;
|
|
116
133
|
|
|
117
|
-
var
|
|
134
|
+
var withinARangeTypeObject = _propTypes.default.shape({
|
|
135
|
+
end: _propTypes.default.string.isRequired,
|
|
136
|
+
start: _propTypes.default.string.isRequired,
|
|
137
|
+
choices: _propTypes.default.arrayOf(choiceTypeObject).isRequired,
|
|
138
|
+
type: _propTypes.default.string.isRequired
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
var marginOfErrorTypeObject = _propTypes.default.shape({
|
|
142
|
+
margin: _propTypes.default.string.isRequired,
|
|
143
|
+
margin_type: _propTypes.default.string.isRequired,
|
|
144
|
+
value: _propTypes.default.string.isRequired,
|
|
145
|
+
type: _propTypes.default.string.isRequired,
|
|
146
|
+
choices: _propTypes.default.arrayOf(choiceTypeObject).isRequired
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
var exactResponseTypeObject = _propTypes.default.shape({
|
|
150
|
+
value: _propTypes.default.string.isRequired,
|
|
151
|
+
type: _propTypes.default.string.isRequired,
|
|
152
|
+
choices: _propTypes.default.arrayOf(choiceTypeObject).isRequired
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
var preciseResponseTypeObject = _propTypes.default.shape({
|
|
156
|
+
value: _propTypes.default.string.isRequired,
|
|
157
|
+
precision: _propTypes.default.string.isRequired,
|
|
158
|
+
precision_type: _propTypes.default.string.isRequired,
|
|
159
|
+
type: _propTypes.default.string.isRequired,
|
|
160
|
+
choices: _propTypes.default.arrayOf(choiceTypeObject).isRequired
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
var uncategorizedTypeObject = _propTypes.default.shape({
|
|
164
|
+
type: _propTypes.default.string.isRequired,
|
|
165
|
+
choices: _propTypes.default.arrayOf(choiceTypeObject).isRequired
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
var numericRequirementTypeObject = _propTypes.default.oneOfType([withinARangeTypeObject, marginOfErrorTypeObject, exactResponseTypeObject, preciseResponseTypeObject, uncategorizedTypeObject]);
|
|
169
|
+
|
|
170
|
+
var numericTypeAnswerSummaryPropType = _propTypes.default.shape({
|
|
171
|
+
requirement: _propTypes.default.shape({
|
|
172
|
+
correct_answers: _propTypes.default.arrayOf(numericRequirementTypeObject).isRequired,
|
|
173
|
+
incorrect_answer_choices: _propTypes.default.arrayOf(choiceTypeObject).isRequired
|
|
174
|
+
})
|
|
175
|
+
});
|
|
176
|
+
|
|
177
|
+
exports.numericTypeAnswerSummaryPropType = numericTypeAnswerSummaryPropType;
|
|
178
|
+
|
|
179
|
+
var answerSummaryPropType = _propTypes.default.oneOfType([choiceTypeAnswerSummaryPropType, onlyAggregatePropType, matchingTypeAnswerSummaryPropType, richFillBlankTypeAnswerSummaryPropType, scoreDistributionTypeAnswerSummaryPropType]);
|
|
118
180
|
|
|
119
181
|
exports.answerSummaryPropType = answerSummaryPropType;
|
|
120
182
|
|
|
@@ -152,7 +214,10 @@ var afsFlags = _propTypes.default.shape({
|
|
|
152
214
|
trueFalseEnabled: _propTypes.default.bool.isRequired,
|
|
153
215
|
choiceEnabled: _propTypes.default.bool.isRequired,
|
|
154
216
|
multiAnswerEnabled: _propTypes.default.bool.isRequired,
|
|
155
|
-
fillInTheBlankEnabled: _propTypes.default.bool.isRequired
|
|
217
|
+
fillInTheBlankEnabled: _propTypes.default.bool.isRequired,
|
|
218
|
+
numericEnabled: _propTypes.default.bool.isRequired,
|
|
219
|
+
essayEnabled: _propTypes.default.bool.isRequired,
|
|
220
|
+
fileUploadEnabled: _propTypes.default.bool.isRequired
|
|
156
221
|
});
|
|
157
222
|
|
|
158
223
|
exports.afsFlags = afsFlags;
|