@instructure/quiz-core 20.4.2-rc.3 → 20.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/ChoiceType/presenter.js +2 -2
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/MatchingTypeTable/presenter.js +1 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/RichFillBlankType/index.js +1 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/RichFillBlankType/presenter.js +92 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/RichFillBlankType/styles.js +10 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/RichFillBlankType/theme.js +8 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/presenter.js +5 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AggregationTable/presenter.js +1 -2
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ChoiceGroupTypeTable/index.js +1 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ChoiceGroupTypeTable/presenter.js +165 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ChoiceGroupTypeTable/styles.js +15 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ChoiceGroupTypeTable/theme.js +9 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/{ChoiceType → shared}/ChoiceTypeTable/presenter.js +23 -20
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/propTypes.js +29 -11
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/ChoiceType/presenter.js +2 -2
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/MatchingTypeTable/presenter.js +1 -0
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/RichFillBlankType/index.js +13 -0
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/RichFillBlankType/presenter.js +115 -0
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/RichFillBlankType/styles.js +18 -0
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/RichFillBlankType/theme.js +16 -0
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/presenter.js +13 -7
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AggregationTable/presenter.js +1 -3
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ChoiceGroupTypeTable/index.js +13 -0
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ChoiceGroupTypeTable/presenter.js +189 -0
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ChoiceGroupTypeTable/styles.js +23 -0
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ChoiceGroupTypeTable/theme.js +17 -0
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/{ChoiceType → shared}/ChoiceTypeTable/presenter.js +22 -19
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/propTypes.js +38 -10
- package/package.json +10 -10
- /package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/{ChoiceType → shared}/ChoiceTypeTable/index.js +0 -0
- /package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/{ChoiceType → shared}/ChoiceTypeTable/theme.js +0 -0
- /package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/{ChoiceType → shared}/ChoiceTypeTable/index.js +0 -0
- /package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/{ChoiceType → shared}/ChoiceTypeTable/theme.js +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,18 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [20.5.0](https://gerrit.instructure.com/quizzes-ui/compare/v20.4.1...v20.5.0) (2024-02-02)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **quiz-core:** Add IA fitb summary ([5d544ab](https://gerrit.instructure.com/quizzes-ui/commits/5d544abec00c2bb7bfee38f639e1d5cb53449e70))
|
|
12
|
+
* **quizzes-ui:** Enhance stem blank parts on the UI ([22ec8e3](https://gerrit.instructure.com/quizzes-ui/commits/22ec8e38d00de672820ed31af18d8936f9d54d6f))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
6
18
|
## [20.4.1](https://gerrit.instructure.com/quizzes-ui/compare/v20.4.0...v20.4.1) (2024-01-30)
|
|
7
19
|
|
|
8
20
|
**Note:** Version bump only for package @instructure/quiz-core
|
|
@@ -3,7 +3,7 @@ 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 ChoiceTypeTable from "
|
|
6
|
+
import ChoiceTypeTable from "../shared/ChoiceTypeTable/index.js";
|
|
7
7
|
import { choiceTypeAnswerSummaryPropType } from "../../propTypes.js";
|
|
8
8
|
import AggregationTable from "../shared/AggregationTable/index.js";
|
|
9
9
|
import { AfsPartsContainer } from "../shared/AfsPartsContainer/presenter.js";
|
|
@@ -31,7 +31,7 @@ export var ChoiceType = /*#__PURE__*/function (_Component) {
|
|
|
31
31
|
return /*#__PURE__*/React.createElement(AfsTableWrapper, null, /*#__PURE__*/React.createElement(AfsPartsContainer, {
|
|
32
32
|
afsTable: /*#__PURE__*/React.createElement(ChoiceTypeTable, {
|
|
33
33
|
itemId: itemId,
|
|
34
|
-
|
|
34
|
+
choices: answerSummary.choices
|
|
35
35
|
}),
|
|
36
36
|
aggregationTable: /*#__PURE__*/React.createElement(AggregationTable, {
|
|
37
37
|
itemId: itemId,
|
|
@@ -111,6 +111,7 @@ export var MatchingTypeTable = (_dec = themeable(theme, styles), _dec(_class = (
|
|
|
111
111
|
padding: '0 0 0 0'
|
|
112
112
|
}
|
|
113
113
|
}, /*#__PURE__*/React.createElement(ScreenReaderContent, null, correct ? "".concat(t('Correct answer'), ": ").concat(count) : count), /*#__PURE__*/React.createElement("div", {
|
|
114
|
+
"aria-hidden": "true",
|
|
114
115
|
className: containerClassNames
|
|
115
116
|
}, /*#__PURE__*/React.createElement(Flex, {
|
|
116
117
|
direction: "row",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { RichFillBlankType as default } from "./presenter.js";
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
|
+
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
3
|
+
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
4
|
+
|
|
5
|
+
var _dec, _class, _class2, _temp;
|
|
6
|
+
|
|
7
|
+
/** @jsx jsx */
|
|
8
|
+
import { Component } from 'react';
|
|
9
|
+
import PropTypes from 'prop-types';
|
|
10
|
+
import { richFillBlankTypeAnswerSummaryPropType } from "../../propTypes.js";
|
|
11
|
+
import AfsTableWrapper from "../shared/AfsTableWrapper/index.js";
|
|
12
|
+
import { AfsPartsContainer } from "../shared/AfsPartsContainer/presenter.js";
|
|
13
|
+
import ChoiceGroupTypeTable from "../shared/ChoiceGroupTypeTable/index.js";
|
|
14
|
+
import { Text } from '@instructure/ui-text';
|
|
15
|
+
import t from '@instructure/quiz-i18n/es/format-message';
|
|
16
|
+
import AggregationTable from "../shared/AggregationTable/index.js";
|
|
17
|
+
import { withStyle, jsx } from '@instructure/emotion';
|
|
18
|
+
import generateStyle from "./styles.js";
|
|
19
|
+
import generateComponentTheme from "./theme.js";
|
|
20
|
+
export var RichFillBlankType = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
21
|
+
_inherits(RichFillBlankType, _Component);
|
|
22
|
+
|
|
23
|
+
var _super = _createSuper(RichFillBlankType);
|
|
24
|
+
|
|
25
|
+
function RichFillBlankType() {
|
|
26
|
+
var _this;
|
|
27
|
+
|
|
28
|
+
_classCallCheck(this, RichFillBlankType);
|
|
29
|
+
|
|
30
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
31
|
+
args[_key] = arguments[_key];
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
35
|
+
|
|
36
|
+
_this.renderBlankInfo = function (blank) {
|
|
37
|
+
var _blank$aggregate, _blank$aggregate2;
|
|
38
|
+
|
|
39
|
+
var correctCount = (blank === null || blank === void 0 ? void 0 : (_blank$aggregate = blank.aggregate) === null || _blank$aggregate === void 0 ? void 0 : _blank$aggregate.correct) || 0;
|
|
40
|
+
var incorrectCount = (blank === null || blank === void 0 ? void 0 : (_blank$aggregate2 = blank.aggregate) === null || _blank$aggregate2 === void 0 ? void 0 : _blank$aggregate2.incorrect) || 0;
|
|
41
|
+
var noAnswer = (blank === null || blank === void 0 ? void 0 : blank.no_answer) || 0;
|
|
42
|
+
var correctString = "".concat(t('Correct'), ": ").concat(correctCount, " ");
|
|
43
|
+
var incorrectString = "".concat(t('Incorrect'), ": ").concat(incorrectCount, " ");
|
|
44
|
+
var noAnswerString = "".concat(t('No Answer'), ": ").concat(noAnswer, " ");
|
|
45
|
+
return jsx("div", {
|
|
46
|
+
css: _this.props.styles.groupAggregationContainer
|
|
47
|
+
}, jsx(Text, null, correctString), jsx(Text, null, incorrectString), jsx(Text, null, noAnswerString));
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
_this.renderGroup = function (key, itemId, blank, index) {
|
|
51
|
+
return jsx(ChoiceGroupTypeTable, {
|
|
52
|
+
key: key,
|
|
53
|
+
itemId: itemId,
|
|
54
|
+
blank: blank,
|
|
55
|
+
blankInfo: _this.renderBlankInfo(blank),
|
|
56
|
+
index: index
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
_this.renderGroups = function () {
|
|
61
|
+
var _this$props = _this.props,
|
|
62
|
+
answerSummary = _this$props.answerSummary,
|
|
63
|
+
itemId = _this$props.itemId;
|
|
64
|
+
var blanks = answerSummary.blanks;
|
|
65
|
+
return blanks.map(function (blank, index) {
|
|
66
|
+
var key = "ChoiceGroupTypeTable_".concat(index);
|
|
67
|
+
return _this.renderGroup(key, itemId, blank, index);
|
|
68
|
+
});
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
_this.render = function () {
|
|
72
|
+
var _this$props2 = _this.props,
|
|
73
|
+
answerSummary = _this$props2.answerSummary,
|
|
74
|
+
itemId = _this$props2.itemId;
|
|
75
|
+
return jsx(AfsTableWrapper, null, jsx(AfsPartsContainer, {
|
|
76
|
+
afsTable: _this.renderGroups(),
|
|
77
|
+
aggregationTable: jsx(AggregationTable, {
|
|
78
|
+
itemId: itemId,
|
|
79
|
+
answerSummary: answerSummary
|
|
80
|
+
})
|
|
81
|
+
}));
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
return _this;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
return RichFillBlankType;
|
|
88
|
+
}(Component), _class2.propTypes = {
|
|
89
|
+
itemId: PropTypes.number.isRequired,
|
|
90
|
+
answerSummary: richFillBlankTypeAnswerSummaryPropType.isRequired,
|
|
91
|
+
styles: PropTypes.object
|
|
92
|
+
}.isRequired, _temp)) || _class);
|
package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/presenter.js
CHANGED
|
@@ -5,6 +5,7 @@ import React, { Component } from 'react';
|
|
|
5
5
|
import { PropTypes } from '@instructure/quiz-interactions';
|
|
6
6
|
import LegacyChoiceType from "./LegacyChoiceType/index.js";
|
|
7
7
|
import ChoiceType from "./ChoiceType/index.js";
|
|
8
|
+
import RichFillBlankType from "./RichFillBlankType/index.js";
|
|
8
9
|
import AggregationType from "./AggregationType/index.js";
|
|
9
10
|
import { MatchingType, OrderingType, CategorizationType } from "./MatchingType/index.js";
|
|
10
11
|
import { afsFlags, answerSummaryPropType } from "../propTypes.js";
|
|
@@ -57,6 +58,10 @@ export var AnswerFrequencySummary = /*#__PURE__*/function (_Component) {
|
|
|
57
58
|
if (afsFlags.multiAnswerEnabled) {
|
|
58
59
|
_this.afsTableComponentMap.set('multi-answer', ChoiceType);
|
|
59
60
|
}
|
|
61
|
+
|
|
62
|
+
if (afsFlags.fillInTheBlankEnabled) {
|
|
63
|
+
_this.afsTableComponentMap.set('rich-fill-blank', RichFillBlankType);
|
|
64
|
+
}
|
|
60
65
|
};
|
|
61
66
|
|
|
62
67
|
_this.render = function () {
|
|
@@ -8,7 +8,6 @@ import React, { Component } from 'react';
|
|
|
8
8
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
9
9
|
import { Table } from '@instructure/ui-table';
|
|
10
10
|
import { onlyAggregatePropType } from "../../../propTypes.js";
|
|
11
|
-
import { ScreenReaderContent } from '@instructure/ui-a11y-content';
|
|
12
11
|
import PropTypes from 'prop-types';
|
|
13
12
|
import { IconCheckSolid, IconXSolid, IconNoSolid, IconOvalHalfSolid } from '@instructure/ui-icons';
|
|
14
13
|
import { themeable } from '@instructure/ui-themeable';
|
|
@@ -97,7 +96,7 @@ export var AggregationTable = (_dec = themeable(theme, styles), _dec(_class = (_
|
|
|
97
96
|
themeOverride: {
|
|
98
97
|
padding: '0px'
|
|
99
98
|
}
|
|
100
|
-
}, /*#__PURE__*/React.createElement(
|
|
99
|
+
}, /*#__PURE__*/React.createElement(Flex, {
|
|
101
100
|
direction: "row",
|
|
102
101
|
alignItems: "center"
|
|
103
102
|
}, /*#__PURE__*/React.createElement(Flex.Item, {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ChoiceGroupTypeTable as default } from "./presenter.js";
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
|
+
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
3
|
+
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
4
|
+
|
|
5
|
+
var _dec, _class, _class2, _temp;
|
|
6
|
+
|
|
7
|
+
/** @jsx jsx */
|
|
8
|
+
import { Component } from 'react';
|
|
9
|
+
import PropTypes from 'prop-types';
|
|
10
|
+
import { choiceTypeObject } from "../../../propTypes.js";
|
|
11
|
+
import { Flex } from '@instructure/ui-flex';
|
|
12
|
+
import { Text } from '@instructure/ui-text';
|
|
13
|
+
import ExpandButton from "../../../../../../../common/components/shared/ExpandButton/index.js";
|
|
14
|
+
import t from '@instructure/quiz-i18n/es/format-message';
|
|
15
|
+
import Card from "../../../../../../../common/components/shared/Card/index.js";
|
|
16
|
+
import ChoiceTypeTable from "../ChoiceTypeTable/index.js";
|
|
17
|
+
import BlankIcon from "../../../NewItemAnalysis/BlankIcon/index.js";
|
|
18
|
+
import { withStyle, jsx } from '@instructure/emotion';
|
|
19
|
+
import generateStyle from "./styles.js";
|
|
20
|
+
import generateComponentTheme from "./theme.js";
|
|
21
|
+
export var ChoiceGroupTypeTable = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
22
|
+
_inherits(ChoiceGroupTypeTable, _Component);
|
|
23
|
+
|
|
24
|
+
var _super = _createSuper(ChoiceGroupTypeTable);
|
|
25
|
+
|
|
26
|
+
function ChoiceGroupTypeTable() {
|
|
27
|
+
var _this;
|
|
28
|
+
|
|
29
|
+
_classCallCheck(this, ChoiceGroupTypeTable);
|
|
30
|
+
|
|
31
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
32
|
+
args[_key] = arguments[_key];
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
36
|
+
_this.state = {
|
|
37
|
+
bodyExpanded: false
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
_this.getTranslatedBlankType = function (blank_type) {
|
|
41
|
+
switch (blank_type) {
|
|
42
|
+
case 'openEntry':
|
|
43
|
+
return t('Open Entry');
|
|
44
|
+
|
|
45
|
+
case 'wordbank':
|
|
46
|
+
return t('Word Bank');
|
|
47
|
+
|
|
48
|
+
case 'dropdown':
|
|
49
|
+
return t('Dropdown');
|
|
50
|
+
|
|
51
|
+
default:
|
|
52
|
+
return blank_type;
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
_this.handleBodyToggle = function () {
|
|
57
|
+
_this.setState({
|
|
58
|
+
bodyExpanded: !_this.state.bodyExpanded
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
_this.renderTable = function () {
|
|
63
|
+
var _this$props = _this.props,
|
|
64
|
+
itemId = _this$props.itemId,
|
|
65
|
+
blank = _this$props.blank,
|
|
66
|
+
index = _this$props.index;
|
|
67
|
+
var choices = blank.choices;
|
|
68
|
+
var tableId = "".concat(itemId, "_").concat(index, "_choiceGroup");
|
|
69
|
+
var tableContainerSizeClass = '';
|
|
70
|
+
return jsx(ChoiceTypeTable, {
|
|
71
|
+
itemId: tableId,
|
|
72
|
+
choices: choices,
|
|
73
|
+
tableContainerSizeClass: tableContainerSizeClass
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
_this.renderBlankIcon = function () {
|
|
78
|
+
var index = _this.props.index;
|
|
79
|
+
var blankIconKey = "blank_icon_".concat(index);
|
|
80
|
+
return jsx(BlankIcon, {
|
|
81
|
+
key: blankIconKey,
|
|
82
|
+
number: index + 1
|
|
83
|
+
});
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
_this.renderHeadLine = function () {
|
|
87
|
+
var _this$props2 = _this.props,
|
|
88
|
+
blank = _this$props2.blank,
|
|
89
|
+
blankInfo = _this$props2.blankInfo;
|
|
90
|
+
var blank_text = blank.blank_text,
|
|
91
|
+
blank_type = blank.blank_type;
|
|
92
|
+
var blankTextAndType = "".concat(blank_text, " (").concat(_this.getTranslatedBlankType(blank_type), ")");
|
|
93
|
+
return jsx(Flex, {
|
|
94
|
+
overflowY: "visible",
|
|
95
|
+
direction: "row",
|
|
96
|
+
alignItems: "start",
|
|
97
|
+
wrap: "wrap"
|
|
98
|
+
}, jsx(Flex.Item, null, _this.renderBlankIcon()), jsx(Flex.Item, {
|
|
99
|
+
margin: "xxx-small medium small x-small"
|
|
100
|
+
}, jsx(Text, {
|
|
101
|
+
weight: "bold"
|
|
102
|
+
}, blankTextAndType)), jsx(Flex.Item, {
|
|
103
|
+
shouldShrink: true,
|
|
104
|
+
margin: "xxx-small none small none"
|
|
105
|
+
}, blankInfo));
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
_this.renderGroup = function () {
|
|
109
|
+
return jsx(Flex, {
|
|
110
|
+
direction: "row",
|
|
111
|
+
alignItems: "start"
|
|
112
|
+
}, jsx(Flex.Item, {
|
|
113
|
+
shouldShrink: true,
|
|
114
|
+
shouldGrow: true,
|
|
115
|
+
margin: "xx-small none none none"
|
|
116
|
+
}, _this.renderHeadLine()), jsx(Flex.Item, {
|
|
117
|
+
margin: "none none none x-small"
|
|
118
|
+
}, jsx(ExpandButton, {
|
|
119
|
+
onClick: _this.handleBodyToggle,
|
|
120
|
+
title: _this.state.bodyExpanded ? t('collapse group result') : t('expand group result'),
|
|
121
|
+
isExpanded: _this.state.bodyExpanded
|
|
122
|
+
})));
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
_this.render = function () {
|
|
126
|
+
return jsx("div", {
|
|
127
|
+
css: _this.props.styles.groupWrapper
|
|
128
|
+
}, jsx(Card, {
|
|
129
|
+
css: _this.props.styles.cardWrapper
|
|
130
|
+
}, jsx(Flex, {
|
|
131
|
+
direction: "column",
|
|
132
|
+
justifyItems: "start"
|
|
133
|
+
}, jsx(Flex.Item, {
|
|
134
|
+
overflowY: "visible"
|
|
135
|
+
}, jsx(Flex.Item, {
|
|
136
|
+
shouldGrow: true,
|
|
137
|
+
shouldShrink: true
|
|
138
|
+
}, jsx(Flex, {
|
|
139
|
+
direction: "column",
|
|
140
|
+
justifyItems: "start"
|
|
141
|
+
}, jsx(Flex.Item, {
|
|
142
|
+
shouldShrink: true,
|
|
143
|
+
padding: "x-small small x-small medium",
|
|
144
|
+
overflowY: "hidden"
|
|
145
|
+
}, _this.renderGroup()), _this.state.bodyExpanded && jsx(Flex.Item, {
|
|
146
|
+
shouldShrink: true,
|
|
147
|
+
padding: "x-small small x-small small"
|
|
148
|
+
}, _this.renderTable())))))));
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
return _this;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
return ChoiceGroupTypeTable;
|
|
155
|
+
}(Component), _class2.propTypes = {
|
|
156
|
+
itemId: PropTypes.number.isRequired,
|
|
157
|
+
blank: PropTypes.shape({
|
|
158
|
+
choices: PropTypes.arrayOf(choiceTypeObject).isRequired,
|
|
159
|
+
blank_text: PropTypes.string.isRequired,
|
|
160
|
+
blank_type: PropTypes.string.isRequired
|
|
161
|
+
}).isRequired,
|
|
162
|
+
blankInfo: PropTypes.node.isRequired,
|
|
163
|
+
index: PropTypes.number.isRequired,
|
|
164
|
+
styles: PropTypes.object
|
|
165
|
+
}.isRequired, _temp)) || _class);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
var generateStyle = function generateStyle(componentTheme) {
|
|
2
|
+
return {
|
|
3
|
+
groupWrapper: {
|
|
4
|
+
padding: '0',
|
|
5
|
+
width: 'calc(25% + 350px)',
|
|
6
|
+
minWidth: componentTheme.cardMinWidth,
|
|
7
|
+
maxWidth: '100%'
|
|
8
|
+
},
|
|
9
|
+
cardWrapper: {
|
|
10
|
+
margin: "0 0 ".concat(componentTheme.cardBottomMargin, " 0")
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export default generateStyle;
|
|
@@ -12,21 +12,22 @@ import { Table } from '@instructure/ui-table';
|
|
|
12
12
|
import { themeable } from '@instructure/ui-themeable';
|
|
13
13
|
import { ScreenReaderContent } from '@instructure/ui-a11y-content';
|
|
14
14
|
import PropTypes from 'prop-types';
|
|
15
|
-
import {
|
|
15
|
+
import { choiceTypeObject } from "../../../propTypes.js";
|
|
16
16
|
var styles = {
|
|
17
|
-
componentId: '
|
|
17
|
+
componentId: 'cYrxJ',
|
|
18
18
|
template: function template(theme) {
|
|
19
|
-
return "\n\n.
|
|
19
|
+
return "\n\n.cYrxJ_rMrG{display:flex;flex-basis:100%;flex-direction:column;padding-bottom:".concat(theme.tableBottomPadding || 'inherit', "}\n\n.cYrxJ_fgIl{max-width:100%;width:calc(25% + 350px)}\n\n.cYrxJ_SVtU table{border-collapse:separate;border-spacing:0 1px}\n\n.cYrxJ_eviJ table thead tr td,.cYrxJ_eviJ table thead tr th{border-bottom:solid 0.0625rem ").concat(theme.colorGray || 'inherit', "}\n\n.cYrxJ_SVtU table tbody tr th{font-weight:400;width:33.33%}\n\n.cYrxJ_SVtU table tbody tr td{width:33.33%}\n\n.cYrxJ_cvRx{align-items:center;display:flex;height:100%;justify-content:center;min-height:47px;width:46px}\n\n.cYrxJ_EKAb{background-color:").concat(theme.colorGreen || 'inherit', "}\n\n.cYrxJ_EKAb svg{fill:#fff}\n\n.cYrxJ_cCmC{align-items:center;display:flex;height:calc(100% - 4px);justify-content:center}\n\n.cYrxJ_dJVn{padding:").concat(theme.cellPadding || 'inherit', "}\n\n.cYrxJ_eEOp td,.cYrxJ_eEOp th{border-bottom:solid 0.0625rem ").concat(theme.colorGray || 'inherit', "}\n\n.cYrxJ_UAZE td{border-width:2px 0 2px 0}\n\n.cYrxJ_UAZE td,.cYrxJ_UAZE th:first-child{border-color:").concat(theme.colorGreen || 'inherit', ";border-style:solid}\n\n.cYrxJ_UAZE th:first-child{border-radius:4px 0 0 4px;border-width:2px 0 2px 2px}\n\n.cYrxJ_UAZE td:last-child{border-color:").concat(theme.colorGreen || 'inherit', ";border-radius:0 4px 4px 0;border-style:solid;border-width:2px 2px 2px 0}");
|
|
20
20
|
},
|
|
21
|
-
'tableWrapper': '
|
|
22
|
-
'
|
|
23
|
-
'
|
|
24
|
-
'
|
|
25
|
-
'
|
|
26
|
-
'
|
|
27
|
-
'
|
|
28
|
-
'
|
|
29
|
-
'
|
|
21
|
+
'tableWrapper': 'cYrxJ_rMrG',
|
|
22
|
+
'tableWidthMax': 'cYrxJ_fgIl',
|
|
23
|
+
'tableContainer': 'cYrxJ_SVtU',
|
|
24
|
+
'headerGrayBottomBorder': 'cYrxJ_eviJ',
|
|
25
|
+
'iconWrapper': 'cYrxJ_cvRx',
|
|
26
|
+
'iconCorrect': 'cYrxJ_EKAb',
|
|
27
|
+
'textContainer': 'cYrxJ_cCmC',
|
|
28
|
+
'firstTextContainer': 'cYrxJ_dJVn',
|
|
29
|
+
'incorrectRow': 'cYrxJ_eEOp',
|
|
30
|
+
'correctRow': 'cYrxJ_UAZE'
|
|
30
31
|
};
|
|
31
32
|
import theme from "./theme.js";
|
|
32
33
|
import classNames from 'classnames';
|
|
@@ -96,8 +97,7 @@ export var ChoiceTypeTable = (_dec = themeable(theme, styles), _dec(_class = (_t
|
|
|
96
97
|
};
|
|
97
98
|
|
|
98
99
|
_this.getDataIconAttribute = function (correct, choiceIndex) {
|
|
99
|
-
var
|
|
100
|
-
var choices = answerSummary.choices;
|
|
100
|
+
var choices = _this.props.choices;
|
|
101
101
|
|
|
102
102
|
if (_this.nextChoiceIsCorrect(choices, choiceIndex + 1) && !correct) {
|
|
103
103
|
return '';
|
|
@@ -171,13 +171,13 @@ export var ChoiceTypeTable = (_dec = themeable(theme, styles), _dec(_class = (_t
|
|
|
171
171
|
|
|
172
172
|
_this.render = function () {
|
|
173
173
|
var _this$props = _this.props,
|
|
174
|
-
|
|
175
|
-
itemId = _this$props.itemId
|
|
176
|
-
|
|
174
|
+
choices = _this$props.choices,
|
|
175
|
+
itemId = _this$props.itemId,
|
|
176
|
+
tableContainerSizeClass = _this$props.tableContainerSizeClass;
|
|
177
177
|
var answerHeaderId = "answer-frequency-summary-answer-".concat(itemId);
|
|
178
178
|
var respondentsHeaderId = "answer-frequency-summary-respondents-".concat(itemId);
|
|
179
179
|
var percentageHeaderId = "answer-frequency-summary-percentage-".concat(itemId);
|
|
180
|
-
var containerClasses = classNames(styles.tableContainer, _defineProperty({}, styles.headerGrayBottomBorder, !_this.nextChoiceIsCorrect(choices, 0)));
|
|
180
|
+
var containerClasses = classNames(tableContainerSizeClass, styles.tableContainer, _defineProperty({}, styles.headerGrayBottomBorder, !_this.nextChoiceIsCorrect(choices, 0)));
|
|
181
181
|
return /*#__PURE__*/React.createElement("div", {
|
|
182
182
|
className: containerClasses
|
|
183
183
|
}, /*#__PURE__*/React.createElement(Table, {
|
|
@@ -206,5 +206,8 @@ export var ChoiceTypeTable = (_dec = themeable(theme, styles), _dec(_class = (_t
|
|
|
206
206
|
return ChoiceTypeTable;
|
|
207
207
|
}(Component), _class2.propTypes = {
|
|
208
208
|
itemId: PropTypes.number,
|
|
209
|
-
|
|
210
|
-
|
|
209
|
+
choices: PropTypes.arrayOf(choiceTypeObject),
|
|
210
|
+
tableContainerClass: PropTypes.string
|
|
211
|
+
}.isRequired, _class2.defaultProps = {
|
|
212
|
+
tableContainerSizeClass: styles.tableWidthMax
|
|
213
|
+
}, _temp)) || _class);
|
|
@@ -26,11 +26,11 @@ export var quizAnalysisPropType = PropTypes.shape({
|
|
|
26
26
|
average_attempts: PropTypes.number
|
|
27
27
|
}).isRequired
|
|
28
28
|
});
|
|
29
|
-
var aggregateDetailPropType = PropTypes.shape({
|
|
29
|
+
export var aggregateDetailPropType = PropTypes.shape({
|
|
30
30
|
count: PropTypes.number.isRequired,
|
|
31
31
|
percentage: PropTypes.number.isRequired
|
|
32
32
|
});
|
|
33
|
-
var aggregatePropType = PropTypes.shape({
|
|
33
|
+
export var aggregatePropType = PropTypes.shape({
|
|
34
34
|
correct: aggregateDetailPropType.isRequired,
|
|
35
35
|
incorrect: aggregateDetailPropType.isRequired,
|
|
36
36
|
partial_correct: aggregateDetailPropType
|
|
@@ -39,14 +39,16 @@ export var onlyAggregatePropType = PropTypes.shape({
|
|
|
39
39
|
no_answer: aggregateDetailPropType,
|
|
40
40
|
aggregate: aggregatePropType
|
|
41
41
|
});
|
|
42
|
+
export var choiceTypeObject = PropTypes.shape({
|
|
43
|
+
body: PropTypes.string,
|
|
44
|
+
correct: PropTypes.bool,
|
|
45
|
+
count: PropTypes.number,
|
|
46
|
+
percentage: PropTypes.number
|
|
47
|
+
});
|
|
42
48
|
export var choiceTypeAnswerSummaryPropType = PropTypes.shape({
|
|
43
|
-
choices: PropTypes.arrayOf(
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
count: PropTypes.number,
|
|
47
|
-
percentage: PropTypes.number
|
|
48
|
-
})),
|
|
49
|
-
no_answer: aggregateDetailPropType
|
|
49
|
+
choices: PropTypes.arrayOf(choiceTypeObject),
|
|
50
|
+
no_answer: aggregateDetailPropType,
|
|
51
|
+
aggregate: aggregatePropType
|
|
50
52
|
});
|
|
51
53
|
export var matchingTypeAnswerSummaryPropType = PropTypes.shape({
|
|
52
54
|
questions: PropTypes.objectOf(PropTypes.shape({
|
|
@@ -57,9 +59,25 @@ export var matchingTypeAnswerSummaryPropType = PropTypes.shape({
|
|
|
57
59
|
body: PropTypes.string,
|
|
58
60
|
distractor: PropTypes.bool
|
|
59
61
|
}))
|
|
60
|
-
}))
|
|
62
|
+
})),
|
|
63
|
+
no_answer: aggregateDetailPropType,
|
|
64
|
+
aggregate: aggregatePropType
|
|
65
|
+
});
|
|
66
|
+
export var richFillBlankTypeAnswerSummaryPropType = PropTypes.shape({
|
|
67
|
+
blanks: PropTypes.arrayOf(PropTypes.shape({
|
|
68
|
+
choices: PropTypes.arrayOf(choiceTypeObject),
|
|
69
|
+
blank_text: PropTypes.string,
|
|
70
|
+
blank_type: PropTypes.string,
|
|
71
|
+
no_answer: PropTypes.number,
|
|
72
|
+
aggregate: PropTypes.shape({
|
|
73
|
+
correct: PropTypes.number,
|
|
74
|
+
incorrect: PropTypes.number
|
|
75
|
+
})
|
|
76
|
+
})),
|
|
77
|
+
no_answer: aggregateDetailPropType,
|
|
78
|
+
aggregate: aggregatePropType
|
|
61
79
|
});
|
|
62
|
-
export var answerSummaryPropType = PropTypes.oneOfType([choiceTypeAnswerSummaryPropType, onlyAggregatePropType, matchingTypeAnswerSummaryPropType]);
|
|
80
|
+
export var answerSummaryPropType = PropTypes.oneOfType([choiceTypeAnswerSummaryPropType, onlyAggregatePropType, matchingTypeAnswerSummaryPropType, richFillBlankTypeAnswerSummaryPropType]);
|
|
63
81
|
export var itemAnalysisPropType = PropTypes.shape({
|
|
64
82
|
attempts: PropTypes.shape({
|
|
65
83
|
students_responded: PropTypes.number,
|
|
@@ -19,7 +19,7 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
19
19
|
|
|
20
20
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
21
21
|
|
|
22
|
-
var _index = _interopRequireDefault(require("
|
|
22
|
+
var _index = _interopRequireDefault(require("../shared/ChoiceTypeTable/index.js"));
|
|
23
23
|
|
|
24
24
|
var _propTypes2 = require("../../propTypes.js");
|
|
25
25
|
|
|
@@ -52,7 +52,7 @@ var ChoiceType = /*#__PURE__*/function (_Component) {
|
|
|
52
52
|
return /*#__PURE__*/_react.default.createElement(_index3.default, null, /*#__PURE__*/_react.default.createElement(_presenter.AfsPartsContainer, {
|
|
53
53
|
afsTable: /*#__PURE__*/_react.default.createElement(_index.default, {
|
|
54
54
|
itemId: itemId,
|
|
55
|
-
|
|
55
|
+
choices: answerSummary.choices
|
|
56
56
|
}),
|
|
57
57
|
aggregationTable: /*#__PURE__*/_react.default.createElement(_index2.default, {
|
|
58
58
|
itemId: itemId,
|
|
@@ -138,6 +138,7 @@ var MatchingTypeTable = (_dec = (0, _uiThemeable.themeable)(_theme.default, styl
|
|
|
138
138
|
padding: '0 0 0 0'
|
|
139
139
|
}
|
|
140
140
|
}, /*#__PURE__*/_react.default.createElement(_uiA11yContent.ScreenReaderContent, null, correct ? "".concat((0, _formatMessage.default)('Correct answer'), ": ").concat(count) : count), /*#__PURE__*/_react.default.createElement("div", {
|
|
141
|
+
"aria-hidden": "true",
|
|
141
142
|
className: containerClassNames
|
|
142
143
|
}, /*#__PURE__*/_react.default.createElement(_uiFlex.Flex, {
|
|
143
144
|
direction: "row",
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "default", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function get() {
|
|
9
|
+
return _presenter.RichFillBlankType;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
var _presenter = require("./presenter.js");
|