@instructure/quiz-core 20.11.3-rc.2 → 20.11.3-rc.21
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/banks/components/Bank/presenter.js +12 -6
- package/es/banks/components/HeaderMenu/presenter.js +40 -1
- package/es/banks/components/HeaderMenu/styles.js +3 -0
- package/es/banks/components/NavWrapper/presenter.js +6 -1
- package/es/banks/components/SharingModal/presenter.js +1 -1
- package/es/building/components/resources/quizEntry/QuizEntry/index.js +2 -1
- package/es/building/components/resources/quizEntry/QuizEntry/presenter.js +23 -29
- package/es/building/components/resources/quizEntry/QuizEntry/quizEntryPresenterWrapper.js +39 -0
- package/es/building/components/resources/quizEntry/QuizEntry/styles.js +23 -0
- package/es/building/components/resources/quizEntry/QuizEntry/theme.js +4 -2
- package/es/building/components/resources/quizEntry/QuizEntryBank/QuizEntryBankEdit/presenter.js +35 -43
- package/es/building/components/resources/quizEntry/QuizEntryBank/QuizEntryBankEdit/styles.js +30 -0
- package/es/building/components/resources/quizEntry/QuizEntryBank/QuizEntryBankEdit/theme.js +4 -2
- package/es/building/components/resources/quizEntry/QuizEntryBank/QuizEntryBankShow/index.js +25 -31
- package/es/building/components/resources/quizEntry/QuizEntryBank/QuizEntryBankShow/styles.js +19 -0
- package/es/building/components/resources/quizEntry/QuizEntryBank/QuizEntryBankShow/theme.js +4 -2
- package/es/building/components/resources/quizEntry/QuizEntryEdit/Footer/presenter.js +27 -33
- package/es/building/components/resources/quizEntry/QuizEntryEdit/Footer/styles.js +28 -0
- package/es/building/components/resources/quizEntry/QuizEntryEdit/Footer/theme.js +4 -2
- package/es/building/components/resources/quizEntry/QuizEntryEdit/Header/index.js +32 -37
- package/es/building/components/resources/quizEntry/QuizEntryEdit/Header/styles.js +49 -0
- package/es/building/components/resources/quizEntry/QuizEntryEdit/Header/theme.js +4 -2
- package/es/building/components/resources/quizEntry/QuizEntryEdit/presenter.js +23 -23
- package/es/building/components/resources/quizEntry/QuizEntryEdit/styles.js +21 -0
- package/es/building/components/resources/quizEntry/QuizEntryEdit/theme.js +4 -2
- package/es/building/components/resources/quizEntry/QuizEntryShow/presenter.js +36 -50
- package/es/building/components/resources/quizEntry/QuizEntryShow/styles.js +84 -0
- package/es/building/components/resources/quizEntry/QuizEntryShow/theme.js +4 -2
- package/es/common/components/layout/navbar/SecondaryNavBarButton/index.js +1 -1
- package/es/common/components/layout/navbar/index.js +135 -38
- package/es/common/components/layout/navbar/styles.js +8 -0
- package/es/common/components/layout/navbar/theme.js +10 -0
- package/es/common/components/resources/stimulus/Stimulus/presenter.js +40 -50
- package/es/common/components/resources/stimulus/Stimulus/styles.js +58 -0
- package/es/common/components/resources/stimulus/Stimulus/theme.js +4 -2
- package/es/common/components/resources/stimulus/StimulusEdit/presenter.js +37 -46
- package/es/common/components/resources/stimulus/StimulusEdit/styles.js +46 -0
- package/es/common/components/resources/stimulus/StimulusEdit/theme.js +4 -2
- package/es/common/components/shared/overlayEmotion/index.js +1 -1
- package/es/common/components/shared/return_button/ReturnButton.js +4 -1
- package/es/moderating/components/resources/ModerateTable/presenter.js +44 -46
- package/es/moderating/components/resources/ModerateTable/styles.js +23 -0
- package/es/moderating/components/resources/ModerateTable/theme.js +4 -2
- package/es/moderating/components/resources/ModerateTableRow/presenter.js +63 -68
- package/es/moderating/components/resources/ModerateTableRow/styles.js +25 -0
- package/es/moderating/components/resources/ModerateTableRow/theme.js +4 -2
- package/es/reporting/components/quizAnalysis/QuizAnalysisOverview.js +34 -41
- package/es/reporting/components/quizAnalysis/styles.js +27 -0
- package/es/reporting/components/quizAnalysis/theme.js +4 -2
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/LegacyChoiceType/ChoiceTypeTableRow/presenter.js +43 -43
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/LegacyChoiceType/ChoiceTypeTableRow/styles.js +41 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/LegacyChoiceType/ChoiceTypeTableRow/theme.js +6 -3
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/LegacyChoiceType/presenter.js +20 -26
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/LegacyChoiceType/styles.js +19 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/LegacyChoiceType/theme.js +4 -2
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/MatchingTypeTable/presenter.js +45 -47
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/MatchingTypeTable/styles.js +52 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/MatchingTypeTable/theme.js +4 -2
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/NumericType/ChoiceTypeWithInfo/presenter.js +2 -2
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/NumericType/presenter.js +2 -2
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/RichFillBlankType/ChoiceGroupTypeTable/presenter.js +2 -2
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AfsPartsContainer/presenter.js +32 -26
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AfsPartsContainer/styles.js +14 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AfsPartsContainer/theme.js +4 -2
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AggregationTable/presenter.js +38 -53
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AggregationTable/styles.js +141 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AggregationTable/theme.js +10 -7
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ChoiceTypeTable/presenter.js +80 -61
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ChoiceTypeTable/styles.js +93 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ChoiceTypeTable/theme.js +8 -5
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/MetricPopover/presenter.js +31 -26
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/MetricPopover/styles.js +15 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/MetricPopover/theme.js +4 -2
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/NewItemAnalysis/presenter.js +80 -79
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/NewItemAnalysis/styles.js +75 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/NewItemAnalysis/theme.js +4 -2
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/presenter.js +47 -49
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/styles.js +14 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/theme.js +4 -2
- package/lib/banks/components/Bank/presenter.js +10 -5
- package/lib/banks/components/HeaderMenu/presenter.js +42 -1
- package/lib/banks/components/HeaderMenu/styles.js +3 -0
- package/lib/banks/components/NavWrapper/presenter.js +6 -1
- package/lib/banks/components/SharingModal/presenter.js +1 -1
- package/lib/building/components/resources/quizEntry/QuizEntry/index.js +3 -1
- package/lib/building/components/resources/quizEntry/QuizEntry/presenter.js +22 -30
- package/lib/building/components/resources/quizEntry/QuizEntry/quizEntryPresenterWrapper.js +51 -0
- package/lib/building/components/resources/quizEntry/QuizEntry/styles.js +33 -0
- package/lib/building/components/resources/quizEntry/QuizEntry/theme.js +6 -3
- package/lib/building/components/resources/quizEntry/QuizEntryBank/QuizEntryBankEdit/presenter.js +34 -45
- package/lib/building/components/resources/quizEntry/QuizEntryBank/QuizEntryBankEdit/styles.js +38 -0
- package/lib/building/components/resources/quizEntry/QuizEntryBank/QuizEntryBankEdit/theme.js +6 -3
- package/lib/building/components/resources/quizEntry/QuizEntryBank/QuizEntryBankShow/index.js +24 -33
- package/lib/building/components/resources/quizEntry/QuizEntryBank/QuizEntryBankShow/styles.js +27 -0
- package/lib/building/components/resources/quizEntry/QuizEntryBank/QuizEntryBankShow/theme.js +6 -3
- package/lib/building/components/resources/quizEntry/QuizEntryEdit/Footer/presenter.js +26 -35
- package/lib/building/components/resources/quizEntry/QuizEntryEdit/Footer/styles.js +38 -0
- package/lib/building/components/resources/quizEntry/QuizEntryEdit/Footer/theme.js +6 -3
- package/lib/building/components/resources/quizEntry/QuizEntryEdit/Header/index.js +30 -38
- package/lib/building/components/resources/quizEntry/QuizEntryEdit/Header/styles.js +57 -0
- package/lib/building/components/resources/quizEntry/QuizEntryEdit/Header/theme.js +6 -3
- package/lib/building/components/resources/quizEntry/QuizEntryEdit/presenter.js +20 -22
- package/lib/building/components/resources/quizEntry/QuizEntryEdit/styles.js +29 -0
- package/lib/building/components/resources/quizEntry/QuizEntryEdit/theme.js +6 -3
- package/lib/building/components/resources/quizEntry/QuizEntryShow/presenter.js +36 -53
- package/lib/building/components/resources/quizEntry/QuizEntryShow/styles.js +95 -0
- package/lib/building/components/resources/quizEntry/QuizEntryShow/theme.js +6 -3
- package/lib/common/components/layout/navbar/SecondaryNavBarButton/index.js +1 -1
- package/lib/common/components/layout/navbar/index.js +130 -39
- package/lib/common/components/layout/navbar/styles.js +16 -0
- package/lib/common/components/layout/navbar/theme.js +18 -0
- package/lib/common/components/resources/stimulus/Stimulus/presenter.js +38 -52
- package/lib/common/components/resources/stimulus/Stimulus/styles.js +70 -0
- package/lib/common/components/resources/stimulus/Stimulus/theme.js +6 -3
- package/lib/common/components/resources/stimulus/StimulusEdit/presenter.js +36 -47
- package/lib/common/components/resources/stimulus/StimulusEdit/styles.js +54 -0
- package/lib/common/components/resources/stimulus/StimulusEdit/theme.js +6 -3
- package/lib/common/components/shared/overlayEmotion/index.js +1 -1
- package/lib/common/components/shared/return_button/ReturnButton.js +4 -1
- package/lib/moderating/components/resources/ModerateTable/presenter.js +43 -50
- package/lib/moderating/components/resources/ModerateTable/styles.js +33 -0
- package/lib/moderating/components/resources/ModerateTable/theme.js +6 -3
- package/lib/moderating/components/resources/ModerateTableRow/presenter.js +61 -70
- package/lib/moderating/components/resources/ModerateTableRow/styles.js +33 -0
- package/lib/moderating/components/resources/ModerateTableRow/theme.js +6 -3
- package/lib/reporting/components/quizAnalysis/QuizAnalysisOverview.js +33 -43
- package/lib/reporting/components/quizAnalysis/styles.js +37 -0
- package/lib/reporting/components/quizAnalysis/theme.js +6 -3
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/LegacyChoiceType/ChoiceTypeTableRow/presenter.js +42 -47
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/LegacyChoiceType/ChoiceTypeTableRow/styles.js +51 -0
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/LegacyChoiceType/ChoiceTypeTableRow/theme.js +8 -4
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/LegacyChoiceType/presenter.js +19 -28
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/LegacyChoiceType/styles.js +27 -0
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/LegacyChoiceType/theme.js +6 -3
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/MatchingTypeTable/presenter.js +45 -52
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/MatchingTypeTable/styles.js +62 -0
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/MatchingTypeTable/theme.js +6 -3
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/NumericType/ChoiceTypeWithInfo/presenter.js +2 -2
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/NumericType/presenter.js +2 -2
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/RichFillBlankType/ChoiceGroupTypeTable/presenter.js +2 -2
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AfsPartsContainer/presenter.js +28 -26
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AfsPartsContainer/styles.js +24 -0
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AfsPartsContainer/theme.js +6 -3
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AggregationTable/presenter.js +37 -55
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AggregationTable/styles.js +149 -0
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AggregationTable/theme.js +12 -8
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ChoiceTypeTable/presenter.js +81 -65
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ChoiceTypeTable/styles.js +103 -0
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ChoiceTypeTable/theme.js +10 -6
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/MetricPopover/presenter.js +30 -28
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/MetricPopover/styles.js +23 -0
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/MetricPopover/theme.js +6 -3
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/NewItemAnalysis/presenter.js +82 -84
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/NewItemAnalysis/styles.js +85 -0
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/NewItemAnalysis/theme.js +6 -3
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/presenter.js +43 -48
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/styles.js +22 -0
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/theme.js +6 -3
- package/package.json +9 -9
- package/es/common/components/layout/navbar/presenter.js +0 -114
- package/lib/common/components/layout/navbar/presenter.js +0 -136
|
@@ -1,45 +1,33 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
1
|
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
|
+
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
3
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
4
4
|
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
5
5
|
|
|
6
6
|
var _dec, _class, _class2, _temp;
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
/** @jsx jsx */
|
|
9
|
+
import { Component } from 'react';
|
|
9
10
|
import { Flex } from '@instructure/ui-flex';
|
|
10
|
-
|
|
11
|
-
componentId: 'bGeZS',
|
|
12
|
-
template: function template(theme) {
|
|
13
|
-
return "\n\n.bGeZS_rMrG{display:flex;flex-basis:100%;flex-direction:column;padding-bottom:".concat(theme.tableBottomPadding || 'inherit', "}\n\n.bGeZS_cvRx{align-items:center;display:flex;height:100%;justify-content:center;min-height:47px;width:46px}\n\n.bGeZS_EKAb{background-color:").concat(theme.colorGreen || 'inherit', "}\n\n.bGeZS_EKAb svg{fill:#fff}\n\n.bGeZS_tnta{border-color:").concat(theme.colorGreen || 'inherit', ";border-style:solid;border-width:2px 0}\n\n.bGeZS_fvqY{border-radius:4px 4px 4px 4px;border-width:2px 2px 2px 2px}\n\n.bGeZS_tnta>span>span:nth-child(2){min-width:46px;padding:12px 12px 12px 12px}\n\n.bGeZS_bwoZ{max-width:100%;width:calc(25% + 350px)}\n\n.bGeZS_SVtU table tbody tr th{font-weight:400}");
|
|
14
|
-
},
|
|
15
|
-
'tableWrapper': 'bGeZS_rMrG',
|
|
16
|
-
'iconWrapper': 'bGeZS_cvRx',
|
|
17
|
-
'iconCorrect': 'bGeZS_EKAb',
|
|
18
|
-
'correctRowBorder': 'bGeZS_tnta',
|
|
19
|
-
'correctRowBorderRadius': 'bGeZS_fvqY',
|
|
20
|
-
'tableHalfWidth': 'bGeZS_bwoZ',
|
|
21
|
-
'tableContainer': 'bGeZS_SVtU'
|
|
22
|
-
};
|
|
11
|
+
import generateStyle from "./styles.js";
|
|
23
12
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
24
13
|
import { Table } from '@instructure/ui-table';
|
|
25
|
-
import {
|
|
14
|
+
import { withStyle, jsx } from '@instructure/emotion';
|
|
26
15
|
import PropTypes from 'prop-types';
|
|
27
16
|
import { IconCheckSolid } from '@instructure/ui-icons';
|
|
28
17
|
import { matchingTypeAnswerSummaryPropType } from "../../../propTypes.js";
|
|
29
18
|
import MatchingTypeOrderer from "../utils/matchingTypeOrderer.js";
|
|
30
19
|
import { extractTextFromHtml } from '@instructure/quiz-interactions';
|
|
31
|
-
import
|
|
32
|
-
import theme from "./theme.js";
|
|
20
|
+
import generateComponentTheme from "./theme.js";
|
|
33
21
|
import { ScreenReaderContent } from '@instructure/ui-a11y-content';
|
|
34
22
|
|
|
35
|
-
var _ref =
|
|
23
|
+
var _ref = jsx(IconCheckSolid, null);
|
|
36
24
|
|
|
37
|
-
var _ref2 =
|
|
25
|
+
var _ref2 = jsx(Flex.Item, {
|
|
38
26
|
width: "46px",
|
|
39
27
|
textAlign: "center"
|
|
40
28
|
});
|
|
41
29
|
|
|
42
|
-
export var MatchingTypeTable = (_dec =
|
|
30
|
+
export var MatchingTypeTable = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
43
31
|
_inherits(MatchingTypeTable, _Component);
|
|
44
32
|
|
|
45
33
|
var _super = _createSuper(MatchingTypeTable);
|
|
@@ -56,9 +44,8 @@ export var MatchingTypeTable = (_dec = themeable(theme, styles), _dec(_class = (
|
|
|
56
44
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
57
45
|
|
|
58
46
|
_this.renderIcon = function () {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
className: classes
|
|
47
|
+
return jsx("div", {
|
|
48
|
+
css: [_this.props.styles.iconWrapper, _this.props.styles.iconCorrect]
|
|
62
49
|
}, _ref);
|
|
63
50
|
};
|
|
64
51
|
|
|
@@ -71,16 +58,16 @@ export var MatchingTypeTable = (_dec = themeable(theme, styles), _dec(_class = (
|
|
|
71
58
|
var exampleAnswers = questions[questionKeys[0]].answers;
|
|
72
59
|
var answer = exampleAnswers[key];
|
|
73
60
|
var answerNumberHeaderId = "answer-number-header-".concat(key, "-").concat(itemId);
|
|
74
|
-
return
|
|
61
|
+
return jsx(Table.ColHeader, {
|
|
75
62
|
id: answerNumberHeaderId,
|
|
76
63
|
key: answerNumberHeaderId,
|
|
77
64
|
themeOverride: {
|
|
78
65
|
padding: '0 0 15px 0'
|
|
79
66
|
},
|
|
80
67
|
textAlign: "center"
|
|
81
|
-
},
|
|
68
|
+
}, jsx(Flex, {
|
|
82
69
|
direction: "row"
|
|
83
|
-
}, _ref2,
|
|
70
|
+
}, _ref2, jsx(Flex.Item, {
|
|
84
71
|
shouldShrink: true,
|
|
85
72
|
shouldGrow: true,
|
|
86
73
|
textAlign: "center"
|
|
@@ -92,8 +79,6 @@ export var MatchingTypeTable = (_dec = themeable(theme, styles), _dec(_class = (
|
|
|
92
79
|
};
|
|
93
80
|
|
|
94
81
|
_this.renderCell = function (questionKey, answerKey) {
|
|
95
|
-
var _classNames;
|
|
96
|
-
|
|
97
82
|
var _this$props2 = _this.props,
|
|
98
83
|
answerSummary = _this$props2.answerSummary,
|
|
99
84
|
itemId = _this$props2.itemId;
|
|
@@ -103,24 +88,24 @@ export var MatchingTypeTable = (_dec = themeable(theme, styles), _dec(_class = (
|
|
|
103
88
|
var correct = answer.correct,
|
|
104
89
|
count = answer.count;
|
|
105
90
|
var answerNumberCellId = "answer-number-cell-".concat(questionKey, "-").concat(answerKey, "-").concat(itemId);
|
|
106
|
-
var
|
|
107
|
-
return
|
|
91
|
+
var answerRowStyles = answer.correct ? _this.props.styles.correctAnswerRow : {};
|
|
92
|
+
return jsx(Table.Cell, {
|
|
108
93
|
id: answerNumberCellId,
|
|
109
94
|
key: answerNumberCellId,
|
|
110
95
|
themeOverride: {
|
|
111
96
|
padding: '0 0 0 0'
|
|
112
97
|
}
|
|
113
|
-
},
|
|
98
|
+
}, jsx(ScreenReaderContent, null, correct ? "".concat(t('Correct answer'), ": ").concat(count) : count), jsx("div", {
|
|
114
99
|
"aria-hidden": "true",
|
|
115
|
-
|
|
116
|
-
},
|
|
100
|
+
css: answerRowStyles
|
|
101
|
+
}, jsx(Flex, {
|
|
117
102
|
direction: "row",
|
|
118
103
|
alignItems: "center"
|
|
119
|
-
},
|
|
104
|
+
}, jsx(Flex.Item, {
|
|
120
105
|
width: "46px",
|
|
121
106
|
textAlign: "center",
|
|
122
107
|
align: "stretch"
|
|
123
|
-
}, correct && _this.renderIcon()),
|
|
108
|
+
}, correct && _this.renderIcon()), jsx(Flex.Item, {
|
|
124
109
|
shouldShrink: true,
|
|
125
110
|
shouldGrow: true,
|
|
126
111
|
textAlign: "center"
|
|
@@ -134,9 +119,9 @@ export var MatchingTypeTable = (_dec = themeable(theme, styles), _dec(_class = (
|
|
|
134
119
|
var headerCells = orderedAnswerKeys.map(_this.renderHeaderCell);
|
|
135
120
|
var categoryHeaderId = "category-header-".concat(itemId);
|
|
136
121
|
var rowKey = "header-row-".concat(itemId);
|
|
137
|
-
return
|
|
122
|
+
return jsx(Table.Row, {
|
|
138
123
|
key: rowKey
|
|
139
|
-
},
|
|
124
|
+
}, jsx(Table.ColHeader, {
|
|
140
125
|
id: categoryHeaderId,
|
|
141
126
|
key: categoryHeaderId,
|
|
142
127
|
themeOverride: {
|
|
@@ -161,9 +146,9 @@ export var MatchingTypeTable = (_dec = themeable(theme, styles), _dec(_class = (
|
|
|
161
146
|
var rowKey = "row-".concat(orderedQuestionKey, "-").concat(itemId);
|
|
162
147
|
var extractedQuestionBody = extractTextFromHtml(question.body);
|
|
163
148
|
var questionBody = extractedQuestionBody.trim().length > 0 ? extractedQuestionBody : firstColumnName;
|
|
164
|
-
return
|
|
149
|
+
return jsx(Table.Row, {
|
|
165
150
|
key: rowKey
|
|
166
|
-
},
|
|
151
|
+
}, jsx(Table.RowHeader, {
|
|
167
152
|
id: questionRowHeaderId,
|
|
168
153
|
key: questionRowHeaderId,
|
|
169
154
|
themeOverride: {
|
|
@@ -178,14 +163,13 @@ export var MatchingTypeTable = (_dec = themeable(theme, styles), _dec(_class = (
|
|
|
178
163
|
var questionKeys = Object.keys(questions);
|
|
179
164
|
var exampleAnswers = questions[questionKeys[0]].answers;
|
|
180
165
|
var answerKeys = Object.keys(exampleAnswers).sort();
|
|
181
|
-
var tableHalfWidth = answerKeys.length <= 3;
|
|
182
166
|
var orderedAnswerKeys = MatchingTypeOrderer.orderAnswerKeysForDiagonal(answerSummary, answerKeys);
|
|
183
167
|
var orderedQuestionKeys = MatchingTypeOrderer.orderQuestionKeysForDiagonal(answerSummary, questionKeys, orderedAnswerKeys);
|
|
184
|
-
return
|
|
185
|
-
|
|
186
|
-
},
|
|
168
|
+
return jsx("div", {
|
|
169
|
+
css: _this.props.styles.tableContainer
|
|
170
|
+
}, jsx(Table, {
|
|
187
171
|
caption: t('Answer Frequency Summary')
|
|
188
|
-
},
|
|
172
|
+
}, jsx(Table.Head, null, _this.renderHeaderRow(orderedAnswerKeys)), jsx(Table.Body, null, orderedQuestionKeys.map(function (orderedQuestionKey) {
|
|
189
173
|
return _this.renderRow(orderedQuestionKey, orderedAnswerKeys);
|
|
190
174
|
}))));
|
|
191
175
|
};
|
|
@@ -193,9 +177,23 @@ export var MatchingTypeTable = (_dec = themeable(theme, styles), _dec(_class = (
|
|
|
193
177
|
return _this;
|
|
194
178
|
}
|
|
195
179
|
|
|
180
|
+
_createClass(MatchingTypeTable, [{
|
|
181
|
+
key: "componentDidMount",
|
|
182
|
+
value: function componentDidMount() {
|
|
183
|
+
this.props.makeStyles();
|
|
184
|
+
}
|
|
185
|
+
}, {
|
|
186
|
+
key: "componentDidUpdate",
|
|
187
|
+
value: function componentDidUpdate() {
|
|
188
|
+
this.props.makeStyles();
|
|
189
|
+
}
|
|
190
|
+
}]);
|
|
191
|
+
|
|
196
192
|
return MatchingTypeTable;
|
|
197
193
|
}(Component), _class2.propTypes = {
|
|
198
194
|
itemId: PropTypes.number.isRequired,
|
|
199
195
|
answerSummary: matchingTypeAnswerSummaryPropType.isRequired,
|
|
200
|
-
firstColumnName: PropTypes.string.isRequired
|
|
201
|
-
|
|
196
|
+
firstColumnName: PropTypes.string.isRequired,
|
|
197
|
+
styles: PropTypes.object,
|
|
198
|
+
makeStyles: PropTypes.func
|
|
199
|
+
}, _temp)) || _class);
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
|
|
3
|
+
var generateStyle = function generateStyle(componentTheme, props) {
|
|
4
|
+
var answerSummary = props.answerSummary;
|
|
5
|
+
var questions = answerSummary.questions;
|
|
6
|
+
var questionKeys = Object.keys(questions);
|
|
7
|
+
var exampleAnswers = questions[questionKeys[0]].answers;
|
|
8
|
+
var answerKeys = Object.keys(exampleAnswers).sort();
|
|
9
|
+
var tableHalfWidth = answerKeys.length <= 3;
|
|
10
|
+
return {
|
|
11
|
+
tableWrapper: {
|
|
12
|
+
display: 'flex',
|
|
13
|
+
flexBasis: '100%',
|
|
14
|
+
flexDirection: 'column',
|
|
15
|
+
paddingBottom: componentTheme.tableBottomPadding
|
|
16
|
+
},
|
|
17
|
+
iconWrapper: {
|
|
18
|
+
display: 'flex',
|
|
19
|
+
height: '100%',
|
|
20
|
+
minHeight: '47px',
|
|
21
|
+
width: '46px',
|
|
22
|
+
justifyContent: 'center',
|
|
23
|
+
alignItems: 'center'
|
|
24
|
+
},
|
|
25
|
+
iconCorrect: {
|
|
26
|
+
backgroundColor: componentTheme.colorGreen,
|
|
27
|
+
'svg': {
|
|
28
|
+
fill: 'white'
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
correctAnswerRow: {
|
|
32
|
+
borderColor: componentTheme.colorGreen,
|
|
33
|
+
borderStyle: 'solid',
|
|
34
|
+
'> span > span:nth-of-type(2)': {
|
|
35
|
+
minWidth: '46px',
|
|
36
|
+
padding: '12px 12px 12px 12px'
|
|
37
|
+
},
|
|
38
|
+
borderWidth: '2px 2px 2px 2px',
|
|
39
|
+
borderRadius: '4px 4px 4px 4px'
|
|
40
|
+
},
|
|
41
|
+
tableContainer: _objectSpread({
|
|
42
|
+
'table tbody tr th': {
|
|
43
|
+
fontWeight: '400'
|
|
44
|
+
}
|
|
45
|
+
}, tableHalfWidth && {
|
|
46
|
+
width: 'calc(25% + 350px)',
|
|
47
|
+
maxWidth: '100%'
|
|
48
|
+
})
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export default generateStyle;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
2
2
|
var spacing = _ref.spacing;
|
|
3
3
|
return {
|
|
4
4
|
tableBottomPadding: spacing.medium,
|
|
5
5
|
colorGreen: '#0b874b'
|
|
6
6
|
};
|
|
7
|
-
}
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export default generateComponentTheme;
|
|
@@ -30,11 +30,11 @@ export var ChoiceTypeWithInfo = /*#__PURE__*/function (_Component) {
|
|
|
30
30
|
choices = _this$props.choices,
|
|
31
31
|
index = _this$props.index;
|
|
32
32
|
var tableId = "".concat(itemId, "_").concat(index, "_choiceGroup");
|
|
33
|
-
var
|
|
33
|
+
var tableContainerSizeStyles = {};
|
|
34
34
|
return /*#__PURE__*/React.createElement(ChoiceTypeTable, {
|
|
35
35
|
itemId: tableId,
|
|
36
36
|
choices: choices,
|
|
37
|
-
|
|
37
|
+
tableContainerStyles: tableContainerSizeStyles
|
|
38
38
|
});
|
|
39
39
|
};
|
|
40
40
|
|
|
@@ -42,11 +42,11 @@ export var NumericType = (_dec = withStyle(generateStyle, generateComponentTheme
|
|
|
42
42
|
answerSummary = _this$props.answerSummary;
|
|
43
43
|
var incorrect_answer_choices = answerSummary.requirements.incorrect_answer_choices;
|
|
44
44
|
var tableId = "".concat(itemId, "_incorrect_choices");
|
|
45
|
-
var
|
|
45
|
+
var tableContainerStyles = {};
|
|
46
46
|
return jsx(ChoiceTypeTable, {
|
|
47
47
|
itemId: tableId,
|
|
48
48
|
choices: incorrect_answer_choices,
|
|
49
|
-
|
|
49
|
+
tableContainerStyles: tableContainerStyles
|
|
50
50
|
});
|
|
51
51
|
};
|
|
52
52
|
|
|
@@ -78,11 +78,11 @@ export var ChoiceGroupTypeTable = (_dec = withStyle(generateStyle, generateCompo
|
|
|
78
78
|
index = _this$props.index;
|
|
79
79
|
var choices = blank.choices;
|
|
80
80
|
var tableId = "".concat(itemId, "_").concat(index, "_choiceGroup");
|
|
81
|
-
var
|
|
81
|
+
var tableContainerStyles = {};
|
|
82
82
|
return jsx(ChoiceTypeTable, {
|
|
83
83
|
itemId: tableId,
|
|
84
84
|
choices: choices,
|
|
85
|
-
|
|
85
|
+
tableContainerStyles: tableContainerStyles
|
|
86
86
|
});
|
|
87
87
|
};
|
|
88
88
|
|
|
@@ -1,24 +1,19 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
1
|
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
|
+
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
3
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
4
4
|
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
5
5
|
|
|
6
6
|
var _dec, _class, _class2, _temp;
|
|
7
7
|
|
|
8
|
+
/** @jsx jsx */
|
|
9
|
+
|
|
10
|
+
/* eslint-disable-next-line no-unused-vars */
|
|
8
11
|
import React, { Component } from 'react';
|
|
9
12
|
import PropTypes from 'prop-types';
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
return "\n\n.DjkQc_SVtU{max-width:100%;width:calc(25% + 350px)}\n\n.DjkQc_ellB{margin-top:".concat(theme.marginOfTables || 'inherit', "}");
|
|
15
|
-
},
|
|
16
|
-
'tableContainer': 'DjkQc_SVtU',
|
|
17
|
-
'aggregateContainer': 'DjkQc_ellB'
|
|
18
|
-
};
|
|
19
|
-
import classNames from 'classnames';
|
|
20
|
-
import theme from "./theme.js";
|
|
21
|
-
export var AfsPartsContainer = (_dec = themeable(theme, styles), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
13
|
+
import { withStyle, jsx } from '@instructure/emotion';
|
|
14
|
+
import generateStyle from "./styles.js";
|
|
15
|
+
import generateComponentTheme from "./theme.js";
|
|
16
|
+
export var AfsPartsContainer = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
22
17
|
_inherits(AfsPartsContainer, _Component);
|
|
23
18
|
|
|
24
19
|
var _super = _createSuper(AfsPartsContainer);
|
|
@@ -35,34 +30,45 @@ export var AfsPartsContainer = (_dec = themeable(theme, styles), _dec(_class = (
|
|
|
35
30
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
36
31
|
|
|
37
32
|
_this.renderAggregationTable = function () {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
42
|
-
className: classNames(styles.tableContainer, _defineProperty({}, styles.aggregateContainer, afsTable))
|
|
43
|
-
}, aggregationTable);
|
|
33
|
+
return jsx("div", {
|
|
34
|
+
css: _this.props.styles.tableContainer
|
|
35
|
+
}, _this.props.aggregationTable);
|
|
44
36
|
};
|
|
45
37
|
|
|
46
38
|
_this.renderAfsTable = function () {
|
|
47
39
|
var afsTable = _this.props.afsTable;
|
|
48
|
-
return
|
|
40
|
+
return jsx("div", null, afsTable);
|
|
49
41
|
};
|
|
50
42
|
|
|
51
43
|
_this.render = function () {
|
|
52
|
-
var _this$
|
|
53
|
-
afsTable = _this$
|
|
54
|
-
aggregationTable = _this$
|
|
55
|
-
return
|
|
44
|
+
var _this$props = _this.props,
|
|
45
|
+
afsTable = _this$props.afsTable,
|
|
46
|
+
aggregationTable = _this$props.aggregationTable;
|
|
47
|
+
return jsx(React.Fragment, null, afsTable && _this.renderAfsTable(), aggregationTable && _this.renderAggregationTable());
|
|
56
48
|
};
|
|
57
49
|
|
|
58
50
|
return _this;
|
|
59
51
|
}
|
|
60
52
|
|
|
53
|
+
_createClass(AfsPartsContainer, [{
|
|
54
|
+
key: "componentDidMount",
|
|
55
|
+
value: function componentDidMount() {
|
|
56
|
+
this.props.makeStyles();
|
|
57
|
+
}
|
|
58
|
+
}, {
|
|
59
|
+
key: "componentDidUpdate",
|
|
60
|
+
value: function componentDidUpdate() {
|
|
61
|
+
this.props.makeStyles();
|
|
62
|
+
}
|
|
63
|
+
}]);
|
|
64
|
+
|
|
61
65
|
return AfsPartsContainer;
|
|
62
66
|
}(Component), _class2.propTypes = {
|
|
63
67
|
afsTable: PropTypes.node,
|
|
64
|
-
aggregationTable: PropTypes.node
|
|
65
|
-
|
|
68
|
+
aggregationTable: PropTypes.node,
|
|
69
|
+
styles: PropTypes.object,
|
|
70
|
+
makeStyles: PropTypes.func
|
|
71
|
+
}, _class2.defaultProps = {
|
|
66
72
|
afsTable: null,
|
|
67
73
|
aggregationTable: null
|
|
68
74
|
}, _temp)) || _class);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
|
|
3
|
+
var generateStyle = function generateStyle(componentTheme, props) {
|
|
4
|
+
return {
|
|
5
|
+
tableContainer: _objectSpread({
|
|
6
|
+
width: 'calc(25% + 350px)',
|
|
7
|
+
maxWidth: '100%'
|
|
8
|
+
}, props.afsTable && {
|
|
9
|
+
marginTop: componentTheme.marginOfTables
|
|
10
|
+
})
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export default generateStyle;
|
|
@@ -4,51 +4,32 @@ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
|
4
4
|
|
|
5
5
|
var _dec, _class, _class2, _temp;
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
/** @jsx jsx */
|
|
8
|
+
import { Component } from 'react';
|
|
8
9
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
9
10
|
import { Table } from '@instructure/ui-table';
|
|
10
11
|
import { onlyAggregatePropType } from "../../../propTypes.js";
|
|
11
12
|
import PropTypes from 'prop-types';
|
|
12
13
|
import { IconCheckSolid, IconXSolid, IconNoSolid, IconGradebookSolid } from '@instructure/ui-icons';
|
|
13
|
-
import {
|
|
14
|
-
import
|
|
15
|
-
|
|
16
|
-
componentId: 'fMmrG',
|
|
17
|
-
template: function template(theme) {
|
|
18
|
-
return "\n\n.fMmrG_cvRx{align-items:center;display:flex;height:100%;justify-content:center;min-height:47px;width:46px}\n\n.fMmrG_fPIL{min-width:500px}\n\n.fMmrG_fPIL table{border-collapse:separate;border-spacing:0 12px}\n\n.fMmrG_fPIL thead th{border-color:".concat(theme.colorHeaderBottomBorder || 'inherit', ";border-style:solid;border-width:0 0 1px 0}\n\n.fMmrG_fPIL table tbody tr td{border-style:solid;border-width:2px 0 2px 0;width:33.33%}\n\n.fMmrG_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.fMmrG_fPIL table tbody tr td:last-child{border-radius:0 4px 4px 0;border-style:solid;border-width:2px 2px 2px 0}\n\n.fMmrG_dzqP table tbody tr:first-child td,.fMmrG_dzqP table tbody tr:first-child th{border-color:").concat(theme.colorGrey || 'inherit', "}\n\n.fMmrG_fZpZ table tbody tr:first-child td,.fMmrG_fZpZ table tbody tr:first-child th{border-color:").concat(theme.colorGreen || 'inherit', "}\n\n.fMmrG_fZpZ table tbody tr:nth-child(2) td,.fMmrG_fZpZ table tbody tr:nth-child(2) th{border-color:").concat(theme.colorRed || 'inherit', "}\n\n.fMmrG_dgTJ table tbody tr:first-child td,.fMmrG_dgTJ table tbody tr:first-child th{border-color:").concat(theme.colorGreen || 'inherit', "}\n\n.fMmrG_dgTJ table tbody tr:nth-child(2) td,.fMmrG_dgTJ table tbody tr:nth-child(2) th{border-color:").concat(theme.colorRed || 'inherit', "}\n\n.fMmrG_dgTJ table tbody tr:nth-child(3) td,.fMmrG_dgTJ table tbody tr:nth-child(3) th{border-color:").concat(theme.colorGrey || 'inherit', "}\n\n.fMmrG_bYLj table tbody tr:first-child td,.fMmrG_bYLj table tbody tr:first-child th{border-color:").concat(theme.colorGreen || 'inherit', "}\n\n.fMmrG_bYLj table tbody tr:nth-child(2) td,.fMmrG_bYLj table tbody tr:nth-child(2) th{border-color:").concat(theme.colorBlue || 'inherit', "}\n\n.fMmrG_bYLj table tbody tr:nth-child(3) td,.fMmrG_bYLj table tbody tr:nth-child(3) th{border-color:").concat(theme.colorRed || 'inherit', "}\n\n.fMmrG_bYLj table tbody tr:nth-child(4) td,.fMmrG_bYLj table tbody tr:nth-child(4) th{border-color:").concat(theme.colorGrey || 'inherit', "}\n\n.fMmrG_bvau{background-color:").concat(theme.colorGreen || 'inherit', "}\n\n.fMmrG_cxOH{background-color:").concat(theme.colorRed || 'inherit', "}\n\n.fMmrG_dsqS{background-color:").concat(theme.colorBlue || 'inherit', "}\n\n.fMmrG_eKcq{background-color:").concat(theme.colorGrey || 'inherit', "}\n\n.fMmrG_euQM{padding:12px 0 12px 10px}\n\n.fMmrG_fuuc{padding-left:45px}\n\n.fMmrG_vDgC svg{fill:#fff}\n\n.fMmrG_fHMm{border-color:").concat(theme.colorHeaderBottomBorder || 'inherit', ";border-style:solid;border-width:0 0 1px 0}");
|
|
19
|
-
},
|
|
20
|
-
'iconWrapper': 'fMmrG_cvRx',
|
|
21
|
-
'collapsingTable': 'fMmrG_fPIL',
|
|
22
|
-
'onlyNoanswer': 'fMmrG_dzqP',
|
|
23
|
-
'correctIncorrect': 'fMmrG_fZpZ',
|
|
24
|
-
'correctIncorrectNoanswer': 'fMmrG_dgTJ',
|
|
25
|
-
'correctIncorrectNoanswerGraded': 'fMmrG_bYLj',
|
|
26
|
-
'correctBackground': 'fMmrG_bvau',
|
|
27
|
-
'incorrectBackground': 'fMmrG_cxOH',
|
|
28
|
-
'gradedBackground': 'fMmrG_dsqS',
|
|
29
|
-
'noAnswerBackground': 'fMmrG_eKcq',
|
|
30
|
-
'labelWrapper': 'fMmrG_euQM',
|
|
31
|
-
'firstHeaderCell': 'fMmrG_fuuc',
|
|
32
|
-
'iconWhite': 'fMmrG_vDgC',
|
|
33
|
-
'headerCell': 'fMmrG_fHMm'
|
|
34
|
-
};
|
|
14
|
+
import { withStyle, jsx } from '@instructure/emotion';
|
|
15
|
+
import generateComponentTheme from "./theme.js";
|
|
16
|
+
import generateStyle from "./styles.js";
|
|
35
17
|
import { Flex } from '@instructure/ui-flex';
|
|
36
|
-
import classNames from 'classnames';
|
|
37
18
|
import { Text } from '@instructure/ui-text';
|
|
38
19
|
var noAnswerKey = 'noAnswer';
|
|
39
20
|
var incorrectKey = 'incorrect';
|
|
40
21
|
var correctKey = 'correct';
|
|
41
22
|
var gradedKey = 'graded';
|
|
42
23
|
|
|
43
|
-
var _ref =
|
|
24
|
+
var _ref = jsx(IconCheckSolid, null);
|
|
44
25
|
|
|
45
|
-
var _ref2 =
|
|
26
|
+
var _ref2 = jsx(IconGradebookSolid, null);
|
|
46
27
|
|
|
47
|
-
var _ref3 =
|
|
28
|
+
var _ref3 = jsx(IconXSolid, null);
|
|
48
29
|
|
|
49
|
-
var _ref4 =
|
|
30
|
+
var _ref4 = jsx(IconNoSolid, null);
|
|
50
31
|
|
|
51
|
-
export var AggregationTable = (_dec =
|
|
32
|
+
export var AggregationTable = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
52
33
|
_inherits(AggregationTable, _Component);
|
|
53
34
|
|
|
54
35
|
var _super = _createSuper(AggregationTable);
|
|
@@ -70,52 +51,54 @@ export var AggregationTable = (_dec = themeable(theme, styles), _dec(_class = (_
|
|
|
70
51
|
var answerHeaderId = "answer-frequency-summary-aggregate-answer-".concat(itemId);
|
|
71
52
|
var respondentsHeaderId = "answer-frequency-summary-aggregate-respondents-".concat(itemId);
|
|
72
53
|
var percentageHeaderId = "answer-frequency-summary-aggregate-percentage-".concat(itemId);
|
|
73
|
-
return
|
|
54
|
+
return jsx(Table.Head, null, jsx(Table.Row, null, jsx(Table.ColHeader, {
|
|
74
55
|
id: answerHeaderId
|
|
75
|
-
},
|
|
76
|
-
|
|
77
|
-
}, t('Result'))),
|
|
56
|
+
}, jsx("span", {
|
|
57
|
+
css: _this.props.styles.firstHeaderCell
|
|
58
|
+
}, t('Result'))), jsx(Table.ColHeader, {
|
|
78
59
|
id: respondentsHeaderId,
|
|
79
60
|
textAlign: "center"
|
|
80
|
-
}, t('Respondents')),
|
|
61
|
+
}, t('Respondents')), jsx(Table.ColHeader, {
|
|
81
62
|
id: percentageHeaderId,
|
|
82
63
|
textAlign: "center"
|
|
83
64
|
}, t('Percentage'))));
|
|
84
65
|
};
|
|
85
66
|
|
|
86
67
|
_this.renderRow = function (key, icon, label, count, percentage) {
|
|
87
|
-
var backgroundColor = styles["".concat(key, "Background")];
|
|
68
|
+
var backgroundColor = _this.props.styles["".concat(key, "Background")];
|
|
69
|
+
|
|
88
70
|
var concatenatedPercentage = "".concat(percentage, "%");
|
|
89
|
-
return
|
|
71
|
+
return jsx(Table.Row, {
|
|
90
72
|
key: key
|
|
91
|
-
},
|
|
73
|
+
}, jsx(Table.RowHeader, {
|
|
92
74
|
themeOverride: {
|
|
93
75
|
padding: '0px'
|
|
94
76
|
}
|
|
95
|
-
},
|
|
77
|
+
}, jsx(Flex, {
|
|
96
78
|
direction: "row",
|
|
97
79
|
alignItems: "center"
|
|
98
|
-
},
|
|
80
|
+
}, jsx(Flex.Item, {
|
|
99
81
|
width: "46px",
|
|
100
82
|
textAlign: "center",
|
|
101
83
|
align: "stretch"
|
|
102
|
-
},
|
|
103
|
-
|
|
104
|
-
}, icon)),
|
|
84
|
+
}, jsx("div", {
|
|
85
|
+
css: [_this.props.styles.iconWrapper, backgroundColor]
|
|
86
|
+
}, icon)), jsx(Flex.Item, {
|
|
105
87
|
shouldShrink: true
|
|
106
|
-
},
|
|
107
|
-
|
|
108
|
-
|
|
88
|
+
}, jsx("div", {
|
|
89
|
+
"data-testid": "label-wrapper",
|
|
90
|
+
css: _this.props.styles.labelWrapper
|
|
91
|
+
}, jsx(Text, null, label))))), jsx(Table.Cell, {
|
|
109
92
|
themeOverride: {
|
|
110
93
|
padding: '0px'
|
|
111
94
|
},
|
|
112
95
|
textAlign: "center"
|
|
113
|
-
},
|
|
96
|
+
}, jsx(Text, null, count)), jsx(Table.Cell, {
|
|
114
97
|
themeOverride: {
|
|
115
98
|
padding: '0px'
|
|
116
99
|
},
|
|
117
100
|
textAlign: "center"
|
|
118
|
-
},
|
|
101
|
+
}, jsx(Text, null, concatenatedPercentage)));
|
|
119
102
|
};
|
|
120
103
|
|
|
121
104
|
_this.gradedExist = function () {
|
|
@@ -192,11 +175,12 @@ export var AggregationTable = (_dec = themeable(theme, styles), _dec(_class = (_
|
|
|
192
175
|
|
|
193
176
|
_this.render = function () {
|
|
194
177
|
var popover = !_this.noAnswerExist();
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
178
|
+
var tableStyles = [_this.props.styles.collapsingTable, _this.props.styles[_this.getColorProfile()]];
|
|
179
|
+
return jsx("div", {
|
|
180
|
+
css: tableStyles
|
|
181
|
+
}, jsx(Table, {
|
|
198
182
|
caption: t('Answer Frequency Summary Aggregates')
|
|
199
|
-
}, _this.renderHeaderRow(popover),
|
|
183
|
+
}, _this.renderHeaderRow(popover), jsx(Table.Body, null, _this.correctExist() && _this.renderCorrect(), _this.gradedExist() && _this.renderGraded(), _this.incorrectExist() && _this.renderIncorrect(), _this.noAnswerExist() && _this.renderNoAnswer())));
|
|
200
184
|
};
|
|
201
185
|
|
|
202
186
|
return _this;
|
|
@@ -205,5 +189,6 @@ export var AggregationTable = (_dec = themeable(theme, styles), _dec(_class = (_
|
|
|
205
189
|
return AggregationTable;
|
|
206
190
|
}(Component), _class2.propTypes = {
|
|
207
191
|
itemId: PropTypes.number.isRequired,
|
|
208
|
-
answerSummary: onlyAggregatePropType
|
|
209
|
-
|
|
192
|
+
answerSummary: onlyAggregatePropType.isRequired,
|
|
193
|
+
styles: PropTypes.object
|
|
194
|
+
}, _temp)) || _class);
|