@instructure/quiz-core 20.7.1-rc.7 → 20.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/NumericType/ChoiceTypeWithInfo/index.js +1 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/NumericType/ChoiceTypeWithInfo/presenter.js +90 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/NumericType/index.js +1 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/NumericType/presenter.js +255 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/{shared/ChoiceGroupTypeTable → NumericType}/theme.js +1 -2
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/{shared → RichFillBlankType}/ChoiceGroupTypeTable/presenter.js +23 -59
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/RichFillBlankType/ChoiceGroupTypeTable/styles.js +10 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/RichFillBlankType/presenter.js +11 -35
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/ScoreDistributionType/Table/index.js +120 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/ScoreDistributionType/Table/styles.js +38 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/ScoreDistributionType/Table/theme.js +11 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/ScoreDistributionType/index.js +55 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/presenter.js +14 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AfsTableWrapper/presenter.js +8 -2
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AggregationTable/presenter.js +34 -39
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ExpandableCard/index.js +1 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ExpandableCard/presenter.js +104 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/{ChoiceGroupTypeTable → ExpandableCard}/styles.js +3 -2
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ExpandableCard/theme.js +7 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/NewItemAnalysis/index.js +4 -1
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/propTypes.js +54 -4
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/NumericType/ChoiceTypeWithInfo/index.js +13 -0
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/NumericType/ChoiceTypeWithInfo/presenter.js +113 -0
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/NumericType/index.js +13 -0
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/NumericType/presenter.js +281 -0
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/{shared/ChoiceGroupTypeTable → NumericType}/theme.js +1 -2
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/{shared → RichFillBlankType}/ChoiceGroupTypeTable/presenter.js +27 -64
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/RichFillBlankType/ChoiceGroupTypeTable/styles.js +18 -0
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/RichFillBlankType/presenter.js +15 -39
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/ScoreDistributionType/Table/index.js +140 -0
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/ScoreDistributionType/Table/styles.js +46 -0
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/ScoreDistributionType/Table/theme.js +19 -0
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/ScoreDistributionType/index.js +80 -0
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/presenter.js +20 -4
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AfsTableWrapper/presenter.js +8 -2
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AggregationTable/presenter.js +33 -38
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ExpandableCard/index.js +13 -0
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ExpandableCard/presenter.js +124 -0
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/{ChoiceGroupTypeTable → ExpandableCard}/styles.js +3 -2
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ExpandableCard/theme.js +15 -0
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/NewItemAnalysis/index.js +4 -1
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/propTypes.js +70 -5
- package/package.json +10 -10
- /package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/{RichFillBlankType → NumericType}/styles.js +0 -0
- /package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/{shared → RichFillBlankType}/ChoiceGroupTypeTable/index.js +0 -0
- /package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/RichFillBlankType/{theme.js → ChoiceGroupTypeTable/theme.js} +0 -0
- /package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/{RichFillBlankType → NumericType}/styles.js +0 -0
- /package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/{shared → RichFillBlankType}/ChoiceGroupTypeTable/index.js +0 -0
- /package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/RichFillBlankType/{theme.js → ChoiceGroupTypeTable/theme.js} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,24 @@
|
|
|
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.8.0](https://gerrit.instructure.com/quizzes-ui/compare/v20.7.0...v20.8.0) (2024-02-28)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **Banks:** Sort By dropdown uses header names instead of ids ([a01b932](https://gerrit.instructure.com/quizzes-ui/commits/a01b93266a5146e60789cc91185333143897a8be))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
* **item-analysis:** adapt aggregation table ([89cc091](https://gerrit.instructure.com/quizzes-ui/commits/89cc0912a287d55922fb75a4c343b663875be5d9))
|
|
17
|
+
* **item-analysis:** answer frequency summary for essay and file-upload questions ([fa18909](https://gerrit.instructure.com/quizzes-ui/commits/fa1890974baa639fabfc8e64371fef39cfc57bc8))
|
|
18
|
+
* **quiz-core:** Add IA afs numeric ([9b86625](https://gerrit.instructure.com/quizzes-ui/commits/9b8662538d9fadf02ab2c441074cdc5f67aaca22))
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
6
24
|
# [20.7.0](https://gerrit.instructure.com/quizzes-ui/compare/v20.6.0...v20.7.0) (2024-02-22)
|
|
7
25
|
|
|
8
26
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ChoiceTypeWithInfo as default } from "./presenter.js";
|
|
@@ -0,0 +1,90 @@
|
|
|
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
|
+
import React, { Component } from 'react';
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
6
|
+
import { choiceTypeObject } from "../../../propTypes.js";
|
|
7
|
+
import { Flex } from '@instructure/ui-flex';
|
|
8
|
+
import ChoiceTypeTable from "../../shared/ChoiceTypeTable/index.js";
|
|
9
|
+
import { Text } from '@instructure/ui-text';
|
|
10
|
+
import t from '@instructure/quiz-i18n/es/format-message';
|
|
11
|
+
export var ChoiceTypeWithInfo = /*#__PURE__*/function (_Component) {
|
|
12
|
+
_inherits(ChoiceTypeWithInfo, _Component);
|
|
13
|
+
|
|
14
|
+
var _super = _createSuper(ChoiceTypeWithInfo);
|
|
15
|
+
|
|
16
|
+
function ChoiceTypeWithInfo() {
|
|
17
|
+
var _this;
|
|
18
|
+
|
|
19
|
+
_classCallCheck(this, ChoiceTypeWithInfo);
|
|
20
|
+
|
|
21
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
22
|
+
args[_key] = arguments[_key];
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
26
|
+
|
|
27
|
+
_this.renderTable = function () {
|
|
28
|
+
var _this$props = _this.props,
|
|
29
|
+
itemId = _this$props.itemId,
|
|
30
|
+
choices = _this$props.choices,
|
|
31
|
+
index = _this$props.index;
|
|
32
|
+
var tableId = "".concat(itemId, "_").concat(index, "_choiceGroup");
|
|
33
|
+
var tableContainerSizeClass = '';
|
|
34
|
+
return /*#__PURE__*/React.createElement(ChoiceTypeTable, {
|
|
35
|
+
itemId: tableId,
|
|
36
|
+
choices: choices,
|
|
37
|
+
tableContainerSizeClass: tableContainerSizeClass
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
_this.renderEmptyRequirement = function () {
|
|
42
|
+
return /*#__PURE__*/React.createElement(Flex, null, /*#__PURE__*/React.createElement(Flex.Item, {
|
|
43
|
+
padding: "medium none none none"
|
|
44
|
+
}, /*#__PURE__*/React.createElement(Text, null, t('There are no entries for this requirement.'))));
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
_this.render = function () {
|
|
48
|
+
var _this$props2 = _this.props,
|
|
49
|
+
headLine = _this$props2.headLine,
|
|
50
|
+
choices = _this$props2.choices;
|
|
51
|
+
var areThereChoices = Array.isArray(choices) && choices.length > 0;
|
|
52
|
+
return /*#__PURE__*/React.createElement(Flex, {
|
|
53
|
+
direction: "column",
|
|
54
|
+
justifyItems: "start"
|
|
55
|
+
}, /*#__PURE__*/React.createElement(Flex.Item, {
|
|
56
|
+
overflowY: "visible",
|
|
57
|
+
shouldGrow: true,
|
|
58
|
+
shouldShrink: true
|
|
59
|
+
}, /*#__PURE__*/React.createElement(Flex, {
|
|
60
|
+
direction: "column",
|
|
61
|
+
justifyItems: "start"
|
|
62
|
+
}, /*#__PURE__*/React.createElement(Flex.Item, {
|
|
63
|
+
shouldShrink: true,
|
|
64
|
+
padding: "none none none none",
|
|
65
|
+
overflowY: "hidden"
|
|
66
|
+
}, /*#__PURE__*/React.createElement(Flex, {
|
|
67
|
+
direction: "row",
|
|
68
|
+
alignItems: "start"
|
|
69
|
+
}, /*#__PURE__*/React.createElement(Flex.Item, {
|
|
70
|
+
shouldShrink: true,
|
|
71
|
+
shouldGrow: true,
|
|
72
|
+
margin: "none none none none"
|
|
73
|
+
}, headLine))), /*#__PURE__*/React.createElement(Flex.Item, {
|
|
74
|
+
shouldShrink: true,
|
|
75
|
+
padding: "none none medium none"
|
|
76
|
+
}, areThereChoices ? _this.renderTable() : _this.renderEmptyRequirement()))));
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
return _this;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
return ChoiceTypeWithInfo;
|
|
83
|
+
}(Component);
|
|
84
|
+
ChoiceTypeWithInfo.propTypes = {
|
|
85
|
+
itemId: PropTypes.number.isRequired,
|
|
86
|
+
index: PropTypes.number.isRequired,
|
|
87
|
+
choices: choiceTypeObject.isRequired,
|
|
88
|
+
headLine: PropTypes.node,
|
|
89
|
+
styles: PropTypes.object
|
|
90
|
+
}.isRequired;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { NumericType as default } from "./presenter.js";
|
|
@@ -0,0 +1,255 @@
|
|
|
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 AfsTableWrapper from "../shared/AfsTableWrapper/index.js";
|
|
11
|
+
import { AfsPartsContainer } from "../shared/AfsPartsContainer/presenter.js";
|
|
12
|
+
import AggregationTable from "../shared/AggregationTable/index.js";
|
|
13
|
+
import ExpandableCard from "../shared/ExpandableCard/index.js";
|
|
14
|
+
import { Text } from '@instructure/ui-text';
|
|
15
|
+
import t from '@instructure/quiz-i18n/es/format-message';
|
|
16
|
+
import ChoiceTypeTable from "../shared/ChoiceTypeTable/index.js";
|
|
17
|
+
import { jsx, withStyle } from '@instructure/emotion';
|
|
18
|
+
import ChoiceTypeWithInfo from "./ChoiceTypeWithInfo/index.js";
|
|
19
|
+
import generateStyle from "./styles.js";
|
|
20
|
+
import generateComponentTheme from "./theme.js";
|
|
21
|
+
import { Flex } from '@instructure/ui-flex';
|
|
22
|
+
import { numericTypeAnswerSummaryPropType } from "../../propTypes.js";
|
|
23
|
+
export var NumericType = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
24
|
+
_inherits(NumericType, _Component);
|
|
25
|
+
|
|
26
|
+
var _super = _createSuper(NumericType);
|
|
27
|
+
|
|
28
|
+
function NumericType() {
|
|
29
|
+
var _this;
|
|
30
|
+
|
|
31
|
+
_classCallCheck(this, NumericType);
|
|
32
|
+
|
|
33
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
34
|
+
args[_key] = arguments[_key];
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
38
|
+
|
|
39
|
+
_this.renderIncorrectTable = function () {
|
|
40
|
+
var _this$props = _this.props,
|
|
41
|
+
itemId = _this$props.itemId,
|
|
42
|
+
answerSummary = _this$props.answerSummary;
|
|
43
|
+
var incorrect_answer_choices = answerSummary.requirements.incorrect_answer_choices;
|
|
44
|
+
var tableId = "".concat(itemId, "_incorrect_choices");
|
|
45
|
+
var tableContainerSizeClass = '';
|
|
46
|
+
return jsx(ChoiceTypeTable, {
|
|
47
|
+
itemId: tableId,
|
|
48
|
+
choices: incorrect_answer_choices,
|
|
49
|
+
tableContainerSizeClass: tableContainerSizeClass
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
_this.getPreciseTypeTranslatable = function (precisionType) {
|
|
54
|
+
switch (precisionType) {
|
|
55
|
+
case 'significantDigits':
|
|
56
|
+
return t('Significant Digits');
|
|
57
|
+
|
|
58
|
+
case 'decimals':
|
|
59
|
+
return t('Decimal Places');
|
|
60
|
+
|
|
61
|
+
default:
|
|
62
|
+
return precisionType;
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
_this.renderPreciseResponse = function (correct_answers) {
|
|
67
|
+
var typeString = "".concat(t('Correct answer'), " - ").concat(t('Precise Response'), " ");
|
|
68
|
+
var answerString = "".concat(t('Answer'), ": ").concat(correct_answers.value, " ");
|
|
69
|
+
var precisionString = "".concat(t('Precision'), ": ").concat(correct_answers.precision, " ");
|
|
70
|
+
|
|
71
|
+
var translatablePrecisionType = _this.getPreciseTypeTranslatable(correct_answers.precision_type);
|
|
72
|
+
|
|
73
|
+
var precisionTypeString = "".concat(t('Type'), ": ").concat(translatablePrecisionType, " ");
|
|
74
|
+
return jsx("div", {
|
|
75
|
+
css: _this.props.styles.groupAggregationContainer
|
|
76
|
+
}, jsx(Text, {
|
|
77
|
+
transform: "capitalize",
|
|
78
|
+
weight: "bold"
|
|
79
|
+
}, typeString), jsx(Text, {
|
|
80
|
+
transform: "capitalize"
|
|
81
|
+
}, answerString), jsx(Text, {
|
|
82
|
+
transform: "capitalize"
|
|
83
|
+
}, precisionString), jsx(Text, {
|
|
84
|
+
transform: "capitalize"
|
|
85
|
+
}, precisionTypeString));
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
_this.getMarginTypeTranslatable = function (marginType) {
|
|
89
|
+
switch (marginType) {
|
|
90
|
+
case 'absolute':
|
|
91
|
+
return t('Absolute');
|
|
92
|
+
|
|
93
|
+
case 'percent':
|
|
94
|
+
return t('Percent');
|
|
95
|
+
|
|
96
|
+
default:
|
|
97
|
+
return marginType;
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
_this.renderMarginOfError = function (correct_answers) {
|
|
102
|
+
var typeString = "".concat(t('Correct answer'), " - ").concat(t('Margin Of Error'), " ");
|
|
103
|
+
var answerString = "".concat(t('Answer'), ": ").concat(correct_answers.value, " ");
|
|
104
|
+
var marginString = "".concat(t('+/- margin'), ": ").concat(correct_answers.margin, " ");
|
|
105
|
+
|
|
106
|
+
var translatableMarginType = _this.getMarginTypeTranslatable(correct_answers.margin_type);
|
|
107
|
+
|
|
108
|
+
var marginTypeString = "".concat(t('Type'), ": ").concat(translatableMarginType, " ");
|
|
109
|
+
return jsx("div", {
|
|
110
|
+
css: _this.props.styles.groupAggregationContainer
|
|
111
|
+
}, jsx(Text, {
|
|
112
|
+
transform: "capitalize",
|
|
113
|
+
weight: "bold"
|
|
114
|
+
}, typeString), jsx(Text, {
|
|
115
|
+
transform: "capitalize"
|
|
116
|
+
}, answerString), jsx(Text, {
|
|
117
|
+
transform: "capitalize"
|
|
118
|
+
}, marginString), jsx(Text, {
|
|
119
|
+
transform: "capitalize"
|
|
120
|
+
}, marginTypeString));
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
_this.renderExactResponse = function (correct_answers) {
|
|
124
|
+
var typeString = "".concat(t('Correct answer'), " - ").concat(t('Exact Response'), " ");
|
|
125
|
+
var answerString = "".concat(t('Answer'), ": ").concat(correct_answers.value, " ");
|
|
126
|
+
return jsx("div", {
|
|
127
|
+
css: _this.props.styles.groupAggregationContainer
|
|
128
|
+
}, jsx(Text, {
|
|
129
|
+
transform: "capitalize",
|
|
130
|
+
weight: "bold"
|
|
131
|
+
}, typeString), jsx(Text, {
|
|
132
|
+
transform: "capitalize"
|
|
133
|
+
}, answerString));
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
_this.renderWithinRange = function (correct_answers) {
|
|
137
|
+
var typeString = "".concat(t('Correct answer'), " - ").concat(t('Within A Range'), " ");
|
|
138
|
+
var startString = "".concat(t('Range Starts'), ": ").concat(correct_answers.start, " ");
|
|
139
|
+
var endString = "".concat(t('Range Ends'), ": ").concat(correct_answers.end, " ");
|
|
140
|
+
return jsx("div", {
|
|
141
|
+
css: _this.props.styles.groupAggregationContainer
|
|
142
|
+
}, jsx(Text, {
|
|
143
|
+
transform: "capitalize",
|
|
144
|
+
weight: "bold"
|
|
145
|
+
}, typeString), jsx(Text, {
|
|
146
|
+
transform: "capitalize"
|
|
147
|
+
}, startString), jsx(Text, {
|
|
148
|
+
transform: "capitalize"
|
|
149
|
+
}, endString));
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
_this.renderUncategorized = function () {
|
|
153
|
+
var typeString = "".concat(t('Correct answer'), " - ").concat(t('Uncategorized'), " ");
|
|
154
|
+
return jsx("div", {
|
|
155
|
+
css: _this.props.styles.groupAggregationContainer
|
|
156
|
+
}, jsx(Text, {
|
|
157
|
+
transform: "capitalize",
|
|
158
|
+
weight: "bold"
|
|
159
|
+
}, typeString));
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
_this.getHeadLineByType = function (correct_answer) {
|
|
163
|
+
switch (correct_answer.type) {
|
|
164
|
+
case 'withinARange':
|
|
165
|
+
return _this.renderWithinRange(correct_answer);
|
|
166
|
+
|
|
167
|
+
case 'exactResponse':
|
|
168
|
+
return _this.renderExactResponse(correct_answer);
|
|
169
|
+
|
|
170
|
+
case 'preciseResponse':
|
|
171
|
+
return _this.renderPreciseResponse(correct_answer);
|
|
172
|
+
|
|
173
|
+
case 'marginOfError':
|
|
174
|
+
return _this.renderMarginOfError(correct_answer);
|
|
175
|
+
|
|
176
|
+
default:
|
|
177
|
+
return _this.renderUncategorized();
|
|
178
|
+
}
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
_this.renderChoiceTypeWithInfo = function (correct_answer, index, itemId) {
|
|
182
|
+
var key = "ChoiceTypeWithInfo_".concat(itemId, "_").concat(index);
|
|
183
|
+
return jsx(ChoiceTypeWithInfo, {
|
|
184
|
+
key: key,
|
|
185
|
+
itemId: itemId,
|
|
186
|
+
choices: correct_answer.choices,
|
|
187
|
+
headLine: _this.getHeadLineByType(correct_answer),
|
|
188
|
+
index: index
|
|
189
|
+
});
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
_this.renderCorrectChoiceTypes = function () {
|
|
193
|
+
var _this$props2 = _this.props,
|
|
194
|
+
itemId = _this$props2.itemId,
|
|
195
|
+
answerSummary = _this$props2.answerSummary;
|
|
196
|
+
var correct_answers = answerSummary.requirements.correct_answers;
|
|
197
|
+
return correct_answers.map(function (correct_answer, index) {
|
|
198
|
+
return _this.renderChoiceTypeWithInfo(correct_answer, index, itemId);
|
|
199
|
+
});
|
|
200
|
+
};
|
|
201
|
+
|
|
202
|
+
_this.renderEmptyIncorrect = function () {
|
|
203
|
+
return jsx(Flex, null, jsx(Flex.Item, {
|
|
204
|
+
padding: "small none small none"
|
|
205
|
+
}, jsx(Text, null, t('There are no incorrect answers.'))));
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
_this.renderEmptyCorrect = function () {
|
|
209
|
+
return jsx(Flex, null, jsx(Flex.Item, {
|
|
210
|
+
padding: "small none small none"
|
|
211
|
+
}, jsx(Text, null, t('There are no correct answers.'))));
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
_this.renderAfsTable = function () {
|
|
215
|
+
var answerSummary = _this.props.answerSummary;
|
|
216
|
+
var _answerSummary$requir = answerSummary.requirements,
|
|
217
|
+
correct_answers = _answerSummary$requir.correct_answers,
|
|
218
|
+
incorrect_answer_choices = _answerSummary$requir.incorrect_answer_choices;
|
|
219
|
+
var areThereIncorrectChoices = Array.isArray(incorrect_answer_choices) && incorrect_answer_choices.length > 0;
|
|
220
|
+
var areThereCorrectAnswers = Array.isArray(correct_answers) && correct_answers.length > 0;
|
|
221
|
+
return jsx("div", null, jsx(ExpandableCard, {
|
|
222
|
+
content: areThereCorrectAnswers ? _this.renderCorrectChoiceTypes() : _this.renderEmptyCorrect(),
|
|
223
|
+
headLine: jsx(Text, {
|
|
224
|
+
weight: "bold"
|
|
225
|
+
}, t('Correct Answers'))
|
|
226
|
+
}), jsx(ExpandableCard, {
|
|
227
|
+
content: areThereIncorrectChoices ? _this.renderIncorrectTable() : _this.renderEmptyIncorrect(),
|
|
228
|
+
headLine: jsx(Text, {
|
|
229
|
+
weight: "bold"
|
|
230
|
+
}, t('Incorrect Answers'))
|
|
231
|
+
}));
|
|
232
|
+
};
|
|
233
|
+
|
|
234
|
+
_this.render = function () {
|
|
235
|
+
var _this$props3 = _this.props,
|
|
236
|
+
answerSummary = _this$props3.answerSummary,
|
|
237
|
+
itemId = _this$props3.itemId;
|
|
238
|
+
return jsx(AfsTableWrapper, null, jsx(AfsPartsContainer, {
|
|
239
|
+
afsTable: _this.renderAfsTable(),
|
|
240
|
+
aggregationTable: jsx(AggregationTable, {
|
|
241
|
+
itemId: itemId,
|
|
242
|
+
answerSummary: answerSummary
|
|
243
|
+
})
|
|
244
|
+
}));
|
|
245
|
+
};
|
|
246
|
+
|
|
247
|
+
return _this;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
return NumericType;
|
|
251
|
+
}(Component), _class2.propTypes = {
|
|
252
|
+
itemId: PropTypes.number.isRequired,
|
|
253
|
+
answerSummary: numericTypeAnswerSummaryPropType.isRequired,
|
|
254
|
+
styles: PropTypes.object
|
|
255
|
+
}.isRequired, _temp)) || _class);
|
|
@@ -10,14 +10,13 @@ import PropTypes from 'prop-types';
|
|
|
10
10
|
import { choiceTypeObject } from "../../../propTypes.js";
|
|
11
11
|
import { Flex } from '@instructure/ui-flex';
|
|
12
12
|
import { Text } from '@instructure/ui-text';
|
|
13
|
-
import ExpandButton from "../../../../../../../common/components/shared/ExpandButton/index.js";
|
|
14
13
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
15
|
-
import
|
|
16
|
-
import ChoiceTypeTable from "../ChoiceTypeTable/index.js";
|
|
14
|
+
import ChoiceTypeTable from "../../shared/ChoiceTypeTable/index.js";
|
|
17
15
|
import BlankIcon from "../../../NewItemAnalysis/BlankIcon/index.js";
|
|
18
16
|
import { withStyle, jsx } from '@instructure/emotion';
|
|
19
17
|
import generateStyle from "./styles.js";
|
|
20
18
|
import generateComponentTheme from "./theme.js";
|
|
19
|
+
import ExpandableCard from "../../shared/ExpandableCard/index.js";
|
|
21
20
|
export var ChoiceGroupTypeTable = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
22
21
|
_inherits(ChoiceGroupTypeTable, _Component);
|
|
23
22
|
|
|
@@ -57,10 +56,19 @@ export var ChoiceGroupTypeTable = (_dec = withStyle(generateStyle, generateCompo
|
|
|
57
56
|
return t('There are no entries for this open entry question.');
|
|
58
57
|
};
|
|
59
58
|
|
|
60
|
-
_this.
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
59
|
+
_this.renderBlankInfo = function () {
|
|
60
|
+
var _blank$aggregate, _blank$aggregate2;
|
|
61
|
+
|
|
62
|
+
var blank = _this.props.blank;
|
|
63
|
+
var correctCount = (blank === null || blank === void 0 ? void 0 : (_blank$aggregate = blank.aggregate) === null || _blank$aggregate === void 0 ? void 0 : _blank$aggregate.correct) || 0;
|
|
64
|
+
var incorrectCount = (blank === null || blank === void 0 ? void 0 : (_blank$aggregate2 = blank.aggregate) === null || _blank$aggregate2 === void 0 ? void 0 : _blank$aggregate2.incorrect) || 0;
|
|
65
|
+
var noAnswer = (blank === null || blank === void 0 ? void 0 : blank.no_answer) || 0;
|
|
66
|
+
var correctString = "".concat(t('Correct'), ": ").concat(correctCount, " ");
|
|
67
|
+
var incorrectString = "".concat(t('Incorrect'), ": ").concat(incorrectCount, " ");
|
|
68
|
+
var noAnswerString = "".concat(t('No Answer'), ": ").concat(noAnswer, " ");
|
|
69
|
+
return jsx("div", {
|
|
70
|
+
css: _this.props.styles.groupAggregationContainer
|
|
71
|
+
}, jsx(Text, null, correctString), jsx(Text, null, incorrectString), jsx(Text, null, noAnswerString));
|
|
64
72
|
};
|
|
65
73
|
|
|
66
74
|
_this.renderTable = function () {
|
|
@@ -88,9 +96,7 @@ export var ChoiceGroupTypeTable = (_dec = withStyle(generateStyle, generateCompo
|
|
|
88
96
|
};
|
|
89
97
|
|
|
90
98
|
_this.renderHeadLine = function () {
|
|
91
|
-
var
|
|
92
|
-
blank = _this$props2.blank,
|
|
93
|
-
blankInfo = _this$props2.blankInfo;
|
|
99
|
+
var blank = _this.props.blank;
|
|
94
100
|
var blank_text = blank.blank_text,
|
|
95
101
|
blank_type = blank.blank_type;
|
|
96
102
|
var blankTextAndType = "".concat(blank_text, " (").concat(_this.getTranslatedBlankType(blank_type), ")");
|
|
@@ -106,24 +112,7 @@ export var ChoiceGroupTypeTable = (_dec = withStyle(generateStyle, generateCompo
|
|
|
106
112
|
}, blankTextAndType)), jsx(Flex.Item, {
|
|
107
113
|
shouldShrink: true,
|
|
108
114
|
margin: "xxx-small none small none"
|
|
109
|
-
},
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
_this.renderGroup = function () {
|
|
113
|
-
return jsx(Flex, {
|
|
114
|
-
direction: "row",
|
|
115
|
-
alignItems: "start"
|
|
116
|
-
}, jsx(Flex.Item, {
|
|
117
|
-
shouldShrink: true,
|
|
118
|
-
shouldGrow: true,
|
|
119
|
-
margin: "xx-small none none none"
|
|
120
|
-
}, _this.renderHeadLine()), jsx(Flex.Item, {
|
|
121
|
-
margin: "none none none x-small"
|
|
122
|
-
}, jsx(ExpandButton, {
|
|
123
|
-
onClick: _this.handleBodyToggle,
|
|
124
|
-
title: _this.state.bodyExpanded ? t('collapse group result') : t('expand group result'),
|
|
125
|
-
isExpanded: _this.state.bodyExpanded
|
|
126
|
-
})));
|
|
115
|
+
}, _this.renderBlankInfo()));
|
|
127
116
|
};
|
|
128
117
|
|
|
129
118
|
_this.renderEmptyInfo = function () {
|
|
@@ -133,41 +122,17 @@ export var ChoiceGroupTypeTable = (_dec = withStyle(generateStyle, generateCompo
|
|
|
133
122
|
}, jsx(Flex.Item, {
|
|
134
123
|
shouldShrink: true,
|
|
135
124
|
shouldGrow: true,
|
|
136
|
-
padding: "none none x-small
|
|
125
|
+
padding: "none none x-small none"
|
|
137
126
|
}, jsx(Text, null, _this.getTranslatedEmptyMessage())));
|
|
138
127
|
};
|
|
139
128
|
|
|
140
129
|
_this.render = function () {
|
|
141
|
-
var
|
|
142
|
-
styles = _this$props3.styles,
|
|
143
|
-
blank = _this$props3.blank;
|
|
144
|
-
var groupWrapper = styles.groupWrapper,
|
|
145
|
-
cardWrapper = styles.cardWrapper;
|
|
130
|
+
var blank = _this.props.blank;
|
|
146
131
|
var areThereChoices = Array.isArray(blank.choices) && blank.choices.length > 0;
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
}
|
|
151
|
-
css: cardWrapper
|
|
152
|
-
}, jsx(Flex, {
|
|
153
|
-
direction: "column",
|
|
154
|
-
justifyItems: "start"
|
|
155
|
-
}, jsx(Flex.Item, {
|
|
156
|
-
overflowY: "visible"
|
|
157
|
-
}, jsx(Flex.Item, {
|
|
158
|
-
shouldGrow: true,
|
|
159
|
-
shouldShrink: true
|
|
160
|
-
}, jsx(Flex, {
|
|
161
|
-
direction: "column",
|
|
162
|
-
justifyItems: "start"
|
|
163
|
-
}, jsx(Flex.Item, {
|
|
164
|
-
shouldShrink: true,
|
|
165
|
-
padding: "x-small small x-small medium",
|
|
166
|
-
overflowY: "hidden"
|
|
167
|
-
}, _this.renderGroup()), bodyExpanded && jsx(Flex.Item, {
|
|
168
|
-
shouldShrink: true,
|
|
169
|
-
padding: "x-small small x-small small"
|
|
170
|
-
}, areThereChoices ? _this.renderTable() : _this.renderEmptyInfo())))))));
|
|
132
|
+
return jsx(ExpandableCard, {
|
|
133
|
+
content: areThereChoices ? _this.renderTable() : _this.renderEmptyInfo(),
|
|
134
|
+
headLine: _this.renderHeadLine()
|
|
135
|
+
});
|
|
171
136
|
};
|
|
172
137
|
|
|
173
138
|
return _this;
|
|
@@ -181,7 +146,6 @@ export var ChoiceGroupTypeTable = (_dec = withStyle(generateStyle, generateCompo
|
|
|
181
146
|
blank_text: PropTypes.string.isRequired,
|
|
182
147
|
blank_type: PropTypes.string.isRequired
|
|
183
148
|
}).isRequired,
|
|
184
|
-
blankInfo: PropTypes.node,
|
|
185
149
|
index: PropTypes.number.isRequired,
|
|
186
150
|
styles: PropTypes.object
|
|
187
151
|
}.isRequired, _temp)) || _class);
|
|
@@ -1,23 +1,14 @@
|
|
|
1
1
|
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
2
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
3
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';
|
|
4
|
+
import React, { Component } from 'react';
|
|
9
5
|
import PropTypes from 'prop-types';
|
|
10
6
|
import { richFillBlankTypeAnswerSummaryPropType } from "../../propTypes.js";
|
|
11
7
|
import AfsTableWrapper from "../shared/AfsTableWrapper/index.js";
|
|
12
8
|
import { AfsPartsContainer } from "../shared/AfsPartsContainer/presenter.js";
|
|
13
|
-
import ChoiceGroupTypeTable from "
|
|
14
|
-
import { Text } from '@instructure/ui-text';
|
|
15
|
-
import t from '@instructure/quiz-i18n/es/format-message';
|
|
9
|
+
import ChoiceGroupTypeTable from "./ChoiceGroupTypeTable/index.js";
|
|
16
10
|
import AggregationTable from "../shared/AggregationTable/index.js";
|
|
17
|
-
|
|
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) {
|
|
11
|
+
export var RichFillBlankType = /*#__PURE__*/function (_Component) {
|
|
21
12
|
_inherits(RichFillBlankType, _Component);
|
|
22
13
|
|
|
23
14
|
var _super = _createSuper(RichFillBlankType);
|
|
@@ -33,26 +24,11 @@ export var RichFillBlankType = (_dec = withStyle(generateStyle, generateComponen
|
|
|
33
24
|
|
|
34
25
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
35
26
|
|
|
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
27
|
_this.renderGroup = function (key, itemId, blank, index) {
|
|
51
|
-
return
|
|
28
|
+
return /*#__PURE__*/React.createElement(ChoiceGroupTypeTable, {
|
|
52
29
|
key: key,
|
|
53
30
|
itemId: itemId,
|
|
54
31
|
blank: blank,
|
|
55
|
-
blankInfo: _this.renderBlankInfo(blank),
|
|
56
32
|
index: index
|
|
57
33
|
});
|
|
58
34
|
};
|
|
@@ -63,7 +39,7 @@ export var RichFillBlankType = (_dec = withStyle(generateStyle, generateComponen
|
|
|
63
39
|
itemId = _this$props.itemId;
|
|
64
40
|
var blanks = answerSummary.blanks;
|
|
65
41
|
return blanks.map(function (blank, index) {
|
|
66
|
-
var key = "ChoiceGroupTypeTable_".concat(index);
|
|
42
|
+
var key = "ChoiceGroupTypeTable_".concat(itemId, "_").concat(index);
|
|
67
43
|
return _this.renderGroup(key, itemId, blank, index);
|
|
68
44
|
});
|
|
69
45
|
};
|
|
@@ -72,9 +48,9 @@ export var RichFillBlankType = (_dec = withStyle(generateStyle, generateComponen
|
|
|
72
48
|
var _this$props2 = _this.props,
|
|
73
49
|
answerSummary = _this$props2.answerSummary,
|
|
74
50
|
itemId = _this$props2.itemId;
|
|
75
|
-
return
|
|
51
|
+
return /*#__PURE__*/React.createElement(AfsTableWrapper, null, /*#__PURE__*/React.createElement(AfsPartsContainer, {
|
|
76
52
|
afsTable: _this.renderGroups(),
|
|
77
|
-
aggregationTable:
|
|
53
|
+
aggregationTable: /*#__PURE__*/React.createElement(AggregationTable, {
|
|
78
54
|
itemId: itemId,
|
|
79
55
|
answerSummary: answerSummary
|
|
80
56
|
})
|
|
@@ -85,8 +61,8 @@ export var RichFillBlankType = (_dec = withStyle(generateStyle, generateComponen
|
|
|
85
61
|
}
|
|
86
62
|
|
|
87
63
|
return RichFillBlankType;
|
|
88
|
-
}(Component)
|
|
64
|
+
}(Component);
|
|
65
|
+
RichFillBlankType.propTypes = {
|
|
89
66
|
itemId: PropTypes.number.isRequired,
|
|
90
|
-
answerSummary: richFillBlankTypeAnswerSummaryPropType.isRequired
|
|
91
|
-
|
|
92
|
-
}.isRequired, _temp)) || _class);
|
|
67
|
+
answerSummary: richFillBlankTypeAnswerSummaryPropType.isRequired
|
|
68
|
+
}.isRequired;
|