@instructure/quiz-core 20.7.1-rc.7 → 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/AggregationTable/presenter.js +34 -39
- 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 +54 -4
- 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/AggregationTable/presenter.js +33 -38
- 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 +70 -5
- 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,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.ChoiceTypeWithInfo;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
var _presenter = require("./presenter.js");
|
|
@@ -0,0 +1,113 @@
|
|
|
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.ChoiceTypeWithInfo = 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 _propTypes2 = require("../../../propTypes.js");
|
|
23
|
+
|
|
24
|
+
var _uiFlex = require("@instructure/ui-flex");
|
|
25
|
+
|
|
26
|
+
var _index = _interopRequireDefault(require("../../shared/ChoiceTypeTable/index.js"));
|
|
27
|
+
|
|
28
|
+
var _uiText = require("@instructure/ui-text");
|
|
29
|
+
|
|
30
|
+
var _formatMessage = _interopRequireDefault(require("@instructure/quiz-i18n/es/format-message"));
|
|
31
|
+
|
|
32
|
+
var ChoiceTypeWithInfo = /*#__PURE__*/function (_Component) {
|
|
33
|
+
(0, _inherits2.default)(ChoiceTypeWithInfo, _Component);
|
|
34
|
+
|
|
35
|
+
var _super = (0, _createSuper2.default)(ChoiceTypeWithInfo);
|
|
36
|
+
|
|
37
|
+
function ChoiceTypeWithInfo() {
|
|
38
|
+
var _this;
|
|
39
|
+
|
|
40
|
+
(0, _classCallCheck2.default)(this, ChoiceTypeWithInfo);
|
|
41
|
+
|
|
42
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
43
|
+
args[_key] = arguments[_key];
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
47
|
+
|
|
48
|
+
_this.renderTable = function () {
|
|
49
|
+
var _this$props = _this.props,
|
|
50
|
+
itemId = _this$props.itemId,
|
|
51
|
+
choices = _this$props.choices,
|
|
52
|
+
index = _this$props.index;
|
|
53
|
+
var tableId = "".concat(itemId, "_").concat(index, "_choiceGroup");
|
|
54
|
+
var tableContainerSizeClass = '';
|
|
55
|
+
return /*#__PURE__*/_react.default.createElement(_index.default, {
|
|
56
|
+
itemId: tableId,
|
|
57
|
+
choices: choices,
|
|
58
|
+
tableContainerSizeClass: tableContainerSizeClass
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
_this.renderEmptyRequirement = function () {
|
|
63
|
+
return /*#__PURE__*/_react.default.createElement(_uiFlex.Flex, null, /*#__PURE__*/_react.default.createElement(_uiFlex.Flex.Item, {
|
|
64
|
+
padding: "medium none none none"
|
|
65
|
+
}, /*#__PURE__*/_react.default.createElement(_uiText.Text, null, (0, _formatMessage.default)('There are no entries for this requirement.'))));
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
_this.render = function () {
|
|
69
|
+
var _this$props2 = _this.props,
|
|
70
|
+
headLine = _this$props2.headLine,
|
|
71
|
+
choices = _this$props2.choices;
|
|
72
|
+
var areThereChoices = Array.isArray(choices) && choices.length > 0;
|
|
73
|
+
return /*#__PURE__*/_react.default.createElement(_uiFlex.Flex, {
|
|
74
|
+
direction: "column",
|
|
75
|
+
justifyItems: "start"
|
|
76
|
+
}, /*#__PURE__*/_react.default.createElement(_uiFlex.Flex.Item, {
|
|
77
|
+
overflowY: "visible",
|
|
78
|
+
shouldGrow: true,
|
|
79
|
+
shouldShrink: true
|
|
80
|
+
}, /*#__PURE__*/_react.default.createElement(_uiFlex.Flex, {
|
|
81
|
+
direction: "column",
|
|
82
|
+
justifyItems: "start"
|
|
83
|
+
}, /*#__PURE__*/_react.default.createElement(_uiFlex.Flex.Item, {
|
|
84
|
+
shouldShrink: true,
|
|
85
|
+
padding: "none none none none",
|
|
86
|
+
overflowY: "hidden"
|
|
87
|
+
}, /*#__PURE__*/_react.default.createElement(_uiFlex.Flex, {
|
|
88
|
+
direction: "row",
|
|
89
|
+
alignItems: "start"
|
|
90
|
+
}, /*#__PURE__*/_react.default.createElement(_uiFlex.Flex.Item, {
|
|
91
|
+
shouldShrink: true,
|
|
92
|
+
shouldGrow: true,
|
|
93
|
+
margin: "none none none none"
|
|
94
|
+
}, headLine))), /*#__PURE__*/_react.default.createElement(_uiFlex.Flex.Item, {
|
|
95
|
+
shouldShrink: true,
|
|
96
|
+
padding: "none none medium none"
|
|
97
|
+
}, areThereChoices ? _this.renderTable() : _this.renderEmptyRequirement()))));
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
return _this;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
return ChoiceTypeWithInfo;
|
|
104
|
+
}(_react.Component);
|
|
105
|
+
|
|
106
|
+
exports.ChoiceTypeWithInfo = ChoiceTypeWithInfo;
|
|
107
|
+
ChoiceTypeWithInfo.propTypes = {
|
|
108
|
+
itemId: _propTypes.default.number.isRequired,
|
|
109
|
+
index: _propTypes.default.number.isRequired,
|
|
110
|
+
choices: _propTypes2.choiceTypeObject.isRequired,
|
|
111
|
+
headLine: _propTypes.default.node,
|
|
112
|
+
styles: _propTypes.default.object
|
|
113
|
+
}.isRequired;
|
|
@@ -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.NumericType;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
var _presenter = require("./presenter.js");
|
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.NumericType = 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 _propTypes = _interopRequireDefault(require("prop-types"));
|
|
19
|
+
|
|
20
|
+
var _index = _interopRequireDefault(require("../shared/AfsTableWrapper/index.js"));
|
|
21
|
+
|
|
22
|
+
var _presenter = require("../shared/AfsPartsContainer/presenter.js");
|
|
23
|
+
|
|
24
|
+
var _index2 = _interopRequireDefault(require("../shared/AggregationTable/index.js"));
|
|
25
|
+
|
|
26
|
+
var _index3 = _interopRequireDefault(require("../shared/ExpandableCard/index.js"));
|
|
27
|
+
|
|
28
|
+
var _uiText = require("@instructure/ui-text");
|
|
29
|
+
|
|
30
|
+
var _formatMessage = _interopRequireDefault(require("@instructure/quiz-i18n/es/format-message"));
|
|
31
|
+
|
|
32
|
+
var _index4 = _interopRequireDefault(require("../shared/ChoiceTypeTable/index.js"));
|
|
33
|
+
|
|
34
|
+
var _emotion = require("@instructure/emotion");
|
|
35
|
+
|
|
36
|
+
var _index5 = _interopRequireDefault(require("./ChoiceTypeWithInfo/index.js"));
|
|
37
|
+
|
|
38
|
+
var _styles = _interopRequireDefault(require("./styles.js"));
|
|
39
|
+
|
|
40
|
+
var _theme = _interopRequireDefault(require("./theme.js"));
|
|
41
|
+
|
|
42
|
+
var _uiFlex = require("@instructure/ui-flex");
|
|
43
|
+
|
|
44
|
+
var _propTypes2 = require("../../propTypes.js");
|
|
45
|
+
|
|
46
|
+
var _dec, _class, _class2, _temp;
|
|
47
|
+
|
|
48
|
+
var NumericType = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
49
|
+
(0, _inherits2.default)(NumericType, _Component);
|
|
50
|
+
|
|
51
|
+
var _super = (0, _createSuper2.default)(NumericType);
|
|
52
|
+
|
|
53
|
+
function NumericType() {
|
|
54
|
+
var _this;
|
|
55
|
+
|
|
56
|
+
(0, _classCallCheck2.default)(this, NumericType);
|
|
57
|
+
|
|
58
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
59
|
+
args[_key] = arguments[_key];
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
63
|
+
|
|
64
|
+
_this.renderIncorrectTable = function () {
|
|
65
|
+
var _this$props = _this.props,
|
|
66
|
+
itemId = _this$props.itemId,
|
|
67
|
+
answerSummary = _this$props.answerSummary;
|
|
68
|
+
var incorrect_answer_choices = answerSummary.requirements.incorrect_answer_choices;
|
|
69
|
+
var tableId = "".concat(itemId, "_incorrect_choices");
|
|
70
|
+
var tableContainerSizeClass = '';
|
|
71
|
+
return (0, _emotion.jsx)(_index4.default, {
|
|
72
|
+
itemId: tableId,
|
|
73
|
+
choices: incorrect_answer_choices,
|
|
74
|
+
tableContainerSizeClass: tableContainerSizeClass
|
|
75
|
+
});
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
_this.getPreciseTypeTranslatable = function (precisionType) {
|
|
79
|
+
switch (precisionType) {
|
|
80
|
+
case 'significantDigits':
|
|
81
|
+
return (0, _formatMessage.default)('Significant Digits');
|
|
82
|
+
|
|
83
|
+
case 'decimals':
|
|
84
|
+
return (0, _formatMessage.default)('Decimal Places');
|
|
85
|
+
|
|
86
|
+
default:
|
|
87
|
+
return precisionType;
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
_this.renderPreciseResponse = function (correct_answers) {
|
|
92
|
+
var typeString = "".concat((0, _formatMessage.default)('Correct answer'), " - ").concat((0, _formatMessage.default)('Precise Response'), " ");
|
|
93
|
+
var answerString = "".concat((0, _formatMessage.default)('Answer'), ": ").concat(correct_answers.value, " ");
|
|
94
|
+
var precisionString = "".concat((0, _formatMessage.default)('Precision'), ": ").concat(correct_answers.precision, " ");
|
|
95
|
+
|
|
96
|
+
var translatablePrecisionType = _this.getPreciseTypeTranslatable(correct_answers.precision_type);
|
|
97
|
+
|
|
98
|
+
var precisionTypeString = "".concat((0, _formatMessage.default)('Type'), ": ").concat(translatablePrecisionType, " ");
|
|
99
|
+
return (0, _emotion.jsx)("div", {
|
|
100
|
+
css: _this.props.styles.groupAggregationContainer
|
|
101
|
+
}, (0, _emotion.jsx)(_uiText.Text, {
|
|
102
|
+
transform: "capitalize",
|
|
103
|
+
weight: "bold"
|
|
104
|
+
}, typeString), (0, _emotion.jsx)(_uiText.Text, {
|
|
105
|
+
transform: "capitalize"
|
|
106
|
+
}, answerString), (0, _emotion.jsx)(_uiText.Text, {
|
|
107
|
+
transform: "capitalize"
|
|
108
|
+
}, precisionString), (0, _emotion.jsx)(_uiText.Text, {
|
|
109
|
+
transform: "capitalize"
|
|
110
|
+
}, precisionTypeString));
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
_this.getMarginTypeTranslatable = function (marginType) {
|
|
114
|
+
switch (marginType) {
|
|
115
|
+
case 'absolute':
|
|
116
|
+
return (0, _formatMessage.default)('Absolute');
|
|
117
|
+
|
|
118
|
+
case 'percent':
|
|
119
|
+
return (0, _formatMessage.default)('Percent');
|
|
120
|
+
|
|
121
|
+
default:
|
|
122
|
+
return marginType;
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
_this.renderMarginOfError = function (correct_answers) {
|
|
127
|
+
var typeString = "".concat((0, _formatMessage.default)('Correct answer'), " - ").concat((0, _formatMessage.default)('Margin Of Error'), " ");
|
|
128
|
+
var answerString = "".concat((0, _formatMessage.default)('Answer'), ": ").concat(correct_answers.value, " ");
|
|
129
|
+
var marginString = "".concat((0, _formatMessage.default)('+/- margin'), ": ").concat(correct_answers.margin, " ");
|
|
130
|
+
|
|
131
|
+
var translatableMarginType = _this.getMarginTypeTranslatable(correct_answers.margin_type);
|
|
132
|
+
|
|
133
|
+
var marginTypeString = "".concat((0, _formatMessage.default)('Type'), ": ").concat(translatableMarginType, " ");
|
|
134
|
+
return (0, _emotion.jsx)("div", {
|
|
135
|
+
css: _this.props.styles.groupAggregationContainer
|
|
136
|
+
}, (0, _emotion.jsx)(_uiText.Text, {
|
|
137
|
+
transform: "capitalize",
|
|
138
|
+
weight: "bold"
|
|
139
|
+
}, typeString), (0, _emotion.jsx)(_uiText.Text, {
|
|
140
|
+
transform: "capitalize"
|
|
141
|
+
}, answerString), (0, _emotion.jsx)(_uiText.Text, {
|
|
142
|
+
transform: "capitalize"
|
|
143
|
+
}, marginString), (0, _emotion.jsx)(_uiText.Text, {
|
|
144
|
+
transform: "capitalize"
|
|
145
|
+
}, marginTypeString));
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
_this.renderExactResponse = function (correct_answers) {
|
|
149
|
+
var typeString = "".concat((0, _formatMessage.default)('Correct answer'), " - ").concat((0, _formatMessage.default)('Exact Response'), " ");
|
|
150
|
+
var answerString = "".concat((0, _formatMessage.default)('Answer'), ": ").concat(correct_answers.value, " ");
|
|
151
|
+
return (0, _emotion.jsx)("div", {
|
|
152
|
+
css: _this.props.styles.groupAggregationContainer
|
|
153
|
+
}, (0, _emotion.jsx)(_uiText.Text, {
|
|
154
|
+
transform: "capitalize",
|
|
155
|
+
weight: "bold"
|
|
156
|
+
}, typeString), (0, _emotion.jsx)(_uiText.Text, {
|
|
157
|
+
transform: "capitalize"
|
|
158
|
+
}, answerString));
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
_this.renderWithinRange = function (correct_answers) {
|
|
162
|
+
var typeString = "".concat((0, _formatMessage.default)('Correct answer'), " - ").concat((0, _formatMessage.default)('Within A Range'), " ");
|
|
163
|
+
var startString = "".concat((0, _formatMessage.default)('Range Starts'), ": ").concat(correct_answers.start, " ");
|
|
164
|
+
var endString = "".concat((0, _formatMessage.default)('Range Ends'), ": ").concat(correct_answers.end, " ");
|
|
165
|
+
return (0, _emotion.jsx)("div", {
|
|
166
|
+
css: _this.props.styles.groupAggregationContainer
|
|
167
|
+
}, (0, _emotion.jsx)(_uiText.Text, {
|
|
168
|
+
transform: "capitalize",
|
|
169
|
+
weight: "bold"
|
|
170
|
+
}, typeString), (0, _emotion.jsx)(_uiText.Text, {
|
|
171
|
+
transform: "capitalize"
|
|
172
|
+
}, startString), (0, _emotion.jsx)(_uiText.Text, {
|
|
173
|
+
transform: "capitalize"
|
|
174
|
+
}, endString));
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
_this.renderUncategorized = function () {
|
|
178
|
+
var typeString = "".concat((0, _formatMessage.default)('Correct answer'), " - ").concat((0, _formatMessage.default)('Uncategorized'), " ");
|
|
179
|
+
return (0, _emotion.jsx)("div", {
|
|
180
|
+
css: _this.props.styles.groupAggregationContainer
|
|
181
|
+
}, (0, _emotion.jsx)(_uiText.Text, {
|
|
182
|
+
transform: "capitalize",
|
|
183
|
+
weight: "bold"
|
|
184
|
+
}, typeString));
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
_this.getHeadLineByType = function (correct_answer) {
|
|
188
|
+
switch (correct_answer.type) {
|
|
189
|
+
case 'withinARange':
|
|
190
|
+
return _this.renderWithinRange(correct_answer);
|
|
191
|
+
|
|
192
|
+
case 'exactResponse':
|
|
193
|
+
return _this.renderExactResponse(correct_answer);
|
|
194
|
+
|
|
195
|
+
case 'preciseResponse':
|
|
196
|
+
return _this.renderPreciseResponse(correct_answer);
|
|
197
|
+
|
|
198
|
+
case 'marginOfError':
|
|
199
|
+
return _this.renderMarginOfError(correct_answer);
|
|
200
|
+
|
|
201
|
+
default:
|
|
202
|
+
return _this.renderUncategorized();
|
|
203
|
+
}
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
_this.renderChoiceTypeWithInfo = function (correct_answer, index, itemId) {
|
|
207
|
+
var key = "ChoiceTypeWithInfo_".concat(itemId, "_").concat(index);
|
|
208
|
+
return (0, _emotion.jsx)(_index5.default, {
|
|
209
|
+
key: key,
|
|
210
|
+
itemId: itemId,
|
|
211
|
+
choices: correct_answer.choices,
|
|
212
|
+
headLine: _this.getHeadLineByType(correct_answer),
|
|
213
|
+
index: index
|
|
214
|
+
});
|
|
215
|
+
};
|
|
216
|
+
|
|
217
|
+
_this.renderCorrectChoiceTypes = function () {
|
|
218
|
+
var _this$props2 = _this.props,
|
|
219
|
+
itemId = _this$props2.itemId,
|
|
220
|
+
answerSummary = _this$props2.answerSummary;
|
|
221
|
+
var correct_answers = answerSummary.requirements.correct_answers;
|
|
222
|
+
return correct_answers.map(function (correct_answer, index) {
|
|
223
|
+
return _this.renderChoiceTypeWithInfo(correct_answer, index, itemId);
|
|
224
|
+
});
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
_this.renderEmptyIncorrect = function () {
|
|
228
|
+
return (0, _emotion.jsx)(_uiFlex.Flex, null, (0, _emotion.jsx)(_uiFlex.Flex.Item, {
|
|
229
|
+
padding: "small none small none"
|
|
230
|
+
}, (0, _emotion.jsx)(_uiText.Text, null, (0, _formatMessage.default)('There are no incorrect answers.'))));
|
|
231
|
+
};
|
|
232
|
+
|
|
233
|
+
_this.renderEmptyCorrect = function () {
|
|
234
|
+
return (0, _emotion.jsx)(_uiFlex.Flex, null, (0, _emotion.jsx)(_uiFlex.Flex.Item, {
|
|
235
|
+
padding: "small none small none"
|
|
236
|
+
}, (0, _emotion.jsx)(_uiText.Text, null, (0, _formatMessage.default)('There are no correct answers.'))));
|
|
237
|
+
};
|
|
238
|
+
|
|
239
|
+
_this.renderAfsTable = function () {
|
|
240
|
+
var answerSummary = _this.props.answerSummary;
|
|
241
|
+
var _answerSummary$requir = answerSummary.requirements,
|
|
242
|
+
correct_answers = _answerSummary$requir.correct_answers,
|
|
243
|
+
incorrect_answer_choices = _answerSummary$requir.incorrect_answer_choices;
|
|
244
|
+
var areThereIncorrectChoices = Array.isArray(incorrect_answer_choices) && incorrect_answer_choices.length > 0;
|
|
245
|
+
var areThereCorrectAnswers = Array.isArray(correct_answers) && correct_answers.length > 0;
|
|
246
|
+
return (0, _emotion.jsx)("div", null, (0, _emotion.jsx)(_index3.default, {
|
|
247
|
+
content: areThereCorrectAnswers ? _this.renderCorrectChoiceTypes() : _this.renderEmptyCorrect(),
|
|
248
|
+
headLine: (0, _emotion.jsx)(_uiText.Text, {
|
|
249
|
+
weight: "bold"
|
|
250
|
+
}, (0, _formatMessage.default)('Correct Answers'))
|
|
251
|
+
}), (0, _emotion.jsx)(_index3.default, {
|
|
252
|
+
content: areThereIncorrectChoices ? _this.renderIncorrectTable() : _this.renderEmptyIncorrect(),
|
|
253
|
+
headLine: (0, _emotion.jsx)(_uiText.Text, {
|
|
254
|
+
weight: "bold"
|
|
255
|
+
}, (0, _formatMessage.default)('Incorrect Answers'))
|
|
256
|
+
}));
|
|
257
|
+
};
|
|
258
|
+
|
|
259
|
+
_this.render = function () {
|
|
260
|
+
var _this$props3 = _this.props,
|
|
261
|
+
answerSummary = _this$props3.answerSummary,
|
|
262
|
+
itemId = _this$props3.itemId;
|
|
263
|
+
return (0, _emotion.jsx)(_index.default, null, (0, _emotion.jsx)(_presenter.AfsPartsContainer, {
|
|
264
|
+
afsTable: _this.renderAfsTable(),
|
|
265
|
+
aggregationTable: (0, _emotion.jsx)(_index2.default, {
|
|
266
|
+
itemId: itemId,
|
|
267
|
+
answerSummary: answerSummary
|
|
268
|
+
})
|
|
269
|
+
}));
|
|
270
|
+
};
|
|
271
|
+
|
|
272
|
+
return _this;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
return NumericType;
|
|
276
|
+
}(_react.Component), _class2.propTypes = {
|
|
277
|
+
itemId: _propTypes.default.number.isRequired,
|
|
278
|
+
answerSummary: _propTypes2.numericTypeAnswerSummaryPropType.isRequired,
|
|
279
|
+
styles: _propTypes.default.object
|
|
280
|
+
}.isRequired, _temp)) || _class);
|
|
281
|
+
exports.NumericType = NumericType;
|
|
@@ -23,15 +23,11 @@ var _uiFlex = require("@instructure/ui-flex");
|
|
|
23
23
|
|
|
24
24
|
var _uiText = require("@instructure/ui-text");
|
|
25
25
|
|
|
26
|
-
var _index = _interopRequireDefault(require("../../../../../../../common/components/shared/ExpandButton/index.js"));
|
|
27
|
-
|
|
28
26
|
var _formatMessage = _interopRequireDefault(require("@instructure/quiz-i18n/es/format-message"));
|
|
29
27
|
|
|
30
|
-
var
|
|
31
|
-
|
|
32
|
-
var _index3 = _interopRequireDefault(require("../ChoiceTypeTable/index.js"));
|
|
28
|
+
var _index = _interopRequireDefault(require("../../shared/ChoiceTypeTable/index.js"));
|
|
33
29
|
|
|
34
|
-
var
|
|
30
|
+
var _index2 = _interopRequireDefault(require("../../../NewItemAnalysis/BlankIcon/index.js"));
|
|
35
31
|
|
|
36
32
|
var _emotion = require("@instructure/emotion");
|
|
37
33
|
|
|
@@ -39,6 +35,8 @@ var _styles = _interopRequireDefault(require("./styles.js"));
|
|
|
39
35
|
|
|
40
36
|
var _theme = _interopRequireDefault(require("./theme.js"));
|
|
41
37
|
|
|
38
|
+
var _index3 = _interopRequireDefault(require("../../shared/ExpandableCard/index.js"));
|
|
39
|
+
|
|
42
40
|
var _dec, _class, _class2, _temp;
|
|
43
41
|
|
|
44
42
|
var ChoiceGroupTypeTable = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
@@ -80,10 +78,19 @@ var ChoiceGroupTypeTable = (_dec = (0, _emotion.withStyle)(_styles.default, _the
|
|
|
80
78
|
return (0, _formatMessage.default)('There are no entries for this open entry question.');
|
|
81
79
|
};
|
|
82
80
|
|
|
83
|
-
_this.
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
81
|
+
_this.renderBlankInfo = function () {
|
|
82
|
+
var _blank$aggregate, _blank$aggregate2;
|
|
83
|
+
|
|
84
|
+
var blank = _this.props.blank;
|
|
85
|
+
var correctCount = (blank === null || blank === void 0 ? void 0 : (_blank$aggregate = blank.aggregate) === null || _blank$aggregate === void 0 ? void 0 : _blank$aggregate.correct) || 0;
|
|
86
|
+
var incorrectCount = (blank === null || blank === void 0 ? void 0 : (_blank$aggregate2 = blank.aggregate) === null || _blank$aggregate2 === void 0 ? void 0 : _blank$aggregate2.incorrect) || 0;
|
|
87
|
+
var noAnswer = (blank === null || blank === void 0 ? void 0 : blank.no_answer) || 0;
|
|
88
|
+
var correctString = "".concat((0, _formatMessage.default)('Correct'), ": ").concat(correctCount, " ");
|
|
89
|
+
var incorrectString = "".concat((0, _formatMessage.default)('Incorrect'), ": ").concat(incorrectCount, " ");
|
|
90
|
+
var noAnswerString = "".concat((0, _formatMessage.default)('No Answer'), ": ").concat(noAnswer, " ");
|
|
91
|
+
return (0, _emotion.jsx)("div", {
|
|
92
|
+
css: _this.props.styles.groupAggregationContainer
|
|
93
|
+
}, (0, _emotion.jsx)(_uiText.Text, null, correctString), (0, _emotion.jsx)(_uiText.Text, null, incorrectString), (0, _emotion.jsx)(_uiText.Text, null, noAnswerString));
|
|
87
94
|
};
|
|
88
95
|
|
|
89
96
|
_this.renderTable = function () {
|
|
@@ -94,7 +101,7 @@ var ChoiceGroupTypeTable = (_dec = (0, _emotion.withStyle)(_styles.default, _the
|
|
|
94
101
|
var choices = blank.choices;
|
|
95
102
|
var tableId = "".concat(itemId, "_").concat(index, "_choiceGroup");
|
|
96
103
|
var tableContainerSizeClass = '';
|
|
97
|
-
return (0, _emotion.jsx)(
|
|
104
|
+
return (0, _emotion.jsx)(_index.default, {
|
|
98
105
|
itemId: tableId,
|
|
99
106
|
choices: choices,
|
|
100
107
|
tableContainerSizeClass: tableContainerSizeClass
|
|
@@ -104,16 +111,14 @@ var ChoiceGroupTypeTable = (_dec = (0, _emotion.withStyle)(_styles.default, _the
|
|
|
104
111
|
_this.renderBlankIcon = function () {
|
|
105
112
|
var index = _this.props.index;
|
|
106
113
|
var blankIconKey = "blank_icon_".concat(index);
|
|
107
|
-
return (0, _emotion.jsx)(
|
|
114
|
+
return (0, _emotion.jsx)(_index2.default, {
|
|
108
115
|
key: blankIconKey,
|
|
109
116
|
number: index + 1
|
|
110
117
|
});
|
|
111
118
|
};
|
|
112
119
|
|
|
113
120
|
_this.renderHeadLine = function () {
|
|
114
|
-
var
|
|
115
|
-
blank = _this$props2.blank,
|
|
116
|
-
blankInfo = _this$props2.blankInfo;
|
|
121
|
+
var blank = _this.props.blank;
|
|
117
122
|
var blank_text = blank.blank_text,
|
|
118
123
|
blank_type = blank.blank_type;
|
|
119
124
|
var blankTextAndType = "".concat(blank_text, " (").concat(_this.getTranslatedBlankType(blank_type), ")");
|
|
@@ -129,24 +134,7 @@ var ChoiceGroupTypeTable = (_dec = (0, _emotion.withStyle)(_styles.default, _the
|
|
|
129
134
|
}, blankTextAndType)), (0, _emotion.jsx)(_uiFlex.Flex.Item, {
|
|
130
135
|
shouldShrink: true,
|
|
131
136
|
margin: "xxx-small none small none"
|
|
132
|
-
},
|
|
133
|
-
};
|
|
134
|
-
|
|
135
|
-
_this.renderGroup = function () {
|
|
136
|
-
return (0, _emotion.jsx)(_uiFlex.Flex, {
|
|
137
|
-
direction: "row",
|
|
138
|
-
alignItems: "start"
|
|
139
|
-
}, (0, _emotion.jsx)(_uiFlex.Flex.Item, {
|
|
140
|
-
shouldShrink: true,
|
|
141
|
-
shouldGrow: true,
|
|
142
|
-
margin: "xx-small none none none"
|
|
143
|
-
}, _this.renderHeadLine()), (0, _emotion.jsx)(_uiFlex.Flex.Item, {
|
|
144
|
-
margin: "none none none x-small"
|
|
145
|
-
}, (0, _emotion.jsx)(_index.default, {
|
|
146
|
-
onClick: _this.handleBodyToggle,
|
|
147
|
-
title: _this.state.bodyExpanded ? (0, _formatMessage.default)('collapse group result') : (0, _formatMessage.default)('expand group result'),
|
|
148
|
-
isExpanded: _this.state.bodyExpanded
|
|
149
|
-
})));
|
|
137
|
+
}, _this.renderBlankInfo()));
|
|
150
138
|
};
|
|
151
139
|
|
|
152
140
|
_this.renderEmptyInfo = function () {
|
|
@@ -156,41 +144,17 @@ var ChoiceGroupTypeTable = (_dec = (0, _emotion.withStyle)(_styles.default, _the
|
|
|
156
144
|
}, (0, _emotion.jsx)(_uiFlex.Flex.Item, {
|
|
157
145
|
shouldShrink: true,
|
|
158
146
|
shouldGrow: true,
|
|
159
|
-
padding: "none none x-small
|
|
147
|
+
padding: "none none x-small none"
|
|
160
148
|
}, (0, _emotion.jsx)(_uiText.Text, null, _this.getTranslatedEmptyMessage())));
|
|
161
149
|
};
|
|
162
150
|
|
|
163
151
|
_this.render = function () {
|
|
164
|
-
var
|
|
165
|
-
styles = _this$props3.styles,
|
|
166
|
-
blank = _this$props3.blank;
|
|
167
|
-
var groupWrapper = styles.groupWrapper,
|
|
168
|
-
cardWrapper = styles.cardWrapper;
|
|
152
|
+
var blank = _this.props.blank;
|
|
169
153
|
var areThereChoices = Array.isArray(blank.choices) && blank.choices.length > 0;
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
}
|
|
174
|
-
css: cardWrapper
|
|
175
|
-
}, (0, _emotion.jsx)(_uiFlex.Flex, {
|
|
176
|
-
direction: "column",
|
|
177
|
-
justifyItems: "start"
|
|
178
|
-
}, (0, _emotion.jsx)(_uiFlex.Flex.Item, {
|
|
179
|
-
overflowY: "visible"
|
|
180
|
-
}, (0, _emotion.jsx)(_uiFlex.Flex.Item, {
|
|
181
|
-
shouldGrow: true,
|
|
182
|
-
shouldShrink: true
|
|
183
|
-
}, (0, _emotion.jsx)(_uiFlex.Flex, {
|
|
184
|
-
direction: "column",
|
|
185
|
-
justifyItems: "start"
|
|
186
|
-
}, (0, _emotion.jsx)(_uiFlex.Flex.Item, {
|
|
187
|
-
shouldShrink: true,
|
|
188
|
-
padding: "x-small small x-small medium",
|
|
189
|
-
overflowY: "hidden"
|
|
190
|
-
}, _this.renderGroup()), bodyExpanded && (0, _emotion.jsx)(_uiFlex.Flex.Item, {
|
|
191
|
-
shouldShrink: true,
|
|
192
|
-
padding: "x-small small x-small small"
|
|
193
|
-
}, areThereChoices ? _this.renderTable() : _this.renderEmptyInfo())))))));
|
|
154
|
+
return (0, _emotion.jsx)(_index3.default, {
|
|
155
|
+
content: areThereChoices ? _this.renderTable() : _this.renderEmptyInfo(),
|
|
156
|
+
headLine: _this.renderHeadLine()
|
|
157
|
+
});
|
|
194
158
|
};
|
|
195
159
|
|
|
196
160
|
return _this;
|
|
@@ -204,7 +168,6 @@ var ChoiceGroupTypeTable = (_dec = (0, _emotion.withStyle)(_styles.default, _the
|
|
|
204
168
|
blank_text: _propTypes.default.string.isRequired,
|
|
205
169
|
blank_type: _propTypes.default.string.isRequired
|
|
206
170
|
}).isRequired,
|
|
207
|
-
blankInfo: _propTypes.default.node,
|
|
208
171
|
index: _propTypes.default.number.isRequired,
|
|
209
172
|
styles: _propTypes.default.object
|
|
210
173
|
}.isRequired, _temp)) || _class);
|
|
@@ -0,0 +1,18 @@
|
|
|
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
|
+
return {
|
|
10
|
+
groupAggregationContainer: {
|
|
11
|
+
display: 'flex',
|
|
12
|
+
gap: componentTheme.aggregateSpacing
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
var _default = generateStyle;
|
|
18
|
+
exports.default = _default;
|