@instructure/quiz-core 18.6.1-rc.1 → 18.6.1-rc.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/AggregationType/presenter.js +1 -1
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/ChoiceType/ChoiceTypeTableRow/presenter.js +4 -8
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/ChoiceType/presenter.js +4 -4
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/CategorizationType.js +74 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/MatchingType.js +4 -15
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/MatchingTypeTable/presenter.js +25 -18
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/OrderingType.js +5 -16
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/index.js +2 -1
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/presenter.js +7 -8
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AfsPartsContainer/presenter.js +5 -11
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AggregationTable/presenter.js +44 -36
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/NewItemAnalysis/index.js +2 -1
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/propTypes.js +4 -1
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/AggregationType/presenter.js +2 -2
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/ChoiceType/ChoiceTypeTableRow/presenter.js +4 -8
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/ChoiceType/presenter.js +4 -4
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/CategorizationType.js +99 -0
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/MatchingType.js +5 -20
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/MatchingTypeTable/presenter.js +30 -19
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/OrderingType.js +9 -24
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/index.js +9 -1
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/presenter.js +5 -6
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AfsPartsContainer/presenter.js +5 -11
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AggregationTable/presenter.js +44 -36
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/NewItemAnalysis/index.js +2 -1
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/propTypes.js +4 -1
- package/package.json +9 -9
|
@@ -3,10 +3,10 @@ import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
|
3
3
|
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
4
4
|
import React, { Component } from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
|
-
import AggregationTable from "../shared/AggregationTable/index.js";
|
|
7
6
|
import { onlyAggregatePropType } from "../../propTypes.js";
|
|
8
7
|
import { AfsTableWrapper } from "../shared/AfsTableWrapper/presenter.js";
|
|
9
8
|
import { AfsPartsContainer } from "../shared/AfsPartsContainer/presenter.js";
|
|
9
|
+
import AggregationTable from "../shared/AggregationTable/index.js";
|
|
10
10
|
export var AggregationType = /*#__PURE__*/function (_Component) {
|
|
11
11
|
_inherits(AggregationType, _Component);
|
|
12
12
|
|
|
@@ -87,23 +87,19 @@ export var ChoiceTypeTableRow = (_dec = themeable(theme, styles), _dec(_class =
|
|
|
87
87
|
key: _this.props.choiceIndex
|
|
88
88
|
}, /*#__PURE__*/React.createElement(Table.Cell, {
|
|
89
89
|
theme: {
|
|
90
|
-
padding: '0px'
|
|
91
|
-
fontWeight: 'bold'
|
|
90
|
+
padding: '0px'
|
|
92
91
|
}
|
|
93
92
|
}, /*#__PURE__*/React.createElement(ScreenReaderContent, null, _this.answerLabel(correct)), _this.renderIcon(correct)), /*#__PURE__*/React.createElement(Table.RowHeader, {
|
|
94
93
|
theme: {
|
|
95
|
-
padding: cellPadding
|
|
96
|
-
fontWeight: 'bold'
|
|
94
|
+
padding: cellPadding
|
|
97
95
|
}
|
|
98
96
|
}, _this.renderMiddleCell(correct, _this.extractChoiceText(choiceBody, correct))), /*#__PURE__*/React.createElement(Table.Cell, {
|
|
99
97
|
theme: {
|
|
100
|
-
padding: cellPadding
|
|
101
|
-
fontWeight: 'bold'
|
|
98
|
+
padding: cellPadding
|
|
102
99
|
}
|
|
103
100
|
}, _this.renderMiddleCell(correct, _this.props.choice.count)), /*#__PURE__*/React.createElement(Table.Cell, {
|
|
104
101
|
theme: {
|
|
105
|
-
padding: cellPadding
|
|
106
|
-
fontWeight: 'bold'
|
|
102
|
+
padding: cellPadding
|
|
107
103
|
},
|
|
108
104
|
textAlign: "center"
|
|
109
105
|
}, _this.renderLastCell(correct, "".concat(_this.props.choice.percentage, "%"))));
|
|
@@ -14,12 +14,12 @@ import PropTypes from 'prop-types';
|
|
|
14
14
|
import ChoiceTypeTableRow from "./ChoiceTypeTableRow/index.js";
|
|
15
15
|
import { choiceTypeAnswerSummaryPropType } from "../../propTypes.js";
|
|
16
16
|
var styles = {
|
|
17
|
-
componentId: '
|
|
17
|
+
componentId: 'fxQkB',
|
|
18
18
|
template: function template(theme) {
|
|
19
|
-
return "\n\n.
|
|
19
|
+
return "\n\n.fxQkB_rMrG{display:flex;flex-basis:100%;flex-direction:column;padding-bottom:".concat(theme.tableBottomPadding || 'inherit', "}\n\n.fxQkB_SVtU{max-width:100%;width:calc(25% + 350px)}\n\n.fxQkB_SVtU table tbody tr th{font-weight:400}");
|
|
20
20
|
},
|
|
21
|
-
'tableWrapper': '
|
|
22
|
-
'tableContainer': '
|
|
21
|
+
'tableWrapper': 'fxQkB_rMrG',
|
|
22
|
+
'tableContainer': 'fxQkB_SVtU'
|
|
23
23
|
};
|
|
24
24
|
import theme from "./theme.js";
|
|
25
25
|
import AfsTableWrapper from "../shared/AfsTableWrapper/index.js";
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
3
|
+
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
4
|
+
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
5
|
+
import React, { Component } from 'react';
|
|
6
|
+
import AfsTableWrapper from "../shared/AfsTableWrapper/index.js";
|
|
7
|
+
import PropTypes from 'prop-types';
|
|
8
|
+
import { matchingTypeAnswerSummaryPropType } from "../../propTypes.js";
|
|
9
|
+
import t from '@instructure/quiz-i18n/es/format-message';
|
|
10
|
+
import { AfsPartsContainer } from "../shared/AfsPartsContainer/presenter.js";
|
|
11
|
+
import MatchingTypeTable from "./MatchingTypeTable/index.js";
|
|
12
|
+
import AggregationTable from "../shared/AggregationTable/index.js";
|
|
13
|
+
var distractorKey = 'distractor';
|
|
14
|
+
var distractorTranslation = t('Distractors');
|
|
15
|
+
export var CategorizationType = /*#__PURE__*/function (_Component) {
|
|
16
|
+
_inherits(CategorizationType, _Component);
|
|
17
|
+
|
|
18
|
+
var _super = _createSuper(CategorizationType);
|
|
19
|
+
|
|
20
|
+
function CategorizationType() {
|
|
21
|
+
var _this;
|
|
22
|
+
|
|
23
|
+
_classCallCheck(this, CategorizationType);
|
|
24
|
+
|
|
25
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
26
|
+
args[_key] = arguments[_key];
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
30
|
+
|
|
31
|
+
_this.updateAnswerBody = function (answerSummary) {
|
|
32
|
+
var answerSummaryCopy = _objectSpread({}, answerSummary);
|
|
33
|
+
|
|
34
|
+
Object.keys(answerSummaryCopy.questions).forEach(function (questionKey) {
|
|
35
|
+
Object.keys(answerSummaryCopy.questions[questionKey].answers).forEach(function (answerKey) {
|
|
36
|
+
if (distractorKey === answerKey) {
|
|
37
|
+
var detail = answerSummaryCopy.questions[questionKey].answers[answerKey];
|
|
38
|
+
answerSummaryCopy.questions[questionKey].answers[answerKey] = _objectSpread(_objectSpread({}, detail), {}, {
|
|
39
|
+
body: distractorTranslation
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
return answerSummaryCopy;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
_this.render = function () {
|
|
48
|
+
var _this$props = _this.props,
|
|
49
|
+
itemId = _this$props.itemId,
|
|
50
|
+
answerSummary = _this$props.answerSummary;
|
|
51
|
+
|
|
52
|
+
var updatedAnswerSummary = _this.updateAnswerBody(answerSummary);
|
|
53
|
+
|
|
54
|
+
return /*#__PURE__*/React.createElement(AfsTableWrapper, null, /*#__PURE__*/React.createElement(AfsPartsContainer, {
|
|
55
|
+
afsTable: /*#__PURE__*/React.createElement(MatchingTypeTable, {
|
|
56
|
+
itemId: itemId,
|
|
57
|
+
answerSummary: updatedAnswerSummary
|
|
58
|
+
}),
|
|
59
|
+
aggregationTable: /*#__PURE__*/React.createElement(AggregationTable, {
|
|
60
|
+
itemId: itemId,
|
|
61
|
+
answerSummary: updatedAnswerSummary
|
|
62
|
+
})
|
|
63
|
+
}));
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
return _this;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return CategorizationType;
|
|
70
|
+
}(Component);
|
|
71
|
+
CategorizationType.propTypes = {
|
|
72
|
+
itemId: PropTypes.number.isRequired,
|
|
73
|
+
answerSummary: matchingTypeAnswerSummaryPropType.isRequired
|
|
74
|
+
}.isRequired;
|
|
@@ -3,11 +3,10 @@ import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
|
3
3
|
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
4
4
|
import React, { Component } from 'react';
|
|
5
5
|
import AfsTableWrapper from "../shared/AfsTableWrapper/index.js";
|
|
6
|
-
import MatchingTypeTable from "./MatchingTypeTable/index.js";
|
|
7
6
|
import PropTypes from 'prop-types';
|
|
8
7
|
import { matchingTypeAnswerSummaryPropType } from "../../propTypes.js";
|
|
9
|
-
import MatchingTypeOrderer from "./utils/matchingTypeOrderer.js";
|
|
10
8
|
import { AfsPartsContainer } from "../shared/AfsPartsContainer/presenter.js";
|
|
9
|
+
import MatchingTypeTable from "./MatchingTypeTable/index.js";
|
|
11
10
|
import AggregationTable from "../shared/AggregationTable/index.js";
|
|
12
11
|
export var MatchingType = /*#__PURE__*/function (_Component) {
|
|
13
12
|
_inherits(MatchingType, _Component);
|
|
@@ -29,20 +28,10 @@ export var MatchingType = /*#__PURE__*/function (_Component) {
|
|
|
29
28
|
var _this$props = _this.props,
|
|
30
29
|
itemId = _this$props.itemId,
|
|
31
30
|
answerSummary = _this$props.answerSummary;
|
|
32
|
-
var questions = answerSummary.questions;
|
|
33
|
-
var questionKeys = Object.keys(questions);
|
|
34
|
-
var exampleAnswers = questions[questionKeys[0]].answers;
|
|
35
|
-
var answerKeys = Object.keys(exampleAnswers);
|
|
36
|
-
var orderedAnswerKeys = MatchingTypeOrderer.orderAnswerKeysForDiagonal(answerSummary, answerKeys);
|
|
37
|
-
var orderedQuestionKeys = MatchingTypeOrderer.orderQuestionKeysForDiagonal(answerSummary, questionKeys, orderedAnswerKeys);
|
|
38
|
-
var tableHalfWidth = orderedAnswerKeys.length <= 3;
|
|
39
31
|
return /*#__PURE__*/React.createElement(AfsTableWrapper, null, /*#__PURE__*/React.createElement(AfsPartsContainer, {
|
|
40
|
-
tableHalfWidth: tableHalfWidth,
|
|
41
32
|
afsTable: /*#__PURE__*/React.createElement(MatchingTypeTable, {
|
|
42
33
|
itemId: itemId,
|
|
43
|
-
answerSummary: answerSummary
|
|
44
|
-
orderedAnswerKeys: orderedAnswerKeys,
|
|
45
|
-
orderedQuestionKeys: orderedQuestionKeys
|
|
34
|
+
answerSummary: answerSummary
|
|
46
35
|
}),
|
|
47
36
|
aggregationTable: /*#__PURE__*/React.createElement(AggregationTable, {
|
|
48
37
|
itemId: itemId,
|
|
@@ -57,6 +46,6 @@ export var MatchingType = /*#__PURE__*/function (_Component) {
|
|
|
57
46
|
return MatchingType;
|
|
58
47
|
}(Component);
|
|
59
48
|
MatchingType.propTypes = {
|
|
60
|
-
itemId: PropTypes.number,
|
|
61
|
-
answerSummary: matchingTypeAnswerSummaryPropType
|
|
49
|
+
itemId: PropTypes.number.isRequired,
|
|
50
|
+
answerSummary: matchingTypeAnswerSummaryPropType.isRequired
|
|
62
51
|
}.isRequired;
|
|
@@ -8,16 +8,17 @@ var _dec, _class, _class2, _temp;
|
|
|
8
8
|
import React, { Component } from 'react';
|
|
9
9
|
import { Flex } from '@instructure/ui-flex';
|
|
10
10
|
var styles = {
|
|
11
|
-
componentId: '
|
|
11
|
+
componentId: 'bdaoA',
|
|
12
12
|
template: function template(theme) {
|
|
13
|
-
return "\n\n.
|
|
13
|
+
return "\n\n.bdaoA_rMrG{display:flex;flex-basis:100%;flex-direction:column;padding-bottom:".concat(theme.tableBottomPadding || 'inherit', "}\n\n.bdaoA_cvRx{align-items:center;display:flex;height:48px;justify-content:center;width:46px}\n\n.bdaoA_EKAb{background-color:").concat(theme.colorGreen || 'inherit', "}\n\n.bdaoA_EKAb svg{fill:#fff}\n\n.bdaoA_tnta{border-color:").concat(theme.colorGreen || 'inherit', ";border-style:solid;border-width:2px 0}\n\n.bdaoA_fvqY{border-radius:4px 4px 4px 4px;border-width:2px 2px 2px 2px}\n\n.bdaoA_bwoZ{max-width:100%;width:calc(25% + 350px)}\n\n.bdaoA_SVtU table tbody tr th{font-weight:400}");
|
|
14
14
|
},
|
|
15
|
-
'tableWrapper': '
|
|
16
|
-
'iconWrapper': '
|
|
17
|
-
'iconCorrect': '
|
|
18
|
-
'correctRowBorder': '
|
|
19
|
-
'correctRowBorderRadius': '
|
|
20
|
-
'
|
|
15
|
+
'tableWrapper': 'bdaoA_rMrG',
|
|
16
|
+
'iconWrapper': 'bdaoA_cvRx',
|
|
17
|
+
'iconCorrect': 'bdaoA_EKAb',
|
|
18
|
+
'correctRowBorder': 'bdaoA_tnta',
|
|
19
|
+
'correctRowBorderRadius': 'bdaoA_fvqY',
|
|
20
|
+
'tableHalfWidth': 'bdaoA_bwoZ',
|
|
21
|
+
'tableContainer': 'bdaoA_SVtU'
|
|
21
22
|
};
|
|
22
23
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
23
24
|
import { Table } from '@instructure/ui-table';
|
|
@@ -25,9 +26,10 @@ import { themeable } from '@instructure/ui-themeable';
|
|
|
25
26
|
import PropTypes from 'prop-types';
|
|
26
27
|
import { IconCheckSolid } from '@instructure/ui-icons';
|
|
27
28
|
import { matchingTypeAnswerSummaryPropType } from "../../../propTypes.js";
|
|
29
|
+
import MatchingTypeOrderer from "../utils/matchingTypeOrderer.js";
|
|
30
|
+
import { extractTextFromHtml } from '@instructure/quiz-interactions';
|
|
28
31
|
import classNames from 'classnames';
|
|
29
32
|
import theme from "./theme.js";
|
|
30
|
-
import { extractTextFromHtml } from '@instructure/quiz-interactions';
|
|
31
33
|
|
|
32
34
|
var _ref = /*#__PURE__*/React.createElement(IconCheckSolid, null);
|
|
33
35
|
|
|
@@ -151,7 +153,7 @@ export var MatchingTypeTable = (_dec = themeable(theme, styles), _dec(_class = (
|
|
|
151
153
|
var questionBody = extractedQuestionBody.trim().length > 0 ? extractedQuestionBody : question.body;
|
|
152
154
|
return /*#__PURE__*/React.createElement(Table.Row, {
|
|
153
155
|
key: rowKey
|
|
154
|
-
}, /*#__PURE__*/React.createElement(Table.
|
|
156
|
+
}, /*#__PURE__*/React.createElement(Table.RowHeader, {
|
|
155
157
|
id: questionRowHeaderId,
|
|
156
158
|
key: questionRowHeaderId,
|
|
157
159
|
theme: {
|
|
@@ -161,14 +163,21 @@ export var MatchingTypeTable = (_dec = themeable(theme, styles), _dec(_class = (
|
|
|
161
163
|
};
|
|
162
164
|
|
|
163
165
|
_this.render = function () {
|
|
164
|
-
var
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
166
|
+
var answerSummary = _this.props.answerSummary;
|
|
167
|
+
var questions = answerSummary.questions;
|
|
168
|
+
var questionKeys = Object.keys(questions);
|
|
169
|
+
var exampleAnswers = questions[questionKeys[0]].answers;
|
|
170
|
+
var answerKeys = Object.keys(exampleAnswers).sort();
|
|
171
|
+
var tableHalfWidth = answerKeys.length <= 3;
|
|
172
|
+
var orderedAnswerKeys = MatchingTypeOrderer.orderAnswerKeysForDiagonal(answerSummary, answerKeys);
|
|
173
|
+
var orderedQuestionKeys = MatchingTypeOrderer.orderQuestionKeysForDiagonal(answerSummary, questionKeys, orderedAnswerKeys);
|
|
174
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
175
|
+
className: classNames(styles.tableContainer, _defineProperty({}, styles.tableHalfWidth, tableHalfWidth))
|
|
176
|
+
}, /*#__PURE__*/React.createElement(Table, {
|
|
168
177
|
caption: t('Answer Frequency Summary')
|
|
169
178
|
}, /*#__PURE__*/React.createElement(Table.Head, null, _this.renderHeaderRow(orderedAnswerKeys)), /*#__PURE__*/React.createElement(Table.Body, null, orderedQuestionKeys.map(function (orderedQuestionKey) {
|
|
170
179
|
return _this.renderRow(orderedQuestionKey, orderedAnswerKeys);
|
|
171
|
-
})));
|
|
180
|
+
}))));
|
|
172
181
|
};
|
|
173
182
|
|
|
174
183
|
return _this;
|
|
@@ -177,7 +186,5 @@ export var MatchingTypeTable = (_dec = themeable(theme, styles), _dec(_class = (
|
|
|
177
186
|
return MatchingTypeTable;
|
|
178
187
|
}(Component), _class2.propTypes = {
|
|
179
188
|
itemId: PropTypes.number,
|
|
180
|
-
answerSummary: matchingTypeAnswerSummaryPropType
|
|
181
|
-
orderedAnswerKeys: PropTypes.array.isRequired,
|
|
182
|
-
orderedQuestionKeys: PropTypes.array.isRequired
|
|
189
|
+
answerSummary: matchingTypeAnswerSummaryPropType
|
|
183
190
|
}.isRequired, _temp)) || _class);
|
|
@@ -3,14 +3,13 @@ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
|
3
3
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
4
4
|
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
5
5
|
import React, { Component } from 'react';
|
|
6
|
-
import MatchingTypeOrderer from "./utils/matchingTypeOrderer.js";
|
|
7
6
|
import AfsTableWrapper from "../shared/AfsTableWrapper/index.js";
|
|
8
|
-
import MatchingTypeTable from "./MatchingTypeTable/index.js";
|
|
9
7
|
import PropTypes from 'prop-types';
|
|
10
8
|
import { matchingTypeAnswerSummaryPropType } from "../../propTypes.js";
|
|
11
9
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
12
|
-
import AggregationTable from "../shared/AggregationTable/index.js";
|
|
13
10
|
import { AfsPartsContainer } from "../shared/AfsPartsContainer/presenter.js";
|
|
11
|
+
import AggregationTable from "../shared/AggregationTable/index.js";
|
|
12
|
+
import MatchingTypeTable from "./MatchingTypeTable/index.js";
|
|
14
13
|
export var OrderingType = /*#__PURE__*/function (_Component) {
|
|
15
14
|
_inherits(OrderingType, _Component);
|
|
16
15
|
|
|
@@ -54,20 +53,10 @@ export var OrderingType = /*#__PURE__*/function (_Component) {
|
|
|
54
53
|
|
|
55
54
|
var updatedAnswerSummary = _this.updateAnswerBody(answerSummary);
|
|
56
55
|
|
|
57
|
-
var questions = updatedAnswerSummary.questions;
|
|
58
|
-
var questionKeys = Object.keys(questions);
|
|
59
|
-
var exampleAnswers = questions[questionKeys[0]].answers;
|
|
60
|
-
var answerKeys = Object.keys(exampleAnswers).sort();
|
|
61
|
-
var orderedAnswerKeys = MatchingTypeOrderer.orderAnswerKeysForDiagonal(updatedAnswerSummary, answerKeys);
|
|
62
|
-
var orderedQuestionKeys = MatchingTypeOrderer.orderQuestionKeysForDiagonal(updatedAnswerSummary, questionKeys, orderedAnswerKeys);
|
|
63
|
-
var tableHalfWidth = orderedAnswerKeys.length <= 3;
|
|
64
56
|
return /*#__PURE__*/React.createElement(AfsTableWrapper, null, /*#__PURE__*/React.createElement(AfsPartsContainer, {
|
|
65
|
-
tableHalfWidth: tableHalfWidth,
|
|
66
57
|
afsTable: /*#__PURE__*/React.createElement(MatchingTypeTable, {
|
|
67
58
|
itemId: itemId,
|
|
68
|
-
answerSummary: updatedAnswerSummary
|
|
69
|
-
orderedAnswerKeys: orderedAnswerKeys,
|
|
70
|
-
orderedQuestionKeys: orderedQuestionKeys
|
|
59
|
+
answerSummary: updatedAnswerSummary
|
|
71
60
|
}),
|
|
72
61
|
aggregationTable: /*#__PURE__*/React.createElement(AggregationTable, {
|
|
73
62
|
itemId: itemId,
|
|
@@ -82,6 +71,6 @@ export var OrderingType = /*#__PURE__*/function (_Component) {
|
|
|
82
71
|
return OrderingType;
|
|
83
72
|
}(Component);
|
|
84
73
|
OrderingType.propTypes = {
|
|
85
|
-
itemId: PropTypes.number,
|
|
86
|
-
answerSummary: matchingTypeAnswerSummaryPropType
|
|
74
|
+
itemId: PropTypes.number.isRequired,
|
|
75
|
+
answerSummary: matchingTypeAnswerSummaryPropType.isRequired
|
|
87
76
|
}.isRequired;
|
package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/presenter.js
CHANGED
|
@@ -5,8 +5,8 @@ import React, { Component } from 'react';
|
|
|
5
5
|
import { PropTypes } from '@instructure/quiz-interactions';
|
|
6
6
|
import ChoiceType from "./ChoiceType/index.js";
|
|
7
7
|
import AggregationType from "./AggregationType/index.js";
|
|
8
|
-
import { MatchingType, OrderingType } from "./MatchingType/index.js";
|
|
9
|
-
import { answerSummaryPropType } from "../propTypes.js";
|
|
8
|
+
import { MatchingType, OrderingType, CategorizationType } from "./MatchingType/index.js";
|
|
9
|
+
import { afsFlags, answerSummaryPropType } from "../propTypes.js";
|
|
10
10
|
export var AnswerFrequencySummary = /*#__PURE__*/function (_Component) {
|
|
11
11
|
_inherits(AnswerFrequencySummary, _Component);
|
|
12
12
|
|
|
@@ -40,6 +40,10 @@ export var AnswerFrequencySummary = /*#__PURE__*/function (_Component) {
|
|
|
40
40
|
if (afsFlags.orderingEnabled) {
|
|
41
41
|
_this.afsTableComponentMap.set('ordering', OrderingType);
|
|
42
42
|
}
|
|
43
|
+
|
|
44
|
+
if (afsFlags.categorizationEnabled) {
|
|
45
|
+
_this.afsTableComponentMap.set('categorization', CategorizationType);
|
|
46
|
+
}
|
|
43
47
|
};
|
|
44
48
|
|
|
45
49
|
_this.render = function () {
|
|
@@ -77,10 +81,5 @@ AnswerFrequencySummary.propTypes = {
|
|
|
77
81
|
itemId: PropTypes.number.isRequired,
|
|
78
82
|
answerSummary: answerSummaryPropType.isRequired,
|
|
79
83
|
interactionType: PropTypes.string.isRequired,
|
|
80
|
-
afsFlags:
|
|
81
|
-
formulaEnabled: PropTypes.bool.isRequired,
|
|
82
|
-
matchingEnabled: PropTypes.bool.isRequired,
|
|
83
|
-
hotSpotEnabled: PropTypes.bool.isRequired,
|
|
84
|
-
orderingEnabled: PropTypes.bool.isRequired
|
|
85
|
-
})
|
|
84
|
+
afsFlags: afsFlags
|
|
86
85
|
}.isRequired;
|
|
@@ -43,18 +43,14 @@ export var AfsPartsContainer = (_dec = themeable({}, styles), _dec(_class = (_te
|
|
|
43
43
|
};
|
|
44
44
|
|
|
45
45
|
_this.renderAfsTable = function () {
|
|
46
|
-
var
|
|
47
|
-
|
|
48
|
-
tableHalfWidth = _this$props2.tableHalfWidth;
|
|
49
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
50
|
-
className: classNames(_defineProperty({}, styles.tableContainer, tableHalfWidth))
|
|
51
|
-
}, afsTable);
|
|
46
|
+
var afsTable = _this.props.afsTable;
|
|
47
|
+
return /*#__PURE__*/React.createElement("div", null, afsTable);
|
|
52
48
|
};
|
|
53
49
|
|
|
54
50
|
_this.render = function () {
|
|
55
|
-
var _this$
|
|
56
|
-
afsTable = _this$
|
|
57
|
-
aggregationTable = _this$
|
|
51
|
+
var _this$props2 = _this.props,
|
|
52
|
+
afsTable = _this$props2.afsTable,
|
|
53
|
+
aggregationTable = _this$props2.aggregationTable;
|
|
58
54
|
return /*#__PURE__*/React.createElement(React.Fragment, null, afsTable && _this.renderAfsTable(), aggregationTable && _this.renderAggregationTable());
|
|
59
55
|
};
|
|
60
56
|
|
|
@@ -63,11 +59,9 @@ export var AfsPartsContainer = (_dec = themeable({}, styles), _dec(_class = (_te
|
|
|
63
59
|
|
|
64
60
|
return AfsPartsContainer;
|
|
65
61
|
}(Component), _class2.propTypes = {
|
|
66
|
-
tableHalfWidth: PropTypes.bool,
|
|
67
62
|
afsTable: PropTypes.node,
|
|
68
63
|
aggregationTable: PropTypes.node
|
|
69
64
|
}.isRequired, _class2.defaultProps = {
|
|
70
|
-
tableHalfWidth: true,
|
|
71
65
|
afsTable: null,
|
|
72
66
|
aggregationTable: null
|
|
73
67
|
}, _temp)) || _class);
|
|
@@ -14,27 +14,23 @@ import { IconCheckSolid, IconXSolid, IconNoSolid, IconOvalHalfSolid } from '@ins
|
|
|
14
14
|
import { themeable } from '@instructure/ui-themeable';
|
|
15
15
|
import theme from "./theme.js";
|
|
16
16
|
var styles = {
|
|
17
|
-
componentId: '
|
|
17
|
+
componentId: 'fXtvV',
|
|
18
18
|
template: function template(theme) {
|
|
19
|
-
return "\n\n.
|
|
19
|
+
return "\n\n.fXtvV_cvRx{align-items:center;display:flex;height:100%;justify-content:center;min-height:47px;width:46px}\n\n.fXtvV_fPIL{min-width:500px}\n\n.fXtvV_fPIL table{border-collapse:separate;border-spacing:0 12px}\n\n.fXtvV_fPIL thead th{border-color:".concat(theme.colorHeaderBottomBorder || 'inherit', ";border-style:solid;border-width:0 0 1px 0}\n\n.fXtvV_fPIL table tbody tr td{border-style:solid;border-width:2px 0 2px 0;width:33.33%}\n\n.fXtvV_fPIL table tbody tr th:first-child{border-radius:4px 0 0 4px;border-style:solid;border-width:2px 0 2px 2px;font-weight:400}\n\n.fXtvV_fPIL table tbody tr td:last-child{border-radius:0 4px 4px 0;border-style:solid;border-width:2px 2px 2px 0}\n\n.fXtvV_fZpZ table tbody tr:first-child td,.fXtvV_fZpZ table tbody tr:first-child th{border-color:").concat(theme.colorGreen || 'inherit', "}\n\n.fXtvV_fZpZ table tbody tr:nth-child(2) td,.fXtvV_fZpZ table tbody tr:nth-child(2) th{border-color:").concat(theme.colorRed || 'inherit', "}\n\n.fXtvV_dgTJ table tbody tr:first-child td,.fXtvV_dgTJ table tbody tr:first-child th{border-color:").concat(theme.colorGreen || 'inherit', "}\n\n.fXtvV_dgTJ table tbody tr:nth-child(2) td,.fXtvV_dgTJ table tbody tr:nth-child(2) th{border-color:").concat(theme.colorRed || 'inherit', "}\n\n.fXtvV_dgTJ table tbody tr:nth-child(3) td,.fXtvV_dgTJ table tbody tr:nth-child(3) th{border-color:").concat(theme.colorGrey || 'inherit', "}\n\n.fXtvV_bUPM table tbody tr:first-child td,.fXtvV_bUPM table tbody tr:first-child th{border-color:").concat(theme.colorGreen || 'inherit', "}\n\n.fXtvV_bUPM table tbody tr:nth-child(2) td,.fXtvV_bUPM table tbody tr:nth-child(2) th{border-color:").concat(theme.colorBlue || 'inherit', "}\n\n.fXtvV_bUPM table tbody tr:nth-child(3) td,.fXtvV_bUPM table tbody tr:nth-child(3) th{border-color:").concat(theme.colorRed || 'inherit', "}\n\n.fXtvV_bUPM table tbody tr:nth-child(4) td,.fXtvV_bUPM table tbody tr:nth-child(4) th{border-color:").concat(theme.colorGrey || 'inherit', "}\n\n.fXtvV_bvau{background-color:").concat(theme.colorGreen || 'inherit', "}\n\n.fXtvV_cxOH{background-color:").concat(theme.colorRed || 'inherit', "}\n\n.fXtvV_eRkO{background-color:").concat(theme.colorBlue || 'inherit', "}\n\n.fXtvV_eKcq{background-color:").concat(theme.colorGrey || 'inherit', "}\n\n.fXtvV_euQM{padding-left:10px}\n\n.fXtvV_fuuc{padding-left:45px}\n\n.fXtvV_vDgC svg{fill:#fff}\n\n.fXtvV_fHMm{border-color:").concat(theme.colorHeaderBottomBorder || 'inherit', ";border-style:solid;border-width:0 0 1px 0}");
|
|
20
20
|
},
|
|
21
|
-
'iconWrapper': '
|
|
22
|
-
'collapsingTable': '
|
|
23
|
-
'
|
|
24
|
-
'
|
|
25
|
-
'
|
|
26
|
-
'correctBackground': '
|
|
27
|
-
'
|
|
28
|
-
'
|
|
29
|
-
'
|
|
30
|
-
'
|
|
31
|
-
'
|
|
32
|
-
'
|
|
33
|
-
'
|
|
34
|
-
'headerCell': 'fuOpc_fHMm',
|
|
35
|
-
'firstCell': 'fuOpc_WspM',
|
|
36
|
-
'middleCell': 'fuOpc_fAnT',
|
|
37
|
-
'lastCell': 'fuOpc_bMPk'
|
|
21
|
+
'iconWrapper': 'fXtvV_cvRx',
|
|
22
|
+
'collapsingTable': 'fXtvV_fPIL',
|
|
23
|
+
'correctIncorrect': 'fXtvV_fZpZ',
|
|
24
|
+
'correctIncorrectNoanswer': 'fXtvV_dgTJ',
|
|
25
|
+
'correctIncorrectNoanswerPartial': 'fXtvV_bUPM',
|
|
26
|
+
'correctBackground': 'fXtvV_bvau',
|
|
27
|
+
'incorrectBackground': 'fXtvV_cxOH',
|
|
28
|
+
'partialCorrectBackground': 'fXtvV_eRkO',
|
|
29
|
+
'noAnswerBackground': 'fXtvV_eKcq',
|
|
30
|
+
'labelWrapper': 'fXtvV_euQM',
|
|
31
|
+
'firstHeaderCell': 'fXtvV_fuuc',
|
|
32
|
+
'iconWhite': 'fXtvV_vDgC',
|
|
33
|
+
'headerCell': 'fXtvV_fHMm'
|
|
38
34
|
};
|
|
39
35
|
import { Flex } from '@instructure/ui-flex';
|
|
40
36
|
import classNames from 'classnames';
|
|
@@ -87,45 +83,38 @@ export var AggregationTable = (_dec = themeable(theme, styles), _dec(_class = (_
|
|
|
87
83
|
};
|
|
88
84
|
|
|
89
85
|
_this.renderRow = function (key, icon, label, count, percentage) {
|
|
90
|
-
var borderColor = styles["".concat(key, "Border")];
|
|
91
86
|
var backgroundColor = styles["".concat(key, "Background")];
|
|
92
87
|
var concatenatedPercentage = "".concat(percentage, "%");
|
|
93
88
|
return /*#__PURE__*/React.createElement(Table.Row, {
|
|
94
89
|
key: key
|
|
95
|
-
}, /*#__PURE__*/React.createElement(Table.
|
|
90
|
+
}, /*#__PURE__*/React.createElement(Table.RowHeader, {
|
|
96
91
|
theme: {
|
|
97
92
|
padding: '0px'
|
|
98
93
|
}
|
|
99
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
100
|
-
className: classNames(styles.firstCell, borderColor)
|
|
101
94
|
}, /*#__PURE__*/React.createElement(ScreenReaderContent, null, label), /*#__PURE__*/React.createElement(Flex, {
|
|
102
95
|
direction: "row",
|
|
103
|
-
alignItems: "center"
|
|
104
|
-
height: "47px"
|
|
96
|
+
alignItems: "center"
|
|
105
97
|
}, /*#__PURE__*/React.createElement(Flex.Item, {
|
|
106
98
|
width: "46px",
|
|
107
|
-
textAlign: "center"
|
|
99
|
+
textAlign: "center",
|
|
100
|
+
align: "stretch"
|
|
108
101
|
}, /*#__PURE__*/React.createElement("div", {
|
|
109
102
|
className: classNames(styles.iconWrapper, styles.iconWhite, backgroundColor)
|
|
110
103
|
}, icon)), /*#__PURE__*/React.createElement(Flex.Item, {
|
|
111
|
-
|
|
104
|
+
shouldShrink: true
|
|
112
105
|
}, /*#__PURE__*/React.createElement("div", {
|
|
113
106
|
className: classNames(styles.labelWrapper)
|
|
114
|
-
}, /*#__PURE__*/React.createElement(Text, null, label)))))
|
|
107
|
+
}, /*#__PURE__*/React.createElement(Text, null, label))))), /*#__PURE__*/React.createElement(Table.Cell, {
|
|
115
108
|
theme: {
|
|
116
109
|
padding: '0px'
|
|
117
110
|
},
|
|
118
111
|
textAlign: "center"
|
|
119
|
-
}, /*#__PURE__*/React.createElement(
|
|
120
|
-
className: classNames(styles.middleCell, borderColor)
|
|
121
|
-
}, /*#__PURE__*/React.createElement(Text, null, count))), /*#__PURE__*/React.createElement(Table.Cell, {
|
|
112
|
+
}, /*#__PURE__*/React.createElement(Text, null, count)), /*#__PURE__*/React.createElement(Table.Cell, {
|
|
122
113
|
theme: {
|
|
123
114
|
padding: '0px'
|
|
124
115
|
},
|
|
125
116
|
textAlign: "center"
|
|
126
|
-
}, /*#__PURE__*/React.createElement(
|
|
127
|
-
className: classNames(styles.lastCell, borderColor)
|
|
128
|
-
}, /*#__PURE__*/React.createElement(Text, null, concatenatedPercentage))));
|
|
117
|
+
}, /*#__PURE__*/React.createElement(Text, null, concatenatedPercentage)));
|
|
129
118
|
};
|
|
130
119
|
|
|
131
120
|
_this.isPartialCorrectExist = function () {
|
|
@@ -133,6 +122,11 @@ export var AggregationTable = (_dec = themeable(theme, styles), _dec(_class = (_
|
|
|
133
122
|
return !!(aggregate === null || aggregate === void 0 ? void 0 : aggregate.partial_correct);
|
|
134
123
|
};
|
|
135
124
|
|
|
125
|
+
_this.isNoAnswerExist = function () {
|
|
126
|
+
var no_answer = _this.props.answerSummary.no_answer;
|
|
127
|
+
return !!no_answer;
|
|
128
|
+
};
|
|
129
|
+
|
|
136
130
|
_this.renderCorrect = function () {
|
|
137
131
|
var aggregate = _this.props.answerSummary.aggregate;
|
|
138
132
|
var correct = aggregate.correct;
|
|
@@ -168,12 +162,26 @@ export var AggregationTable = (_dec = themeable(theme, styles), _dec(_class = (_
|
|
|
168
162
|
return _this.renderRow(noAnswerKey, _ref4, noAnswerLabel, noAnswerCount, noAnswerPercentage);
|
|
169
163
|
};
|
|
170
164
|
|
|
165
|
+
_this.getColorProfile = function () {
|
|
166
|
+
var colorProfile;
|
|
167
|
+
|
|
168
|
+
if (!_this.isPartialCorrectExist() && _this.isNoAnswerExist()) {
|
|
169
|
+
colorProfile = 'correctIncorrectNoanswer';
|
|
170
|
+
} else if (_this.isPartialCorrectExist() && _this.isNoAnswerExist()) {
|
|
171
|
+
colorProfile = 'correctIncorrectNoanswerPartial';
|
|
172
|
+
} else {
|
|
173
|
+
colorProfile = 'correctIncorrect';
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
return colorProfile;
|
|
177
|
+
};
|
|
178
|
+
|
|
171
179
|
_this.render = function () {
|
|
172
180
|
return /*#__PURE__*/React.createElement("div", {
|
|
173
|
-
className: classNames(styles.collapsingTable)
|
|
181
|
+
className: classNames(styles.collapsingTable, styles[_this.getColorProfile()])
|
|
174
182
|
}, /*#__PURE__*/React.createElement(Table, {
|
|
175
183
|
caption: t('Answer Frequency Summary Aggregates')
|
|
176
|
-
}, _this.renderHeaderRow(), /*#__PURE__*/React.createElement(Table.Body, null, _this.renderCorrect(), _this.isPartialCorrectExist() && _this.renderPartialCorrect(), _this.renderIncorrect(), _this.renderNoAnswer())));
|
|
184
|
+
}, _this.renderHeaderRow(), /*#__PURE__*/React.createElement(Table.Body, null, _this.renderCorrect(), _this.isPartialCorrectExist() && _this.renderPartialCorrect(), _this.renderIncorrect(), _this.isNoAnswerExist() && _this.renderNoAnswer())));
|
|
177
185
|
};
|
|
178
186
|
|
|
179
187
|
return _this;
|
|
@@ -10,7 +10,8 @@ function mapStateToProps(_state) {
|
|
|
10
10
|
formulaEnabled: featureOn('ia_formula_afs'),
|
|
11
11
|
matchingEnabled: featureOn('ia_matching_afs'),
|
|
12
12
|
orderingEnabled: featureOn('ia_ordering_afs'),
|
|
13
|
-
hotSpotEnabled: featureOn('ia_hot_spot_afs')
|
|
13
|
+
hotSpotEnabled: featureOn('ia_hot_spot_afs'),
|
|
14
|
+
categorizationEnabled: featureOn('ia_categorization_afs')
|
|
14
15
|
}
|
|
15
16
|
};
|
|
16
17
|
}
|
|
@@ -84,5 +84,8 @@ export var matchingTypeAnswerSummaryPropType = PropTypes.shape({
|
|
|
84
84
|
export var answerSummaryPropType = PropTypes.oneOfType([choiceTypeAnswerSummaryPropType, onlyAggregatePropType, matchingTypeAnswerSummaryPropType]);
|
|
85
85
|
export var afsFlags = PropTypes.shape({
|
|
86
86
|
formulaEnabled: PropTypes.bool.isRequired,
|
|
87
|
-
matchingEnabled: PropTypes.bool.isRequired
|
|
87
|
+
matchingEnabled: PropTypes.bool.isRequired,
|
|
88
|
+
hotSpotEnabled: PropTypes.bool.isRequired,
|
|
89
|
+
orderingEnabled: PropTypes.bool.isRequired,
|
|
90
|
+
categorizationEnabled: PropTypes.bool.isRequired
|
|
88
91
|
});
|
|
@@ -19,14 +19,14 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
19
19
|
|
|
20
20
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
21
21
|
|
|
22
|
-
var _index = _interopRequireDefault(require("../shared/AggregationTable/index.js"));
|
|
23
|
-
|
|
24
22
|
var _propTypes2 = require("../../propTypes.js");
|
|
25
23
|
|
|
26
24
|
var _presenter = require("../shared/AfsTableWrapper/presenter.js");
|
|
27
25
|
|
|
28
26
|
var _presenter2 = require("../shared/AfsPartsContainer/presenter.js");
|
|
29
27
|
|
|
28
|
+
var _index = _interopRequireDefault(require("../shared/AggregationTable/index.js"));
|
|
29
|
+
|
|
30
30
|
var AggregationType = /*#__PURE__*/function (_Component) {
|
|
31
31
|
(0, _inherits2.default)(AggregationType, _Component);
|
|
32
32
|
|
|
@@ -111,23 +111,19 @@ var ChoiceTypeTableRow = (_dec = (0, _uiThemeable.themeable)(_theme.default, sty
|
|
|
111
111
|
key: _this.props.choiceIndex
|
|
112
112
|
}, /*#__PURE__*/_react.default.createElement(_uiTable.Table.Cell, {
|
|
113
113
|
theme: {
|
|
114
|
-
padding: '0px'
|
|
115
|
-
fontWeight: 'bold'
|
|
114
|
+
padding: '0px'
|
|
116
115
|
}
|
|
117
116
|
}, /*#__PURE__*/_react.default.createElement(_uiA11yContent.ScreenReaderContent, null, _this.answerLabel(correct)), _this.renderIcon(correct)), /*#__PURE__*/_react.default.createElement(_uiTable.Table.RowHeader, {
|
|
118
117
|
theme: {
|
|
119
|
-
padding: cellPadding
|
|
120
|
-
fontWeight: 'bold'
|
|
118
|
+
padding: cellPadding
|
|
121
119
|
}
|
|
122
120
|
}, _this.renderMiddleCell(correct, _this.extractChoiceText(choiceBody, correct))), /*#__PURE__*/_react.default.createElement(_uiTable.Table.Cell, {
|
|
123
121
|
theme: {
|
|
124
|
-
padding: cellPadding
|
|
125
|
-
fontWeight: 'bold'
|
|
122
|
+
padding: cellPadding
|
|
126
123
|
}
|
|
127
124
|
}, _this.renderMiddleCell(correct, _this.props.choice.count)), /*#__PURE__*/_react.default.createElement(_uiTable.Table.Cell, {
|
|
128
125
|
theme: {
|
|
129
|
-
padding: cellPadding
|
|
130
|
-
fontWeight: 'bold'
|
|
126
|
+
padding: cellPadding
|
|
131
127
|
},
|
|
132
128
|
textAlign: "center"
|
|
133
129
|
}, _this.renderLastCell(correct, "".concat(_this.props.choice.percentage, "%"))));
|
|
@@ -42,12 +42,12 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
42
42
|
var _dec, _class, _class2, _temp;
|
|
43
43
|
|
|
44
44
|
var styles = {
|
|
45
|
-
componentId: '
|
|
45
|
+
componentId: 'fxQkB',
|
|
46
46
|
template: function template(theme) {
|
|
47
|
-
return "\n\n.
|
|
47
|
+
return "\n\n.fxQkB_rMrG{display:flex;flex-basis:100%;flex-direction:column;padding-bottom:".concat(theme.tableBottomPadding || 'inherit', "}\n\n.fxQkB_SVtU{max-width:100%;width:calc(25% + 350px)}\n\n.fxQkB_SVtU table tbody tr th{font-weight:400}");
|
|
48
48
|
},
|
|
49
|
-
'tableWrapper': '
|
|
50
|
-
'tableContainer': '
|
|
49
|
+
'tableWrapper': 'fxQkB_rMrG',
|
|
50
|
+
'tableContainer': 'fxQkB_SVtU'
|
|
51
51
|
};
|
|
52
52
|
var ChoiceType = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
53
53
|
(0, _inherits2.default)(ChoiceType, _Component);
|
|
@@ -0,0 +1,99 @@
|
|
|
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.CategorizationType = void 0;
|
|
11
|
+
|
|
12
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
13
|
+
|
|
14
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
15
|
+
|
|
16
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
17
|
+
|
|
18
|
+
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
|
|
19
|
+
|
|
20
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
21
|
+
|
|
22
|
+
var _index = _interopRequireDefault(require("../shared/AfsTableWrapper/index.js"));
|
|
23
|
+
|
|
24
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
25
|
+
|
|
26
|
+
var _propTypes2 = require("../../propTypes.js");
|
|
27
|
+
|
|
28
|
+
var _formatMessage = _interopRequireDefault(require("@instructure/quiz-i18n/es/format-message"));
|
|
29
|
+
|
|
30
|
+
var _presenter = require("../shared/AfsPartsContainer/presenter.js");
|
|
31
|
+
|
|
32
|
+
var _index2 = _interopRequireDefault(require("./MatchingTypeTable/index.js"));
|
|
33
|
+
|
|
34
|
+
var _index3 = _interopRequireDefault(require("../shared/AggregationTable/index.js"));
|
|
35
|
+
|
|
36
|
+
var distractorKey = 'distractor';
|
|
37
|
+
var distractorTranslation = (0, _formatMessage.default)('Distractors');
|
|
38
|
+
|
|
39
|
+
var CategorizationType = /*#__PURE__*/function (_Component) {
|
|
40
|
+
(0, _inherits2.default)(CategorizationType, _Component);
|
|
41
|
+
|
|
42
|
+
var _super = (0, _createSuper2.default)(CategorizationType);
|
|
43
|
+
|
|
44
|
+
function CategorizationType() {
|
|
45
|
+
var _this;
|
|
46
|
+
|
|
47
|
+
(0, _classCallCheck2.default)(this, CategorizationType);
|
|
48
|
+
|
|
49
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
50
|
+
args[_key] = arguments[_key];
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
54
|
+
|
|
55
|
+
_this.updateAnswerBody = function (answerSummary) {
|
|
56
|
+
var answerSummaryCopy = (0, _objectSpread2.default)({}, answerSummary);
|
|
57
|
+
Object.keys(answerSummaryCopy.questions).forEach(function (questionKey) {
|
|
58
|
+
Object.keys(answerSummaryCopy.questions[questionKey].answers).forEach(function (answerKey) {
|
|
59
|
+
if (distractorKey === answerKey) {
|
|
60
|
+
var detail = answerSummaryCopy.questions[questionKey].answers[answerKey];
|
|
61
|
+
answerSummaryCopy.questions[questionKey].answers[answerKey] = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, detail), {}, {
|
|
62
|
+
body: distractorTranslation
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
return answerSummaryCopy;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
_this.render = function () {
|
|
71
|
+
var _this$props = _this.props,
|
|
72
|
+
itemId = _this$props.itemId,
|
|
73
|
+
answerSummary = _this$props.answerSummary;
|
|
74
|
+
|
|
75
|
+
var updatedAnswerSummary = _this.updateAnswerBody(answerSummary);
|
|
76
|
+
|
|
77
|
+
return /*#__PURE__*/_react.default.createElement(_index.default, null, /*#__PURE__*/_react.default.createElement(_presenter.AfsPartsContainer, {
|
|
78
|
+
afsTable: /*#__PURE__*/_react.default.createElement(_index2.default, {
|
|
79
|
+
itemId: itemId,
|
|
80
|
+
answerSummary: updatedAnswerSummary
|
|
81
|
+
}),
|
|
82
|
+
aggregationTable: /*#__PURE__*/_react.default.createElement(_index3.default, {
|
|
83
|
+
itemId: itemId,
|
|
84
|
+
answerSummary: updatedAnswerSummary
|
|
85
|
+
})
|
|
86
|
+
}));
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
return _this;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
return CategorizationType;
|
|
93
|
+
}(_react.Component);
|
|
94
|
+
|
|
95
|
+
exports.CategorizationType = CategorizationType;
|
|
96
|
+
CategorizationType.propTypes = {
|
|
97
|
+
itemId: _propTypes.default.number.isRequired,
|
|
98
|
+
answerSummary: _propTypes2.matchingTypeAnswerSummaryPropType.isRequired
|
|
99
|
+
}.isRequired;
|
|
@@ -19,16 +19,14 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
19
19
|
|
|
20
20
|
var _index = _interopRequireDefault(require("../shared/AfsTableWrapper/index.js"));
|
|
21
21
|
|
|
22
|
-
var _index2 = _interopRequireDefault(require("./MatchingTypeTable/index.js"));
|
|
23
|
-
|
|
24
22
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
25
23
|
|
|
26
24
|
var _propTypes2 = require("../../propTypes.js");
|
|
27
25
|
|
|
28
|
-
var _matchingTypeOrderer = _interopRequireDefault(require("./utils/matchingTypeOrderer.js"));
|
|
29
|
-
|
|
30
26
|
var _presenter = require("../shared/AfsPartsContainer/presenter.js");
|
|
31
27
|
|
|
28
|
+
var _index2 = _interopRequireDefault(require("./MatchingTypeTable/index.js"));
|
|
29
|
+
|
|
32
30
|
var _index3 = _interopRequireDefault(require("../shared/AggregationTable/index.js"));
|
|
33
31
|
|
|
34
32
|
var MatchingType = /*#__PURE__*/function (_Component) {
|
|
@@ -51,23 +49,10 @@ var MatchingType = /*#__PURE__*/function (_Component) {
|
|
|
51
49
|
var _this$props = _this.props,
|
|
52
50
|
itemId = _this$props.itemId,
|
|
53
51
|
answerSummary = _this$props.answerSummary;
|
|
54
|
-
var questions = answerSummary.questions;
|
|
55
|
-
var questionKeys = Object.keys(questions);
|
|
56
|
-
var exampleAnswers = questions[questionKeys[0]].answers;
|
|
57
|
-
var answerKeys = Object.keys(exampleAnswers);
|
|
58
|
-
|
|
59
|
-
var orderedAnswerKeys = _matchingTypeOrderer.default.orderAnswerKeysForDiagonal(answerSummary, answerKeys);
|
|
60
|
-
|
|
61
|
-
var orderedQuestionKeys = _matchingTypeOrderer.default.orderQuestionKeysForDiagonal(answerSummary, questionKeys, orderedAnswerKeys);
|
|
62
|
-
|
|
63
|
-
var tableHalfWidth = orderedAnswerKeys.length <= 3;
|
|
64
52
|
return /*#__PURE__*/_react.default.createElement(_index.default, null, /*#__PURE__*/_react.default.createElement(_presenter.AfsPartsContainer, {
|
|
65
|
-
tableHalfWidth: tableHalfWidth,
|
|
66
53
|
afsTable: /*#__PURE__*/_react.default.createElement(_index2.default, {
|
|
67
54
|
itemId: itemId,
|
|
68
|
-
answerSummary: answerSummary
|
|
69
|
-
orderedAnswerKeys: orderedAnswerKeys,
|
|
70
|
-
orderedQuestionKeys: orderedQuestionKeys
|
|
55
|
+
answerSummary: answerSummary
|
|
71
56
|
}),
|
|
72
57
|
aggregationTable: /*#__PURE__*/_react.default.createElement(_index3.default, {
|
|
73
58
|
itemId: itemId,
|
|
@@ -84,6 +69,6 @@ var MatchingType = /*#__PURE__*/function (_Component) {
|
|
|
84
69
|
|
|
85
70
|
exports.MatchingType = MatchingType;
|
|
86
71
|
MatchingType.propTypes = {
|
|
87
|
-
itemId: _propTypes.default.number,
|
|
88
|
-
answerSummary: _propTypes2.matchingTypeAnswerSummaryPropType
|
|
72
|
+
itemId: _propTypes.default.number.isRequired,
|
|
73
|
+
answerSummary: _propTypes2.matchingTypeAnswerSummaryPropType.isRequired
|
|
89
74
|
}.isRequired;
|
|
@@ -33,25 +33,28 @@ var _uiIcons = require("@instructure/ui-icons");
|
|
|
33
33
|
|
|
34
34
|
var _propTypes2 = require("../../../propTypes.js");
|
|
35
35
|
|
|
36
|
+
var _matchingTypeOrderer = _interopRequireDefault(require("../utils/matchingTypeOrderer.js"));
|
|
37
|
+
|
|
38
|
+
var _quizInteractions = require("@instructure/quiz-interactions");
|
|
39
|
+
|
|
36
40
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
37
41
|
|
|
38
42
|
var _theme = _interopRequireDefault(require("./theme.js"));
|
|
39
43
|
|
|
40
|
-
var _quizInteractions = require("@instructure/quiz-interactions");
|
|
41
|
-
|
|
42
44
|
var _dec, _class, _class2, _temp;
|
|
43
45
|
|
|
44
46
|
var styles = {
|
|
45
|
-
componentId: '
|
|
47
|
+
componentId: 'bdaoA',
|
|
46
48
|
template: function template(theme) {
|
|
47
|
-
return "\n\n.
|
|
49
|
+
return "\n\n.bdaoA_rMrG{display:flex;flex-basis:100%;flex-direction:column;padding-bottom:".concat(theme.tableBottomPadding || 'inherit', "}\n\n.bdaoA_cvRx{align-items:center;display:flex;height:48px;justify-content:center;width:46px}\n\n.bdaoA_EKAb{background-color:").concat(theme.colorGreen || 'inherit', "}\n\n.bdaoA_EKAb svg{fill:#fff}\n\n.bdaoA_tnta{border-color:").concat(theme.colorGreen || 'inherit', ";border-style:solid;border-width:2px 0}\n\n.bdaoA_fvqY{border-radius:4px 4px 4px 4px;border-width:2px 2px 2px 2px}\n\n.bdaoA_bwoZ{max-width:100%;width:calc(25% + 350px)}\n\n.bdaoA_SVtU table tbody tr th{font-weight:400}");
|
|
48
50
|
},
|
|
49
|
-
'tableWrapper': '
|
|
50
|
-
'iconWrapper': '
|
|
51
|
-
'iconCorrect': '
|
|
52
|
-
'correctRowBorder': '
|
|
53
|
-
'correctRowBorderRadius': '
|
|
54
|
-
'
|
|
51
|
+
'tableWrapper': 'bdaoA_rMrG',
|
|
52
|
+
'iconWrapper': 'bdaoA_cvRx',
|
|
53
|
+
'iconCorrect': 'bdaoA_EKAb',
|
|
54
|
+
'correctRowBorder': 'bdaoA_tnta',
|
|
55
|
+
'correctRowBorderRadius': 'bdaoA_fvqY',
|
|
56
|
+
'tableHalfWidth': 'bdaoA_bwoZ',
|
|
57
|
+
'tableContainer': 'bdaoA_SVtU'
|
|
55
58
|
};
|
|
56
59
|
|
|
57
60
|
var _ref = /*#__PURE__*/_react.default.createElement(_uiIcons.IconCheckSolid, null);
|
|
@@ -176,7 +179,7 @@ var MatchingTypeTable = (_dec = (0, _uiThemeable.themeable)(_theme.default, styl
|
|
|
176
179
|
var questionBody = extractedQuestionBody.trim().length > 0 ? extractedQuestionBody : question.body;
|
|
177
180
|
return /*#__PURE__*/_react.default.createElement(_uiTable.Table.Row, {
|
|
178
181
|
key: rowKey
|
|
179
|
-
}, /*#__PURE__*/_react.default.createElement(_uiTable.Table.
|
|
182
|
+
}, /*#__PURE__*/_react.default.createElement(_uiTable.Table.RowHeader, {
|
|
180
183
|
id: questionRowHeaderId,
|
|
181
184
|
key: questionRowHeaderId,
|
|
182
185
|
theme: {
|
|
@@ -186,14 +189,24 @@ var MatchingTypeTable = (_dec = (0, _uiThemeable.themeable)(_theme.default, styl
|
|
|
186
189
|
};
|
|
187
190
|
|
|
188
191
|
_this.render = function () {
|
|
189
|
-
var
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
192
|
+
var answerSummary = _this.props.answerSummary;
|
|
193
|
+
var questions = answerSummary.questions;
|
|
194
|
+
var questionKeys = Object.keys(questions);
|
|
195
|
+
var exampleAnswers = questions[questionKeys[0]].answers;
|
|
196
|
+
var answerKeys = Object.keys(exampleAnswers).sort();
|
|
197
|
+
var tableHalfWidth = answerKeys.length <= 3;
|
|
198
|
+
|
|
199
|
+
var orderedAnswerKeys = _matchingTypeOrderer.default.orderAnswerKeysForDiagonal(answerSummary, answerKeys);
|
|
200
|
+
|
|
201
|
+
var orderedQuestionKeys = _matchingTypeOrderer.default.orderQuestionKeysForDiagonal(answerSummary, questionKeys, orderedAnswerKeys);
|
|
202
|
+
|
|
203
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
204
|
+
className: (0, _classnames.default)(styles.tableContainer, (0, _defineProperty2.default)({}, styles.tableHalfWidth, tableHalfWidth))
|
|
205
|
+
}, /*#__PURE__*/_react.default.createElement(_uiTable.Table, {
|
|
193
206
|
caption: (0, _formatMessage.default)('Answer Frequency Summary')
|
|
194
207
|
}, /*#__PURE__*/_react.default.createElement(_uiTable.Table.Head, null, _this.renderHeaderRow(orderedAnswerKeys)), /*#__PURE__*/_react.default.createElement(_uiTable.Table.Body, null, orderedQuestionKeys.map(function (orderedQuestionKey) {
|
|
195
208
|
return _this.renderRow(orderedQuestionKey, orderedAnswerKeys);
|
|
196
|
-
})));
|
|
209
|
+
}))));
|
|
197
210
|
};
|
|
198
211
|
|
|
199
212
|
return _this;
|
|
@@ -202,8 +215,6 @@ var MatchingTypeTable = (_dec = (0, _uiThemeable.themeable)(_theme.default, styl
|
|
|
202
215
|
return MatchingTypeTable;
|
|
203
216
|
}(_react.Component), _class2.propTypes = {
|
|
204
217
|
itemId: _propTypes.default.number,
|
|
205
|
-
answerSummary: _propTypes2.matchingTypeAnswerSummaryPropType
|
|
206
|
-
orderedAnswerKeys: _propTypes.default.array.isRequired,
|
|
207
|
-
orderedQuestionKeys: _propTypes.default.array.isRequired
|
|
218
|
+
answerSummary: _propTypes2.matchingTypeAnswerSummaryPropType
|
|
208
219
|
}.isRequired, _temp)) || _class);
|
|
209
220
|
exports.MatchingTypeTable = MatchingTypeTable;
|
|
@@ -19,22 +19,20 @@ var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/creat
|
|
|
19
19
|
|
|
20
20
|
var _react = _interopRequireWildcard(require("react"));
|
|
21
21
|
|
|
22
|
-
var _matchingTypeOrderer = _interopRequireDefault(require("./utils/matchingTypeOrderer.js"));
|
|
23
|
-
|
|
24
22
|
var _index = _interopRequireDefault(require("../shared/AfsTableWrapper/index.js"));
|
|
25
23
|
|
|
26
|
-
var _index2 = _interopRequireDefault(require("./MatchingTypeTable/index.js"));
|
|
27
|
-
|
|
28
24
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
29
25
|
|
|
30
26
|
var _propTypes2 = require("../../propTypes.js");
|
|
31
27
|
|
|
32
28
|
var _formatMessage = _interopRequireDefault(require("@instructure/quiz-i18n/es/format-message"));
|
|
33
29
|
|
|
34
|
-
var _index3 = _interopRequireDefault(require("../shared/AggregationTable/index.js"));
|
|
35
|
-
|
|
36
30
|
var _presenter = require("../shared/AfsPartsContainer/presenter.js");
|
|
37
31
|
|
|
32
|
+
var _index2 = _interopRequireDefault(require("../shared/AggregationTable/index.js"));
|
|
33
|
+
|
|
34
|
+
var _index3 = _interopRequireDefault(require("./MatchingTypeTable/index.js"));
|
|
35
|
+
|
|
38
36
|
var OrderingType = /*#__PURE__*/function (_Component) {
|
|
39
37
|
(0, _inherits2.default)(OrderingType, _Component);
|
|
40
38
|
|
|
@@ -77,25 +75,12 @@ var OrderingType = /*#__PURE__*/function (_Component) {
|
|
|
77
75
|
|
|
78
76
|
var updatedAnswerSummary = _this.updateAnswerBody(answerSummary);
|
|
79
77
|
|
|
80
|
-
var questions = updatedAnswerSummary.questions;
|
|
81
|
-
var questionKeys = Object.keys(questions);
|
|
82
|
-
var exampleAnswers = questions[questionKeys[0]].answers;
|
|
83
|
-
var answerKeys = Object.keys(exampleAnswers).sort();
|
|
84
|
-
|
|
85
|
-
var orderedAnswerKeys = _matchingTypeOrderer.default.orderAnswerKeysForDiagonal(updatedAnswerSummary, answerKeys);
|
|
86
|
-
|
|
87
|
-
var orderedQuestionKeys = _matchingTypeOrderer.default.orderQuestionKeysForDiagonal(updatedAnswerSummary, questionKeys, orderedAnswerKeys);
|
|
88
|
-
|
|
89
|
-
var tableHalfWidth = orderedAnswerKeys.length <= 3;
|
|
90
78
|
return /*#__PURE__*/_react.default.createElement(_index.default, null, /*#__PURE__*/_react.default.createElement(_presenter.AfsPartsContainer, {
|
|
91
|
-
|
|
92
|
-
afsTable: /*#__PURE__*/_react.default.createElement(_index2.default, {
|
|
79
|
+
afsTable: /*#__PURE__*/_react.default.createElement(_index3.default, {
|
|
93
80
|
itemId: itemId,
|
|
94
|
-
answerSummary: updatedAnswerSummary
|
|
95
|
-
orderedAnswerKeys: orderedAnswerKeys,
|
|
96
|
-
orderedQuestionKeys: orderedQuestionKeys
|
|
81
|
+
answerSummary: updatedAnswerSummary
|
|
97
82
|
}),
|
|
98
|
-
aggregationTable: /*#__PURE__*/_react.default.createElement(
|
|
83
|
+
aggregationTable: /*#__PURE__*/_react.default.createElement(_index2.default, {
|
|
99
84
|
itemId: itemId,
|
|
100
85
|
answerSummary: updatedAnswerSummary
|
|
101
86
|
})
|
|
@@ -110,6 +95,6 @@ var OrderingType = /*#__PURE__*/function (_Component) {
|
|
|
110
95
|
|
|
111
96
|
exports.OrderingType = OrderingType;
|
|
112
97
|
OrderingType.propTypes = {
|
|
113
|
-
itemId: _propTypes.default.number,
|
|
114
|
-
answerSummary: _propTypes2.matchingTypeAnswerSummaryPropType
|
|
98
|
+
itemId: _propTypes.default.number.isRequired,
|
|
99
|
+
answerSummary: _propTypes2.matchingTypeAnswerSummaryPropType.isRequired
|
|
115
100
|
}.isRequired;
|
|
@@ -15,7 +15,15 @@ Object.defineProperty(exports, "OrderingType", {
|
|
|
15
15
|
return _OrderingType.OrderingType;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
|
+
Object.defineProperty(exports, "CategorizationType", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function get() {
|
|
21
|
+
return _CategorizationType.CategorizationType;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
18
24
|
|
|
19
25
|
var _MatchingType = require("./MatchingType.js");
|
|
20
26
|
|
|
21
|
-
var _OrderingType = require("./OrderingType.js");
|
|
27
|
+
var _OrderingType = require("./OrderingType.js");
|
|
28
|
+
|
|
29
|
+
var _CategorizationType = require("./CategorizationType.js");
|
|
@@ -60,6 +60,10 @@ var AnswerFrequencySummary = /*#__PURE__*/function (_Component) {
|
|
|
60
60
|
if (afsFlags.orderingEnabled) {
|
|
61
61
|
_this.afsTableComponentMap.set('ordering', _index3.OrderingType);
|
|
62
62
|
}
|
|
63
|
+
|
|
64
|
+
if (afsFlags.categorizationEnabled) {
|
|
65
|
+
_this.afsTableComponentMap.set('categorization', _index3.CategorizationType);
|
|
66
|
+
}
|
|
63
67
|
};
|
|
64
68
|
|
|
65
69
|
_this.render = function () {
|
|
@@ -99,10 +103,5 @@ AnswerFrequencySummary.propTypes = {
|
|
|
99
103
|
itemId: _quizInteractions.PropTypes.number.isRequired,
|
|
100
104
|
answerSummary: _propTypes.answerSummaryPropType.isRequired,
|
|
101
105
|
interactionType: _quizInteractions.PropTypes.string.isRequired,
|
|
102
|
-
afsFlags:
|
|
103
|
-
formulaEnabled: _quizInteractions.PropTypes.bool.isRequired,
|
|
104
|
-
matchingEnabled: _quizInteractions.PropTypes.bool.isRequired,
|
|
105
|
-
hotSpotEnabled: _quizInteractions.PropTypes.bool.isRequired,
|
|
106
|
-
orderingEnabled: _quizInteractions.PropTypes.bool.isRequired
|
|
107
|
-
})
|
|
106
|
+
afsFlags: _propTypes.afsFlags
|
|
108
107
|
}.isRequired;
|
|
@@ -61,18 +61,14 @@ var AfsPartsContainer = (_dec = (0, _uiThemeable.themeable)({}, styles), _dec(_c
|
|
|
61
61
|
};
|
|
62
62
|
|
|
63
63
|
_this.renderAfsTable = function () {
|
|
64
|
-
var
|
|
65
|
-
|
|
66
|
-
tableHalfWidth = _this$props2.tableHalfWidth;
|
|
67
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
68
|
-
className: (0, _classnames.default)((0, _defineProperty2.default)({}, styles.tableContainer, tableHalfWidth))
|
|
69
|
-
}, afsTable);
|
|
64
|
+
var afsTable = _this.props.afsTable;
|
|
65
|
+
return /*#__PURE__*/_react.default.createElement("div", null, afsTable);
|
|
70
66
|
};
|
|
71
67
|
|
|
72
68
|
_this.render = function () {
|
|
73
|
-
var _this$
|
|
74
|
-
afsTable = _this$
|
|
75
|
-
aggregationTable = _this$
|
|
69
|
+
var _this$props2 = _this.props,
|
|
70
|
+
afsTable = _this$props2.afsTable,
|
|
71
|
+
aggregationTable = _this$props2.aggregationTable;
|
|
76
72
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, afsTable && _this.renderAfsTable(), aggregationTable && _this.renderAggregationTable());
|
|
77
73
|
};
|
|
78
74
|
|
|
@@ -81,11 +77,9 @@ var AfsPartsContainer = (_dec = (0, _uiThemeable.themeable)({}, styles), _dec(_c
|
|
|
81
77
|
|
|
82
78
|
return AfsPartsContainer;
|
|
83
79
|
}(_react.Component), _class2.propTypes = {
|
|
84
|
-
tableHalfWidth: _propTypes.default.bool,
|
|
85
80
|
afsTable: _propTypes.default.node,
|
|
86
81
|
aggregationTable: _propTypes.default.node
|
|
87
82
|
}.isRequired, _class2.defaultProps = {
|
|
88
|
-
tableHalfWidth: true,
|
|
89
83
|
afsTable: null,
|
|
90
84
|
aggregationTable: null
|
|
91
85
|
}, _temp)) || _class);
|
|
@@ -42,27 +42,23 @@ var _uiText = require("@instructure/ui-text");
|
|
|
42
42
|
var _dec, _class, _class2, _temp;
|
|
43
43
|
|
|
44
44
|
var styles = {
|
|
45
|
-
componentId: '
|
|
45
|
+
componentId: 'fXtvV',
|
|
46
46
|
template: function template(theme) {
|
|
47
|
-
return "\n\n.
|
|
47
|
+
return "\n\n.fXtvV_cvRx{align-items:center;display:flex;height:100%;justify-content:center;min-height:47px;width:46px}\n\n.fXtvV_fPIL{min-width:500px}\n\n.fXtvV_fPIL table{border-collapse:separate;border-spacing:0 12px}\n\n.fXtvV_fPIL thead th{border-color:".concat(theme.colorHeaderBottomBorder || 'inherit', ";border-style:solid;border-width:0 0 1px 0}\n\n.fXtvV_fPIL table tbody tr td{border-style:solid;border-width:2px 0 2px 0;width:33.33%}\n\n.fXtvV_fPIL table tbody tr th:first-child{border-radius:4px 0 0 4px;border-style:solid;border-width:2px 0 2px 2px;font-weight:400}\n\n.fXtvV_fPIL table tbody tr td:last-child{border-radius:0 4px 4px 0;border-style:solid;border-width:2px 2px 2px 0}\n\n.fXtvV_fZpZ table tbody tr:first-child td,.fXtvV_fZpZ table tbody tr:first-child th{border-color:").concat(theme.colorGreen || 'inherit', "}\n\n.fXtvV_fZpZ table tbody tr:nth-child(2) td,.fXtvV_fZpZ table tbody tr:nth-child(2) th{border-color:").concat(theme.colorRed || 'inherit', "}\n\n.fXtvV_dgTJ table tbody tr:first-child td,.fXtvV_dgTJ table tbody tr:first-child th{border-color:").concat(theme.colorGreen || 'inherit', "}\n\n.fXtvV_dgTJ table tbody tr:nth-child(2) td,.fXtvV_dgTJ table tbody tr:nth-child(2) th{border-color:").concat(theme.colorRed || 'inherit', "}\n\n.fXtvV_dgTJ table tbody tr:nth-child(3) td,.fXtvV_dgTJ table tbody tr:nth-child(3) th{border-color:").concat(theme.colorGrey || 'inherit', "}\n\n.fXtvV_bUPM table tbody tr:first-child td,.fXtvV_bUPM table tbody tr:first-child th{border-color:").concat(theme.colorGreen || 'inherit', "}\n\n.fXtvV_bUPM table tbody tr:nth-child(2) td,.fXtvV_bUPM table tbody tr:nth-child(2) th{border-color:").concat(theme.colorBlue || 'inherit', "}\n\n.fXtvV_bUPM table tbody tr:nth-child(3) td,.fXtvV_bUPM table tbody tr:nth-child(3) th{border-color:").concat(theme.colorRed || 'inherit', "}\n\n.fXtvV_bUPM table tbody tr:nth-child(4) td,.fXtvV_bUPM table tbody tr:nth-child(4) th{border-color:").concat(theme.colorGrey || 'inherit', "}\n\n.fXtvV_bvau{background-color:").concat(theme.colorGreen || 'inherit', "}\n\n.fXtvV_cxOH{background-color:").concat(theme.colorRed || 'inherit', "}\n\n.fXtvV_eRkO{background-color:").concat(theme.colorBlue || 'inherit', "}\n\n.fXtvV_eKcq{background-color:").concat(theme.colorGrey || 'inherit', "}\n\n.fXtvV_euQM{padding-left:10px}\n\n.fXtvV_fuuc{padding-left:45px}\n\n.fXtvV_vDgC svg{fill:#fff}\n\n.fXtvV_fHMm{border-color:").concat(theme.colorHeaderBottomBorder || 'inherit', ";border-style:solid;border-width:0 0 1px 0}");
|
|
48
48
|
},
|
|
49
|
-
'iconWrapper': '
|
|
50
|
-
'collapsingTable': '
|
|
51
|
-
'
|
|
52
|
-
'
|
|
53
|
-
'
|
|
54
|
-
'correctBackground': '
|
|
55
|
-
'
|
|
56
|
-
'
|
|
57
|
-
'
|
|
58
|
-
'
|
|
59
|
-
'
|
|
60
|
-
'
|
|
61
|
-
'
|
|
62
|
-
'headerCell': 'fuOpc_fHMm',
|
|
63
|
-
'firstCell': 'fuOpc_WspM',
|
|
64
|
-
'middleCell': 'fuOpc_fAnT',
|
|
65
|
-
'lastCell': 'fuOpc_bMPk'
|
|
49
|
+
'iconWrapper': 'fXtvV_cvRx',
|
|
50
|
+
'collapsingTable': 'fXtvV_fPIL',
|
|
51
|
+
'correctIncorrect': 'fXtvV_fZpZ',
|
|
52
|
+
'correctIncorrectNoanswer': 'fXtvV_dgTJ',
|
|
53
|
+
'correctIncorrectNoanswerPartial': 'fXtvV_bUPM',
|
|
54
|
+
'correctBackground': 'fXtvV_bvau',
|
|
55
|
+
'incorrectBackground': 'fXtvV_cxOH',
|
|
56
|
+
'partialCorrectBackground': 'fXtvV_eRkO',
|
|
57
|
+
'noAnswerBackground': 'fXtvV_eKcq',
|
|
58
|
+
'labelWrapper': 'fXtvV_euQM',
|
|
59
|
+
'firstHeaderCell': 'fXtvV_fuuc',
|
|
60
|
+
'iconWhite': 'fXtvV_vDgC',
|
|
61
|
+
'headerCell': 'fXtvV_fHMm'
|
|
66
62
|
};
|
|
67
63
|
var noAnswerKey = 'noAnswer';
|
|
68
64
|
var incorrectKey = 'incorrect';
|
|
@@ -112,45 +108,38 @@ var AggregationTable = (_dec = (0, _uiThemeable.themeable)(_theme.default, style
|
|
|
112
108
|
};
|
|
113
109
|
|
|
114
110
|
_this.renderRow = function (key, icon, label, count, percentage) {
|
|
115
|
-
var borderColor = styles["".concat(key, "Border")];
|
|
116
111
|
var backgroundColor = styles["".concat(key, "Background")];
|
|
117
112
|
var concatenatedPercentage = "".concat(percentage, "%");
|
|
118
113
|
return /*#__PURE__*/_react.default.createElement(_uiTable.Table.Row, {
|
|
119
114
|
key: key
|
|
120
|
-
}, /*#__PURE__*/_react.default.createElement(_uiTable.Table.
|
|
115
|
+
}, /*#__PURE__*/_react.default.createElement(_uiTable.Table.RowHeader, {
|
|
121
116
|
theme: {
|
|
122
117
|
padding: '0px'
|
|
123
118
|
}
|
|
124
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
125
|
-
className: (0, _classnames.default)(styles.firstCell, borderColor)
|
|
126
119
|
}, /*#__PURE__*/_react.default.createElement(_uiA11yContent.ScreenReaderContent, null, label), /*#__PURE__*/_react.default.createElement(_uiFlex.Flex, {
|
|
127
120
|
direction: "row",
|
|
128
|
-
alignItems: "center"
|
|
129
|
-
height: "47px"
|
|
121
|
+
alignItems: "center"
|
|
130
122
|
}, /*#__PURE__*/_react.default.createElement(_uiFlex.Flex.Item, {
|
|
131
123
|
width: "46px",
|
|
132
|
-
textAlign: "center"
|
|
124
|
+
textAlign: "center",
|
|
125
|
+
align: "stretch"
|
|
133
126
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
134
127
|
className: (0, _classnames.default)(styles.iconWrapper, styles.iconWhite, backgroundColor)
|
|
135
128
|
}, icon)), /*#__PURE__*/_react.default.createElement(_uiFlex.Flex.Item, {
|
|
136
|
-
|
|
129
|
+
shouldShrink: true
|
|
137
130
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
138
131
|
className: (0, _classnames.default)(styles.labelWrapper)
|
|
139
|
-
}, /*#__PURE__*/_react.default.createElement(_uiText.Text, null, label)))))
|
|
132
|
+
}, /*#__PURE__*/_react.default.createElement(_uiText.Text, null, label))))), /*#__PURE__*/_react.default.createElement(_uiTable.Table.Cell, {
|
|
140
133
|
theme: {
|
|
141
134
|
padding: '0px'
|
|
142
135
|
},
|
|
143
136
|
textAlign: "center"
|
|
144
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
145
|
-
className: (0, _classnames.default)(styles.middleCell, borderColor)
|
|
146
|
-
}, /*#__PURE__*/_react.default.createElement(_uiText.Text, null, count))), /*#__PURE__*/_react.default.createElement(_uiTable.Table.Cell, {
|
|
137
|
+
}, /*#__PURE__*/_react.default.createElement(_uiText.Text, null, count)), /*#__PURE__*/_react.default.createElement(_uiTable.Table.Cell, {
|
|
147
138
|
theme: {
|
|
148
139
|
padding: '0px'
|
|
149
140
|
},
|
|
150
141
|
textAlign: "center"
|
|
151
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
152
|
-
className: (0, _classnames.default)(styles.lastCell, borderColor)
|
|
153
|
-
}, /*#__PURE__*/_react.default.createElement(_uiText.Text, null, concatenatedPercentage))));
|
|
142
|
+
}, /*#__PURE__*/_react.default.createElement(_uiText.Text, null, concatenatedPercentage)));
|
|
154
143
|
};
|
|
155
144
|
|
|
156
145
|
_this.isPartialCorrectExist = function () {
|
|
@@ -158,6 +147,11 @@ var AggregationTable = (_dec = (0, _uiThemeable.themeable)(_theme.default, style
|
|
|
158
147
|
return !!(aggregate === null || aggregate === void 0 ? void 0 : aggregate.partial_correct);
|
|
159
148
|
};
|
|
160
149
|
|
|
150
|
+
_this.isNoAnswerExist = function () {
|
|
151
|
+
var no_answer = _this.props.answerSummary.no_answer;
|
|
152
|
+
return !!no_answer;
|
|
153
|
+
};
|
|
154
|
+
|
|
161
155
|
_this.renderCorrect = function () {
|
|
162
156
|
var aggregate = _this.props.answerSummary.aggregate;
|
|
163
157
|
var correct = aggregate.correct;
|
|
@@ -193,12 +187,26 @@ var AggregationTable = (_dec = (0, _uiThemeable.themeable)(_theme.default, style
|
|
|
193
187
|
return _this.renderRow(noAnswerKey, _ref4, noAnswerLabel, noAnswerCount, noAnswerPercentage);
|
|
194
188
|
};
|
|
195
189
|
|
|
190
|
+
_this.getColorProfile = function () {
|
|
191
|
+
var colorProfile;
|
|
192
|
+
|
|
193
|
+
if (!_this.isPartialCorrectExist() && _this.isNoAnswerExist()) {
|
|
194
|
+
colorProfile = 'correctIncorrectNoanswer';
|
|
195
|
+
} else if (_this.isPartialCorrectExist() && _this.isNoAnswerExist()) {
|
|
196
|
+
colorProfile = 'correctIncorrectNoanswerPartial';
|
|
197
|
+
} else {
|
|
198
|
+
colorProfile = 'correctIncorrect';
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
return colorProfile;
|
|
202
|
+
};
|
|
203
|
+
|
|
196
204
|
_this.render = function () {
|
|
197
205
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
198
|
-
className: (0, _classnames.default)(styles.collapsingTable)
|
|
206
|
+
className: (0, _classnames.default)(styles.collapsingTable, styles[_this.getColorProfile()])
|
|
199
207
|
}, /*#__PURE__*/_react.default.createElement(_uiTable.Table, {
|
|
200
208
|
caption: (0, _formatMessage.default)('Answer Frequency Summary Aggregates')
|
|
201
|
-
}, _this.renderHeaderRow(), /*#__PURE__*/_react.default.createElement(_uiTable.Table.Body, null, _this.renderCorrect(), _this.isPartialCorrectExist() && _this.renderPartialCorrect(), _this.renderIncorrect(), _this.renderNoAnswer())));
|
|
209
|
+
}, _this.renderHeaderRow(), /*#__PURE__*/_react.default.createElement(_uiTable.Table.Body, null, _this.renderCorrect(), _this.isPartialCorrectExist() && _this.renderPartialCorrect(), _this.renderIncorrect(), _this.isNoAnswerExist() && _this.renderNoAnswer())));
|
|
202
210
|
};
|
|
203
211
|
|
|
204
212
|
return _this;
|
|
@@ -19,7 +19,8 @@ function mapStateToProps(_state) {
|
|
|
19
19
|
formulaEnabled: (0, _featureCheck.featureOn)('ia_formula_afs'),
|
|
20
20
|
matchingEnabled: (0, _featureCheck.featureOn)('ia_matching_afs'),
|
|
21
21
|
orderingEnabled: (0, _featureCheck.featureOn)('ia_ordering_afs'),
|
|
22
|
-
hotSpotEnabled: (0, _featureCheck.featureOn)('ia_hot_spot_afs')
|
|
22
|
+
hotSpotEnabled: (0, _featureCheck.featureOn)('ia_hot_spot_afs'),
|
|
23
|
+
categorizationEnabled: (0, _featureCheck.featureOn)('ia_categorization_afs')
|
|
23
24
|
}
|
|
24
25
|
};
|
|
25
26
|
}
|
|
@@ -117,7 +117,10 @@ exports.answerSummaryPropType = answerSummaryPropType;
|
|
|
117
117
|
|
|
118
118
|
var afsFlags = _propTypes.default.shape({
|
|
119
119
|
formulaEnabled: _propTypes.default.bool.isRequired,
|
|
120
|
-
matchingEnabled: _propTypes.default.bool.isRequired
|
|
120
|
+
matchingEnabled: _propTypes.default.bool.isRequired,
|
|
121
|
+
hotSpotEnabled: _propTypes.default.bool.isRequired,
|
|
122
|
+
orderingEnabled: _propTypes.default.bool.isRequired,
|
|
123
|
+
categorizationEnabled: _propTypes.default.bool.isRequired
|
|
121
124
|
});
|
|
122
125
|
|
|
123
126
|
exports.afsFlags = afsFlags;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/quiz-core",
|
|
3
|
-
"version": "18.6.1-rc.
|
|
3
|
+
"version": "18.6.1-rc.3+9ea6ea418",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "The Quiz React SDK by Instructure Inc.",
|
|
6
6
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
@@ -43,11 +43,11 @@
|
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@instructure/grading-utils": "^1.0.0",
|
|
45
45
|
"@instructure/outcomes-ui": "^2.1.9",
|
|
46
|
-
"@instructure/quiz-common": "18.6.1-rc.
|
|
47
|
-
"@instructure/quiz-i18n": "18.6.1-rc.
|
|
48
|
-
"@instructure/quiz-interactions": "18.6.1-rc.
|
|
49
|
-
"@instructure/quiz-number-input": "18.6.1-rc.
|
|
50
|
-
"@instructure/quiz-rce": "18.6.1-rc.
|
|
46
|
+
"@instructure/quiz-common": "18.6.1-rc.3+9ea6ea418",
|
|
47
|
+
"@instructure/quiz-i18n": "18.6.1-rc.3+9ea6ea418",
|
|
48
|
+
"@instructure/quiz-interactions": "18.6.1-rc.3+9ea6ea418",
|
|
49
|
+
"@instructure/quiz-number-input": "18.6.1-rc.3+9ea6ea418",
|
|
50
|
+
"@instructure/quiz-rce": "18.6.1-rc.3+9ea6ea418",
|
|
51
51
|
"@instructure/ui-a11y-content": "^7.22.1",
|
|
52
52
|
"@instructure/ui-alerts": "^7.22.1",
|
|
53
53
|
"@instructure/ui-avatar": "^7.22.1",
|
|
@@ -109,7 +109,7 @@
|
|
|
109
109
|
"file-saver": "~2.0.5",
|
|
110
110
|
"humps": "^2.0.0",
|
|
111
111
|
"immutable": "^3.8.1",
|
|
112
|
-
"instructure-validations": "18.6.1-rc.
|
|
112
|
+
"instructure-validations": "18.6.1-rc.3+9ea6ea418",
|
|
113
113
|
"ipaddr.js": "^1.5.4",
|
|
114
114
|
"isomorphic-fetch": "^2.2.0",
|
|
115
115
|
"isuuid": "^0.1.0",
|
|
@@ -160,7 +160,7 @@
|
|
|
160
160
|
"intl": "^1.2.4",
|
|
161
161
|
"jquery": "^2.2.3",
|
|
162
162
|
"most-subject": "^5.3.0",
|
|
163
|
-
"quiz-presets": "18.6.1-rc.
|
|
163
|
+
"quiz-presets": "18.6.1-rc.3+9ea6ea418",
|
|
164
164
|
"react": "^16.8.6",
|
|
165
165
|
"react-addons-test-utils": "^15.6.2",
|
|
166
166
|
"react-dom": "^16.8.6",
|
|
@@ -176,5 +176,5 @@
|
|
|
176
176
|
"publishConfig": {
|
|
177
177
|
"access": "public"
|
|
178
178
|
},
|
|
179
|
-
"gitHead": "
|
|
179
|
+
"gitHead": "9ea6ea4188374d5d0fc720d14f3febd98e6d8968"
|
|
180
180
|
}
|