@instructure/quiz-core 20.4.2-rc.3 → 20.5.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 +12 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/ChoiceType/presenter.js +2 -2
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/MatchingTypeTable/presenter.js +1 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/RichFillBlankType/index.js +1 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/RichFillBlankType/presenter.js +92 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/RichFillBlankType/styles.js +10 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/RichFillBlankType/theme.js +8 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/presenter.js +5 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AggregationTable/presenter.js +1 -2
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ChoiceGroupTypeTable/index.js +1 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ChoiceGroupTypeTable/presenter.js +165 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ChoiceGroupTypeTable/styles.js +15 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ChoiceGroupTypeTable/theme.js +9 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/{ChoiceType → shared}/ChoiceTypeTable/presenter.js +23 -20
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/propTypes.js +29 -11
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/ChoiceType/presenter.js +2 -2
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/MatchingTypeTable/presenter.js +1 -0
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/RichFillBlankType/index.js +13 -0
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/RichFillBlankType/presenter.js +115 -0
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/RichFillBlankType/styles.js +18 -0
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/RichFillBlankType/theme.js +16 -0
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/presenter.js +13 -7
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AggregationTable/presenter.js +1 -3
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ChoiceGroupTypeTable/index.js +13 -0
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ChoiceGroupTypeTable/presenter.js +189 -0
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ChoiceGroupTypeTable/styles.js +23 -0
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ChoiceGroupTypeTable/theme.js +17 -0
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/{ChoiceType → shared}/ChoiceTypeTable/presenter.js +22 -19
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/propTypes.js +38 -10
- package/package.json +10 -10
- /package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/{ChoiceType → shared}/ChoiceTypeTable/index.js +0 -0
- /package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/{ChoiceType → shared}/ChoiceTypeTable/theme.js +0 -0
- /package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/{ChoiceType → shared}/ChoiceTypeTable/index.js +0 -0
- /package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/{ChoiceType → shared}/ChoiceTypeTable/theme.js +0 -0
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.RichFillBlankType = 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 _propTypes2 = require("../../propTypes.js");
|
|
21
|
+
|
|
22
|
+
var _index = _interopRequireDefault(require("../shared/AfsTableWrapper/index.js"));
|
|
23
|
+
|
|
24
|
+
var _presenter = require("../shared/AfsPartsContainer/presenter.js");
|
|
25
|
+
|
|
26
|
+
var _index2 = _interopRequireDefault(require("../shared/ChoiceGroupTypeTable/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 _index3 = _interopRequireDefault(require("../shared/AggregationTable/index.js"));
|
|
33
|
+
|
|
34
|
+
var _emotion = require("@instructure/emotion");
|
|
35
|
+
|
|
36
|
+
var _styles = _interopRequireDefault(require("./styles.js"));
|
|
37
|
+
|
|
38
|
+
var _theme = _interopRequireDefault(require("./theme.js"));
|
|
39
|
+
|
|
40
|
+
var _dec, _class, _class2, _temp;
|
|
41
|
+
|
|
42
|
+
var RichFillBlankType = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
43
|
+
(0, _inherits2.default)(RichFillBlankType, _Component);
|
|
44
|
+
|
|
45
|
+
var _super = (0, _createSuper2.default)(RichFillBlankType);
|
|
46
|
+
|
|
47
|
+
function RichFillBlankType() {
|
|
48
|
+
var _this;
|
|
49
|
+
|
|
50
|
+
(0, _classCallCheck2.default)(this, RichFillBlankType);
|
|
51
|
+
|
|
52
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
53
|
+
args[_key] = arguments[_key];
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
57
|
+
|
|
58
|
+
_this.renderBlankInfo = function (blank) {
|
|
59
|
+
var _blank$aggregate, _blank$aggregate2;
|
|
60
|
+
|
|
61
|
+
var correctCount = (blank === null || blank === void 0 ? void 0 : (_blank$aggregate = blank.aggregate) === null || _blank$aggregate === void 0 ? void 0 : _blank$aggregate.correct) || 0;
|
|
62
|
+
var incorrectCount = (blank === null || blank === void 0 ? void 0 : (_blank$aggregate2 = blank.aggregate) === null || _blank$aggregate2 === void 0 ? void 0 : _blank$aggregate2.incorrect) || 0;
|
|
63
|
+
var noAnswer = (blank === null || blank === void 0 ? void 0 : blank.no_answer) || 0;
|
|
64
|
+
var correctString = "".concat((0, _formatMessage.default)('Correct'), ": ").concat(correctCount, " ");
|
|
65
|
+
var incorrectString = "".concat((0, _formatMessage.default)('Incorrect'), ": ").concat(incorrectCount, " ");
|
|
66
|
+
var noAnswerString = "".concat((0, _formatMessage.default)('No Answer'), ": ").concat(noAnswer, " ");
|
|
67
|
+
return (0, _emotion.jsx)("div", {
|
|
68
|
+
css: _this.props.styles.groupAggregationContainer
|
|
69
|
+
}, (0, _emotion.jsx)(_uiText.Text, null, correctString), (0, _emotion.jsx)(_uiText.Text, null, incorrectString), (0, _emotion.jsx)(_uiText.Text, null, noAnswerString));
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
_this.renderGroup = function (key, itemId, blank, index) {
|
|
73
|
+
return (0, _emotion.jsx)(_index2.default, {
|
|
74
|
+
key: key,
|
|
75
|
+
itemId: itemId,
|
|
76
|
+
blank: blank,
|
|
77
|
+
blankInfo: _this.renderBlankInfo(blank),
|
|
78
|
+
index: index
|
|
79
|
+
});
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
_this.renderGroups = function () {
|
|
83
|
+
var _this$props = _this.props,
|
|
84
|
+
answerSummary = _this$props.answerSummary,
|
|
85
|
+
itemId = _this$props.itemId;
|
|
86
|
+
var blanks = answerSummary.blanks;
|
|
87
|
+
return blanks.map(function (blank, index) {
|
|
88
|
+
var key = "ChoiceGroupTypeTable_".concat(index);
|
|
89
|
+
return _this.renderGroup(key, itemId, blank, index);
|
|
90
|
+
});
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
_this.render = function () {
|
|
94
|
+
var _this$props2 = _this.props,
|
|
95
|
+
answerSummary = _this$props2.answerSummary,
|
|
96
|
+
itemId = _this$props2.itemId;
|
|
97
|
+
return (0, _emotion.jsx)(_index.default, null, (0, _emotion.jsx)(_presenter.AfsPartsContainer, {
|
|
98
|
+
afsTable: _this.renderGroups(),
|
|
99
|
+
aggregationTable: (0, _emotion.jsx)(_index3.default, {
|
|
100
|
+
itemId: itemId,
|
|
101
|
+
answerSummary: answerSummary
|
|
102
|
+
})
|
|
103
|
+
}));
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
return _this;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
return RichFillBlankType;
|
|
110
|
+
}(_react.Component), _class2.propTypes = {
|
|
111
|
+
itemId: _propTypes.default.number.isRequired,
|
|
112
|
+
answerSummary: _propTypes2.richFillBlankTypeAnswerSummaryPropType.isRequired,
|
|
113
|
+
styles: _propTypes.default.object
|
|
114
|
+
}.isRequired, _temp)) || _class);
|
|
115
|
+
exports.RichFillBlankType = RichFillBlankType;
|
|
@@ -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;
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
return {
|
|
11
|
+
aggregateSpacing: spacing.xSmall
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
var _default = generateComponentTheme;
|
|
16
|
+
exports.default = _default;
|
|
@@ -23,9 +23,11 @@ var _index = _interopRequireDefault(require("./LegacyChoiceType/index.js"));
|
|
|
23
23
|
|
|
24
24
|
var _index2 = _interopRequireDefault(require("./ChoiceType/index.js"));
|
|
25
25
|
|
|
26
|
-
var _index3 = _interopRequireDefault(require("./
|
|
26
|
+
var _index3 = _interopRequireDefault(require("./RichFillBlankType/index.js"));
|
|
27
27
|
|
|
28
|
-
var _index4 = require("./
|
|
28
|
+
var _index4 = _interopRequireDefault(require("./AggregationType/index.js"));
|
|
29
|
+
|
|
30
|
+
var _index5 = require("./MatchingType/index.js");
|
|
29
31
|
|
|
30
32
|
var _propTypes = require("../propTypes.js");
|
|
31
33
|
|
|
@@ -48,23 +50,23 @@ var AnswerFrequencySummary = /*#__PURE__*/function (_Component) {
|
|
|
48
50
|
|
|
49
51
|
_this.addAfsComponentsByFlags = function (afsFlags) {
|
|
50
52
|
if (afsFlags.formulaEnabled) {
|
|
51
|
-
_this.afsTableComponentMap.set('formula',
|
|
53
|
+
_this.afsTableComponentMap.set('formula', _index4.default);
|
|
52
54
|
}
|
|
53
55
|
|
|
54
56
|
if (afsFlags.hotSpotEnabled) {
|
|
55
|
-
_this.afsTableComponentMap.set('hot-spot',
|
|
57
|
+
_this.afsTableComponentMap.set('hot-spot', _index4.default);
|
|
56
58
|
}
|
|
57
59
|
|
|
58
60
|
if (afsFlags.matchingEnabled) {
|
|
59
|
-
_this.afsTableComponentMap.set('matching',
|
|
61
|
+
_this.afsTableComponentMap.set('matching', _index5.MatchingType);
|
|
60
62
|
}
|
|
61
63
|
|
|
62
64
|
if (afsFlags.orderingEnabled) {
|
|
63
|
-
_this.afsTableComponentMap.set('ordering',
|
|
65
|
+
_this.afsTableComponentMap.set('ordering', _index5.OrderingType);
|
|
64
66
|
}
|
|
65
67
|
|
|
66
68
|
if (afsFlags.categorizationEnabled) {
|
|
67
|
-
_this.afsTableComponentMap.set('categorization',
|
|
69
|
+
_this.afsTableComponentMap.set('categorization', _index5.CategorizationType);
|
|
68
70
|
}
|
|
69
71
|
|
|
70
72
|
if (afsFlags.trueFalseEnabled) {
|
|
@@ -78,6 +80,10 @@ var AnswerFrequencySummary = /*#__PURE__*/function (_Component) {
|
|
|
78
80
|
if (afsFlags.multiAnswerEnabled) {
|
|
79
81
|
_this.afsTableComponentMap.set('multi-answer', _index2.default);
|
|
80
82
|
}
|
|
83
|
+
|
|
84
|
+
if (afsFlags.fillInTheBlankEnabled) {
|
|
85
|
+
_this.afsTableComponentMap.set('rich-fill-blank', _index3.default);
|
|
86
|
+
}
|
|
81
87
|
};
|
|
82
88
|
|
|
83
89
|
_this.render = function () {
|
|
@@ -23,8 +23,6 @@ var _uiTable = require("@instructure/ui-table");
|
|
|
23
23
|
|
|
24
24
|
var _propTypes = require("../../../propTypes.js");
|
|
25
25
|
|
|
26
|
-
var _uiA11yContent = require("@instructure/ui-a11y-content");
|
|
27
|
-
|
|
28
26
|
var _propTypes2 = _interopRequireDefault(require("prop-types"));
|
|
29
27
|
|
|
30
28
|
var _uiIcons = require("@instructure/ui-icons");
|
|
@@ -124,7 +122,7 @@ var AggregationTable = (_dec = (0, _uiThemeable.themeable)(_theme.default, style
|
|
|
124
122
|
themeOverride: {
|
|
125
123
|
padding: '0px'
|
|
126
124
|
}
|
|
127
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
125
|
+
}, /*#__PURE__*/_react.default.createElement(_uiFlex.Flex, {
|
|
128
126
|
direction: "row",
|
|
129
127
|
alignItems: "center"
|
|
130
128
|
}, /*#__PURE__*/_react.default.createElement(_uiFlex.Flex.Item, {
|
|
@@ -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.ChoiceGroupTypeTable;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
var _presenter = require("./presenter.js");
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.ChoiceGroupTypeTable = 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 _propTypes2 = require("../../../propTypes.js");
|
|
21
|
+
|
|
22
|
+
var _uiFlex = require("@instructure/ui-flex");
|
|
23
|
+
|
|
24
|
+
var _uiText = require("@instructure/ui-text");
|
|
25
|
+
|
|
26
|
+
var _index = _interopRequireDefault(require("../../../../../../../common/components/shared/ExpandButton/index.js"));
|
|
27
|
+
|
|
28
|
+
var _formatMessage = _interopRequireDefault(require("@instructure/quiz-i18n/es/format-message"));
|
|
29
|
+
|
|
30
|
+
var _index2 = _interopRequireDefault(require("../../../../../../../common/components/shared/Card/index.js"));
|
|
31
|
+
|
|
32
|
+
var _index3 = _interopRequireDefault(require("../ChoiceTypeTable/index.js"));
|
|
33
|
+
|
|
34
|
+
var _index4 = _interopRequireDefault(require("../../../NewItemAnalysis/BlankIcon/index.js"));
|
|
35
|
+
|
|
36
|
+
var _emotion = require("@instructure/emotion");
|
|
37
|
+
|
|
38
|
+
var _styles = _interopRequireDefault(require("./styles.js"));
|
|
39
|
+
|
|
40
|
+
var _theme = _interopRequireDefault(require("./theme.js"));
|
|
41
|
+
|
|
42
|
+
var _dec, _class, _class2, _temp;
|
|
43
|
+
|
|
44
|
+
var ChoiceGroupTypeTable = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
45
|
+
(0, _inherits2.default)(ChoiceGroupTypeTable, _Component);
|
|
46
|
+
|
|
47
|
+
var _super = (0, _createSuper2.default)(ChoiceGroupTypeTable);
|
|
48
|
+
|
|
49
|
+
function ChoiceGroupTypeTable() {
|
|
50
|
+
var _this;
|
|
51
|
+
|
|
52
|
+
(0, _classCallCheck2.default)(this, ChoiceGroupTypeTable);
|
|
53
|
+
|
|
54
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
55
|
+
args[_key] = arguments[_key];
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
59
|
+
_this.state = {
|
|
60
|
+
bodyExpanded: false
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
_this.getTranslatedBlankType = function (blank_type) {
|
|
64
|
+
switch (blank_type) {
|
|
65
|
+
case 'openEntry':
|
|
66
|
+
return (0, _formatMessage.default)('Open Entry');
|
|
67
|
+
|
|
68
|
+
case 'wordbank':
|
|
69
|
+
return (0, _formatMessage.default)('Word Bank');
|
|
70
|
+
|
|
71
|
+
case 'dropdown':
|
|
72
|
+
return (0, _formatMessage.default)('Dropdown');
|
|
73
|
+
|
|
74
|
+
default:
|
|
75
|
+
return blank_type;
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
_this.handleBodyToggle = function () {
|
|
80
|
+
_this.setState({
|
|
81
|
+
bodyExpanded: !_this.state.bodyExpanded
|
|
82
|
+
});
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
_this.renderTable = function () {
|
|
86
|
+
var _this$props = _this.props,
|
|
87
|
+
itemId = _this$props.itemId,
|
|
88
|
+
blank = _this$props.blank,
|
|
89
|
+
index = _this$props.index;
|
|
90
|
+
var choices = blank.choices;
|
|
91
|
+
var tableId = "".concat(itemId, "_").concat(index, "_choiceGroup");
|
|
92
|
+
var tableContainerSizeClass = '';
|
|
93
|
+
return (0, _emotion.jsx)(_index3.default, {
|
|
94
|
+
itemId: tableId,
|
|
95
|
+
choices: choices,
|
|
96
|
+
tableContainerSizeClass: tableContainerSizeClass
|
|
97
|
+
});
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
_this.renderBlankIcon = function () {
|
|
101
|
+
var index = _this.props.index;
|
|
102
|
+
var blankIconKey = "blank_icon_".concat(index);
|
|
103
|
+
return (0, _emotion.jsx)(_index4.default, {
|
|
104
|
+
key: blankIconKey,
|
|
105
|
+
number: index + 1
|
|
106
|
+
});
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
_this.renderHeadLine = function () {
|
|
110
|
+
var _this$props2 = _this.props,
|
|
111
|
+
blank = _this$props2.blank,
|
|
112
|
+
blankInfo = _this$props2.blankInfo;
|
|
113
|
+
var blank_text = blank.blank_text,
|
|
114
|
+
blank_type = blank.blank_type;
|
|
115
|
+
var blankTextAndType = "".concat(blank_text, " (").concat(_this.getTranslatedBlankType(blank_type), ")");
|
|
116
|
+
return (0, _emotion.jsx)(_uiFlex.Flex, {
|
|
117
|
+
overflowY: "visible",
|
|
118
|
+
direction: "row",
|
|
119
|
+
alignItems: "start",
|
|
120
|
+
wrap: "wrap"
|
|
121
|
+
}, (0, _emotion.jsx)(_uiFlex.Flex.Item, null, _this.renderBlankIcon()), (0, _emotion.jsx)(_uiFlex.Flex.Item, {
|
|
122
|
+
margin: "xxx-small medium small x-small"
|
|
123
|
+
}, (0, _emotion.jsx)(_uiText.Text, {
|
|
124
|
+
weight: "bold"
|
|
125
|
+
}, blankTextAndType)), (0, _emotion.jsx)(_uiFlex.Flex.Item, {
|
|
126
|
+
shouldShrink: true,
|
|
127
|
+
margin: "xxx-small none small none"
|
|
128
|
+
}, blankInfo));
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
_this.renderGroup = function () {
|
|
132
|
+
return (0, _emotion.jsx)(_uiFlex.Flex, {
|
|
133
|
+
direction: "row",
|
|
134
|
+
alignItems: "start"
|
|
135
|
+
}, (0, _emotion.jsx)(_uiFlex.Flex.Item, {
|
|
136
|
+
shouldShrink: true,
|
|
137
|
+
shouldGrow: true,
|
|
138
|
+
margin: "xx-small none none none"
|
|
139
|
+
}, _this.renderHeadLine()), (0, _emotion.jsx)(_uiFlex.Flex.Item, {
|
|
140
|
+
margin: "none none none x-small"
|
|
141
|
+
}, (0, _emotion.jsx)(_index.default, {
|
|
142
|
+
onClick: _this.handleBodyToggle,
|
|
143
|
+
title: _this.state.bodyExpanded ? (0, _formatMessage.default)('collapse group result') : (0, _formatMessage.default)('expand group result'),
|
|
144
|
+
isExpanded: _this.state.bodyExpanded
|
|
145
|
+
})));
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
_this.render = function () {
|
|
149
|
+
return (0, _emotion.jsx)("div", {
|
|
150
|
+
css: _this.props.styles.groupWrapper
|
|
151
|
+
}, (0, _emotion.jsx)(_index2.default, {
|
|
152
|
+
css: _this.props.styles.cardWrapper
|
|
153
|
+
}, (0, _emotion.jsx)(_uiFlex.Flex, {
|
|
154
|
+
direction: "column",
|
|
155
|
+
justifyItems: "start"
|
|
156
|
+
}, (0, _emotion.jsx)(_uiFlex.Flex.Item, {
|
|
157
|
+
overflowY: "visible"
|
|
158
|
+
}, (0, _emotion.jsx)(_uiFlex.Flex.Item, {
|
|
159
|
+
shouldGrow: true,
|
|
160
|
+
shouldShrink: true
|
|
161
|
+
}, (0, _emotion.jsx)(_uiFlex.Flex, {
|
|
162
|
+
direction: "column",
|
|
163
|
+
justifyItems: "start"
|
|
164
|
+
}, (0, _emotion.jsx)(_uiFlex.Flex.Item, {
|
|
165
|
+
shouldShrink: true,
|
|
166
|
+
padding: "x-small small x-small medium",
|
|
167
|
+
overflowY: "hidden"
|
|
168
|
+
}, _this.renderGroup()), _this.state.bodyExpanded && (0, _emotion.jsx)(_uiFlex.Flex.Item, {
|
|
169
|
+
shouldShrink: true,
|
|
170
|
+
padding: "x-small small x-small small"
|
|
171
|
+
}, _this.renderTable())))))));
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
return _this;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
return ChoiceGroupTypeTable;
|
|
178
|
+
}(_react.Component), _class2.propTypes = {
|
|
179
|
+
itemId: _propTypes.default.number.isRequired,
|
|
180
|
+
blank: _propTypes.default.shape({
|
|
181
|
+
choices: _propTypes.default.arrayOf(_propTypes2.choiceTypeObject).isRequired,
|
|
182
|
+
blank_text: _propTypes.default.string.isRequired,
|
|
183
|
+
blank_type: _propTypes.default.string.isRequired
|
|
184
|
+
}).isRequired,
|
|
185
|
+
blankInfo: _propTypes.default.node.isRequired,
|
|
186
|
+
index: _propTypes.default.number.isRequired,
|
|
187
|
+
styles: _propTypes.default.object
|
|
188
|
+
}.isRequired, _temp)) || _class);
|
|
189
|
+
exports.ChoiceGroupTypeTable = ChoiceGroupTypeTable;
|
|
@@ -0,0 +1,23 @@
|
|
|
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
|
+
groupWrapper: {
|
|
11
|
+
padding: '0',
|
|
12
|
+
width: 'calc(25% + 350px)',
|
|
13
|
+
minWidth: componentTheme.cardMinWidth,
|
|
14
|
+
maxWidth: '100%'
|
|
15
|
+
},
|
|
16
|
+
cardWrapper: {
|
|
17
|
+
margin: "0 0 ".concat(componentTheme.cardBottomMargin, " 0")
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
var _default = generateStyle;
|
|
23
|
+
exports.default = _default;
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
+
return {
|
|
11
|
+
cardBottomMargin: spacing.xSmall,
|
|
12
|
+
cardMinWidth: '500px'
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
var _default = generateComponentTheme;
|
|
17
|
+
exports.default = _default;
|
|
@@ -48,19 +48,20 @@ var _uiText = require("@instructure/ui-text");
|
|
|
48
48
|
var _rowStyleMap, _dec, _class, _class2, _temp;
|
|
49
49
|
|
|
50
50
|
var styles = {
|
|
51
|
-
componentId: '
|
|
51
|
+
componentId: 'cYrxJ',
|
|
52
52
|
template: function template(theme) {
|
|
53
|
-
return "\n\n.
|
|
53
|
+
return "\n\n.cYrxJ_rMrG{display:flex;flex-basis:100%;flex-direction:column;padding-bottom:".concat(theme.tableBottomPadding || 'inherit', "}\n\n.cYrxJ_fgIl{max-width:100%;width:calc(25% + 350px)}\n\n.cYrxJ_SVtU table{border-collapse:separate;border-spacing:0 1px}\n\n.cYrxJ_eviJ table thead tr td,.cYrxJ_eviJ table thead tr th{border-bottom:solid 0.0625rem ").concat(theme.colorGray || 'inherit', "}\n\n.cYrxJ_SVtU table tbody tr th{font-weight:400;width:33.33%}\n\n.cYrxJ_SVtU table tbody tr td{width:33.33%}\n\n.cYrxJ_cvRx{align-items:center;display:flex;height:100%;justify-content:center;min-height:47px;width:46px}\n\n.cYrxJ_EKAb{background-color:").concat(theme.colorGreen || 'inherit', "}\n\n.cYrxJ_EKAb svg{fill:#fff}\n\n.cYrxJ_cCmC{align-items:center;display:flex;height:calc(100% - 4px);justify-content:center}\n\n.cYrxJ_dJVn{padding:").concat(theme.cellPadding || 'inherit', "}\n\n.cYrxJ_eEOp td,.cYrxJ_eEOp th{border-bottom:solid 0.0625rem ").concat(theme.colorGray || 'inherit', "}\n\n.cYrxJ_UAZE td{border-width:2px 0 2px 0}\n\n.cYrxJ_UAZE td,.cYrxJ_UAZE th:first-child{border-color:").concat(theme.colorGreen || 'inherit', ";border-style:solid}\n\n.cYrxJ_UAZE th:first-child{border-radius:4px 0 0 4px;border-width:2px 0 2px 2px}\n\n.cYrxJ_UAZE td:last-child{border-color:").concat(theme.colorGreen || 'inherit', ";border-radius:0 4px 4px 0;border-style:solid;border-width:2px 2px 2px 0}");
|
|
54
54
|
},
|
|
55
|
-
'tableWrapper': '
|
|
56
|
-
'
|
|
57
|
-
'
|
|
58
|
-
'
|
|
59
|
-
'
|
|
60
|
-
'
|
|
61
|
-
'
|
|
62
|
-
'
|
|
63
|
-
'
|
|
55
|
+
'tableWrapper': 'cYrxJ_rMrG',
|
|
56
|
+
'tableWidthMax': 'cYrxJ_fgIl',
|
|
57
|
+
'tableContainer': 'cYrxJ_SVtU',
|
|
58
|
+
'headerGrayBottomBorder': 'cYrxJ_eviJ',
|
|
59
|
+
'iconWrapper': 'cYrxJ_cvRx',
|
|
60
|
+
'iconCorrect': 'cYrxJ_EKAb',
|
|
61
|
+
'textContainer': 'cYrxJ_cCmC',
|
|
62
|
+
'firstTextContainer': 'cYrxJ_dJVn',
|
|
63
|
+
'incorrectRow': 'cYrxJ_eEOp',
|
|
64
|
+
'correctRow': 'cYrxJ_UAZE'
|
|
64
65
|
};
|
|
65
66
|
var correctAttribute = 'correct';
|
|
66
67
|
var incorrectAttribute = 'incorrect';
|
|
@@ -124,8 +125,7 @@ var ChoiceTypeTable = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles
|
|
|
124
125
|
};
|
|
125
126
|
|
|
126
127
|
_this.getDataIconAttribute = function (correct, choiceIndex) {
|
|
127
|
-
var
|
|
128
|
-
var choices = answerSummary.choices;
|
|
128
|
+
var choices = _this.props.choices;
|
|
129
129
|
|
|
130
130
|
if (_this.nextChoiceIsCorrect(choices, choiceIndex + 1) && !correct) {
|
|
131
131
|
return '';
|
|
@@ -199,13 +199,13 @@ var ChoiceTypeTable = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles
|
|
|
199
199
|
|
|
200
200
|
_this.render = function () {
|
|
201
201
|
var _this$props = _this.props,
|
|
202
|
-
|
|
203
|
-
itemId = _this$props.itemId
|
|
204
|
-
|
|
202
|
+
choices = _this$props.choices,
|
|
203
|
+
itemId = _this$props.itemId,
|
|
204
|
+
tableContainerSizeClass = _this$props.tableContainerSizeClass;
|
|
205
205
|
var answerHeaderId = "answer-frequency-summary-answer-".concat(itemId);
|
|
206
206
|
var respondentsHeaderId = "answer-frequency-summary-respondents-".concat(itemId);
|
|
207
207
|
var percentageHeaderId = "answer-frequency-summary-percentage-".concat(itemId);
|
|
208
|
-
var containerClasses = (0, _classnames.default)(styles.tableContainer, (0, _defineProperty2.default)({}, styles.headerGrayBottomBorder, !_this.nextChoiceIsCorrect(choices, 0)));
|
|
208
|
+
var containerClasses = (0, _classnames.default)(tableContainerSizeClass, styles.tableContainer, (0, _defineProperty2.default)({}, styles.headerGrayBottomBorder, !_this.nextChoiceIsCorrect(choices, 0)));
|
|
209
209
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
210
210
|
className: containerClasses
|
|
211
211
|
}, /*#__PURE__*/_react.default.createElement(_uiTable.Table, {
|
|
@@ -234,6 +234,9 @@ var ChoiceTypeTable = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles
|
|
|
234
234
|
return ChoiceTypeTable;
|
|
235
235
|
}(_react.Component), _class2.propTypes = {
|
|
236
236
|
itemId: _propTypes.default.number,
|
|
237
|
-
|
|
238
|
-
|
|
237
|
+
choices: _propTypes.default.arrayOf(_propTypes2.choiceTypeObject),
|
|
238
|
+
tableContainerClass: _propTypes.default.string
|
|
239
|
+
}.isRequired, _class2.defaultProps = {
|
|
240
|
+
tableContainerSizeClass: styles.tableWidthMax
|
|
241
|
+
}, _temp)) || _class);
|
|
239
242
|
exports.ChoiceTypeTable = ChoiceTypeTable;
|
|
@@ -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.matchingTypeAnswerSummaryPropType = exports.choiceTypeAnswerSummaryPropType = exports.onlyAggregatePropType = exports.quizAnalysisPropType = exports.quizAnalysisMetadata = void 0;
|
|
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;
|
|
9
9
|
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
11
|
|
|
@@ -47,12 +47,16 @@ var aggregateDetailPropType = _propTypes.default.shape({
|
|
|
47
47
|
percentage: _propTypes.default.number.isRequired
|
|
48
48
|
});
|
|
49
49
|
|
|
50
|
+
exports.aggregateDetailPropType = aggregateDetailPropType;
|
|
51
|
+
|
|
50
52
|
var aggregatePropType = _propTypes.default.shape({
|
|
51
53
|
correct: aggregateDetailPropType.isRequired,
|
|
52
54
|
incorrect: aggregateDetailPropType.isRequired,
|
|
53
55
|
partial_correct: aggregateDetailPropType
|
|
54
56
|
});
|
|
55
57
|
|
|
58
|
+
exports.aggregatePropType = aggregatePropType;
|
|
59
|
+
|
|
56
60
|
var onlyAggregatePropType = _propTypes.default.shape({
|
|
57
61
|
no_answer: aggregateDetailPropType,
|
|
58
62
|
aggregate: aggregatePropType
|
|
@@ -60,14 +64,19 @@ var onlyAggregatePropType = _propTypes.default.shape({
|
|
|
60
64
|
|
|
61
65
|
exports.onlyAggregatePropType = onlyAggregatePropType;
|
|
62
66
|
|
|
67
|
+
var choiceTypeObject = _propTypes.default.shape({
|
|
68
|
+
body: _propTypes.default.string,
|
|
69
|
+
correct: _propTypes.default.bool,
|
|
70
|
+
count: _propTypes.default.number,
|
|
71
|
+
percentage: _propTypes.default.number
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
exports.choiceTypeObject = choiceTypeObject;
|
|
75
|
+
|
|
63
76
|
var choiceTypeAnswerSummaryPropType = _propTypes.default.shape({
|
|
64
|
-
choices: _propTypes.default.arrayOf(
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
count: _propTypes.default.number,
|
|
68
|
-
percentage: _propTypes.default.number
|
|
69
|
-
})),
|
|
70
|
-
no_answer: aggregateDetailPropType
|
|
77
|
+
choices: _propTypes.default.arrayOf(choiceTypeObject),
|
|
78
|
+
no_answer: aggregateDetailPropType,
|
|
79
|
+
aggregate: aggregatePropType
|
|
71
80
|
});
|
|
72
81
|
|
|
73
82
|
exports.choiceTypeAnswerSummaryPropType = choiceTypeAnswerSummaryPropType;
|
|
@@ -81,12 +90,31 @@ var matchingTypeAnswerSummaryPropType = _propTypes.default.shape({
|
|
|
81
90
|
body: _propTypes.default.string,
|
|
82
91
|
distractor: _propTypes.default.bool
|
|
83
92
|
}))
|
|
84
|
-
}))
|
|
93
|
+
})),
|
|
94
|
+
no_answer: aggregateDetailPropType,
|
|
95
|
+
aggregate: aggregatePropType
|
|
85
96
|
});
|
|
86
97
|
|
|
87
98
|
exports.matchingTypeAnswerSummaryPropType = matchingTypeAnswerSummaryPropType;
|
|
88
99
|
|
|
89
|
-
var
|
|
100
|
+
var richFillBlankTypeAnswerSummaryPropType = _propTypes.default.shape({
|
|
101
|
+
blanks: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
102
|
+
choices: _propTypes.default.arrayOf(choiceTypeObject),
|
|
103
|
+
blank_text: _propTypes.default.string,
|
|
104
|
+
blank_type: _propTypes.default.string,
|
|
105
|
+
no_answer: _propTypes.default.number,
|
|
106
|
+
aggregate: _propTypes.default.shape({
|
|
107
|
+
correct: _propTypes.default.number,
|
|
108
|
+
incorrect: _propTypes.default.number
|
|
109
|
+
})
|
|
110
|
+
})),
|
|
111
|
+
no_answer: aggregateDetailPropType,
|
|
112
|
+
aggregate: aggregatePropType
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
exports.richFillBlankTypeAnswerSummaryPropType = richFillBlankTypeAnswerSummaryPropType;
|
|
116
|
+
|
|
117
|
+
var answerSummaryPropType = _propTypes.default.oneOfType([choiceTypeAnswerSummaryPropType, onlyAggregatePropType, matchingTypeAnswerSummaryPropType, richFillBlankTypeAnswerSummaryPropType]);
|
|
90
118
|
|
|
91
119
|
exports.answerSummaryPropType = answerSummaryPropType;
|
|
92
120
|
|