@instructure/quiz-core 20.5.1 → 20.5.2-rc.1
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/common/components/resources/sessionItemResult/ResultStimulus/index.js +36 -47
- package/es/common/components/resources/sessionItemResult/ResultStimulus/styles.js +69 -0
- package/es/common/components/resources/sessionItemResult/ResultStimulus/theme.js +4 -2
- package/es/common/components/resources/sessionItemResult/SessionItemResult/presenter.js +60 -62
- package/es/common/components/resources/sessionItemResult/SessionItemResult/styles.js +50 -0
- package/es/common/components/resources/sessionItemResult/SessionItemResult/theme.js +4 -2
- package/es/common/components/resources/sessionItemResult/SessionItemResultsList/index.js +18 -23
- package/es/common/components/resources/sessionItemResult/SessionItemResultsList/styles.js +17 -0
- package/es/common/components/resources/sessionItemResult/SessionItemResultsList/theme.js +4 -2
- package/lib/common/components/resources/sessionItemResult/ResultStimulus/index.js +35 -48
- package/lib/common/components/resources/sessionItemResult/ResultStimulus/styles.js +79 -0
- package/lib/common/components/resources/sessionItemResult/ResultStimulus/theme.js +6 -3
- package/lib/common/components/resources/sessionItemResult/SessionItemResult/presenter.js +57 -64
- package/lib/common/components/resources/sessionItemResult/SessionItemResult/styles.js +60 -0
- package/lib/common/components/resources/sessionItemResult/SessionItemResult/theme.js +6 -3
- package/lib/common/components/resources/sessionItemResult/SessionItemResultsList/index.js +17 -24
- package/lib/common/components/resources/sessionItemResult/SessionItemResultsList/styles.js +25 -0
- package/lib/common/components/resources/sessionItemResult/SessionItemResultsList/theme.js +6 -3
- package/package.json +10 -10
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
|
|
5
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
6
|
-
|
|
7
5
|
Object.defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
@@ -17,40 +15,25 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits
|
|
|
17
15
|
|
|
18
16
|
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
|
|
19
17
|
|
|
20
|
-
var _react =
|
|
18
|
+
var _react = require("react");
|
|
21
19
|
|
|
22
20
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
23
21
|
|
|
24
22
|
var _reactImmutableProptypes = _interopRequireDefault(require("react-immutable-proptypes"));
|
|
25
23
|
|
|
26
|
-
var
|
|
24
|
+
var _emotion = require("@instructure/emotion");
|
|
27
25
|
|
|
28
26
|
var _quizRce = require("@instructure/quiz-rce");
|
|
29
27
|
|
|
30
28
|
var _formatMessage = _interopRequireDefault(require("@instructure/quiz-i18n/es/format-message"));
|
|
31
29
|
|
|
30
|
+
var _styles = _interopRequireDefault(require("./styles.js"));
|
|
31
|
+
|
|
32
32
|
var _theme = _interopRequireDefault(require("./theme.js"));
|
|
33
33
|
|
|
34
34
|
var _dec, _class, _class2, _temp;
|
|
35
35
|
|
|
36
|
-
var
|
|
37
|
-
componentId: 'fcFqb',
|
|
38
|
-
template: function template(theme) {
|
|
39
|
-
return "\n\n.fcFqb_bGBk{border-bottom:".concat(theme.rootBorderWidth || 'inherit', " solid ").concat(theme.rootBorderColor || 'inherit', ";overflow:hidden}\n\n.fcFqb_pJNU{border:").concat(theme.instructionsBorderWidth || 'inherit', " solid ").concat(theme.instructionsBorderColor || 'inherit', ";padding:").concat(theme.instructionsPaddingTopBottom || 'inherit', " ").concat(theme.instructionsPaddingLeftRight || 'inherit', "}\n\n.fcFqb_dEpm{font-weight:").concat(theme.instructionsHeaderFontWeight || 'inherit', ";padding-bottom:").concat(theme.instructionsHeaderPadding || 'inherit', "}\n\n.fcFqb_pypk{background-color:").concat(theme.infoBackgroundColor || 'inherit', ";height:100%;overflow:scroll;padding:").concat(theme.infoPaddingTopBottom || 'inherit', " ").concat(theme.infoPaddingLeftRight || 'inherit', "}\n\n.fcFqb_fsuY{padding-bottom:").concat(theme.headerPaddingBottom || 'inherit', ";padding-top:").concat(theme.headerPaddingTop || 'inherit', "}\n\n.fcFqb_nvdO{font-size:").concat(theme.titleFontSize || 'inherit', ";font-weight:").concat(theme.titleFontWeight || 'inherit', "}\n\n.fcFqb_JelF{padding:").concat(theme.itemsPadding || 'inherit', ";width:50%}\n\n.fcFqb_boAJ{flex:1 1 auto}\n\n.fcFqb_bbyJ{display:flex;flex-direction:row}\n\n.fcFqb_eNQJ{width:50%}\n\n@media screen and (--phoneBreakPoint){.fcFqb_bbyJ{flex-direction:column}.fcFqb_JelF,.fcFqb_eNQJ{width:100%}.fcFqb_pJNU{padding:").concat(theme.phoneInstructionsPaddingTopBottom || 'inherit', " ").concat(theme.phoneInstructionsPaddingLeftRight || 'inherit', "}.fcFqb_pypk{padding:").concat(theme.phoneInfoPadding || 'inherit', "}.fcFqb_eGWt{border-bottom:").concat(theme.phoneConnectingLinesBorderWidth || 'inherit', " dotted;border-color:").concat(theme.phoneConnectingLinesBorderColor || 'inherit', ";border-left:").concat(theme.phoneConnectingLinesBorderWidth || 'inherit', " dotted;flex:0 0 1rem;height:2rem;margin-right:").concat(theme.phoneConnectingLinesMargin || 'inherit', ";margin-top:").concat(theme.phoneConnectingLinesMargin || 'inherit', ";width:1.5rem}}");
|
|
40
|
-
},
|
|
41
|
-
'root': 'fcFqb_bGBk',
|
|
42
|
-
'instructions': 'fcFqb_pJNU',
|
|
43
|
-
'instructionsHeader': 'fcFqb_dEpm',
|
|
44
|
-
'info': 'fcFqb_pypk',
|
|
45
|
-
'header': 'fcFqb_fsuY',
|
|
46
|
-
'title': 'fcFqb_nvdO',
|
|
47
|
-
'items': 'fcFqb_JelF',
|
|
48
|
-
'stimulusItem': 'fcFqb_boAJ',
|
|
49
|
-
'stimulusGroup': 'fcFqb_bbyJ',
|
|
50
|
-
'stimulusInfo': 'fcFqb_eNQJ',
|
|
51
|
-
'connectingLines': 'fcFqb_eGWt'
|
|
52
|
-
};
|
|
53
|
-
var ResultStimulus = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
36
|
+
var ResultStimulus = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
54
37
|
(0, _inherits2.default)(ResultStimulus, _Component);
|
|
55
38
|
|
|
56
39
|
var _super = (0, _createSuper2.default)(ResultStimulus);
|
|
@@ -66,11 +49,12 @@ var ResultStimulus = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles)
|
|
|
66
49
|
var instructions = this.props.stimulus.instructions;
|
|
67
50
|
|
|
68
51
|
if (instructions) {
|
|
69
|
-
return
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
52
|
+
return (0, _emotion.jsx)("div", {
|
|
53
|
+
"data-testId": "instructions",
|
|
54
|
+
css: this.props.styles.instructions
|
|
55
|
+
}, (0, _emotion.jsx)("div", {
|
|
56
|
+
css: this.props.styles.instructionsHeader
|
|
57
|
+
}, (0, _formatMessage.default)('Instructions')), (0, _emotion.jsx)("div", null, instructions));
|
|
74
58
|
}
|
|
75
59
|
}
|
|
76
60
|
}, {
|
|
@@ -78,13 +62,13 @@ var ResultStimulus = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles)
|
|
|
78
62
|
value: function renderStimulusInfo() {
|
|
79
63
|
var title = this.props.stimulus.title;
|
|
80
64
|
var body = this.props.stimulus.body;
|
|
81
|
-
return
|
|
82
|
-
|
|
83
|
-
},
|
|
84
|
-
|
|
85
|
-
},
|
|
86
|
-
|
|
87
|
-
}, title)),
|
|
65
|
+
return (0, _emotion.jsx)("div", {
|
|
66
|
+
css: this.props.styles.info
|
|
67
|
+
}, (0, _emotion.jsx)("div", {
|
|
68
|
+
css: this.props.styles.header
|
|
69
|
+
}, (0, _emotion.jsx)("div", {
|
|
70
|
+
css: this.props.styles.title
|
|
71
|
+
}, title)), (0, _emotion.jsx)(_quizRce.RichContentRenderer, {
|
|
88
72
|
content: body
|
|
89
73
|
}));
|
|
90
74
|
}
|
|
@@ -94,26 +78,27 @@ var ResultStimulus = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles)
|
|
|
94
78
|
var _this = this;
|
|
95
79
|
|
|
96
80
|
return this.props.sessionItem.getNestedEntries().toArray().map(function (sessionItem, i) {
|
|
97
|
-
return
|
|
81
|
+
return (0, _emotion.jsx)("div", {
|
|
98
82
|
key: sessionItem.position
|
|
99
|
-
},
|
|
100
|
-
|
|
101
|
-
}),
|
|
102
|
-
|
|
83
|
+
}, (0, _emotion.jsx)("div", {
|
|
84
|
+
css: _this.props.styles.connectingLines
|
|
85
|
+
}), (0, _emotion.jsx)("div", {
|
|
86
|
+
"data-testid": "stimulus-item",
|
|
87
|
+
css: _this.props.styles.stimulusItem
|
|
103
88
|
}, _this.props.renderItem(sessionItem, i !== 0)));
|
|
104
89
|
});
|
|
105
90
|
}
|
|
106
91
|
}, {
|
|
107
92
|
key: "render",
|
|
108
93
|
value: function render() {
|
|
109
|
-
return
|
|
110
|
-
|
|
111
|
-
}, this.renderStimulusInstructions(),
|
|
112
|
-
|
|
113
|
-
},
|
|
114
|
-
|
|
115
|
-
}, this.renderStimulusInfo()),
|
|
116
|
-
|
|
94
|
+
return (0, _emotion.jsx)("div", null, (0, _emotion.jsx)("div", {
|
|
95
|
+
css: this.props.styles.root
|
|
96
|
+
}, this.renderStimulusInstructions(), (0, _emotion.jsx)("div", {
|
|
97
|
+
css: this.props.styles.stimulusGroup
|
|
98
|
+
}, (0, _emotion.jsx)("div", {
|
|
99
|
+
css: this.props.styles.stimulusInfo
|
|
100
|
+
}, this.renderStimulusInfo()), (0, _emotion.jsx)("div", {
|
|
101
|
+
css: this.props.styles.items
|
|
117
102
|
}, this.renderStimulusItems()))));
|
|
118
103
|
}
|
|
119
104
|
}]);
|
|
@@ -122,7 +107,9 @@ var ResultStimulus = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles)
|
|
|
122
107
|
}(_react.Component), _class2.propTypes = {
|
|
123
108
|
stimulus: _reactImmutableProptypes.default.record.isRequired,
|
|
124
109
|
sessionItem: _reactImmutableProptypes.default.record.isRequired,
|
|
125
|
-
renderItem: _propTypes.default.func.isRequired
|
|
110
|
+
renderItem: _propTypes.default.func.isRequired,
|
|
111
|
+
// eslint-disable-next-line react/require-default-props,react/forbid-prop-types
|
|
112
|
+
styles: _propTypes.default.object
|
|
126
113
|
}, _temp)) || _class);
|
|
127
114
|
exports.ResultStimulus = ResultStimulus;
|
|
128
115
|
var _default = ResultStimulus;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
+
|
|
12
|
+
var generateStyle = function generateStyle(componentTheme) {
|
|
13
|
+
var mq = "screen and (".concat(componentTheme.phoneBreakPoint, ")");
|
|
14
|
+
return {
|
|
15
|
+
root: {
|
|
16
|
+
borderBottom: "".concat(componentTheme.rootBorderWidth, " solid ").concat(componentTheme.rootBorderColor),
|
|
17
|
+
overflow: 'hidden'
|
|
18
|
+
},
|
|
19
|
+
instructions: (0, _defineProperty2.default)({
|
|
20
|
+
padding: "".concat(componentTheme.instructionsPaddingTopBottom, " ").concat(componentTheme.instructionsPaddingLeftRight),
|
|
21
|
+
border: "".concat(componentTheme.instructionsBorderWidth, " solid ").concat(componentTheme.instructionsBorderColor)
|
|
22
|
+
}, mq, {
|
|
23
|
+
padding: "".concat(componentTheme.phoneInstructionsPaddingTopBottom, " ").concat(componentTheme.phoneInstructionsPaddingLeftRight)
|
|
24
|
+
}),
|
|
25
|
+
instructionsHeader: {
|
|
26
|
+
paddingBottom: componentTheme.instructionsHeaderPadding,
|
|
27
|
+
fontWeight: componentTheme.instructionsHeaderFontWeight
|
|
28
|
+
},
|
|
29
|
+
info: (0, _defineProperty2.default)({
|
|
30
|
+
padding: "".concat(componentTheme.infoPaddingTopBottom, " ").concat(componentTheme.infoPaddingLeftRight),
|
|
31
|
+
backgroundColor: componentTheme.infoBackgroundColor,
|
|
32
|
+
height: '100%',
|
|
33
|
+
overflow: 'scroll'
|
|
34
|
+
}, mq, {
|
|
35
|
+
padding: componentTheme.phoneInfoPadding
|
|
36
|
+
}),
|
|
37
|
+
header: {
|
|
38
|
+
paddingTop: componentTheme.headerPaddingTop,
|
|
39
|
+
paddingBottom: componentTheme.headerPaddingBottom
|
|
40
|
+
},
|
|
41
|
+
title: {
|
|
42
|
+
fontSize: componentTheme.titleFontSize,
|
|
43
|
+
fontWeight: componentTheme.titleFontWeight
|
|
44
|
+
},
|
|
45
|
+
items: (0, _defineProperty2.default)({
|
|
46
|
+
padding: componentTheme.itemsPadding,
|
|
47
|
+
width: '50%'
|
|
48
|
+
}, mq, {
|
|
49
|
+
width: '100%'
|
|
50
|
+
}),
|
|
51
|
+
stimulusItem: {
|
|
52
|
+
flex: '1 1 auto'
|
|
53
|
+
},
|
|
54
|
+
stimulusGroup: (0, _defineProperty2.default)({
|
|
55
|
+
display: 'flex',
|
|
56
|
+
flexDirection: 'row'
|
|
57
|
+
}, mq, {
|
|
58
|
+
flexDirection: 'column'
|
|
59
|
+
}),
|
|
60
|
+
stimulusInfo: (0, _defineProperty2.default)({
|
|
61
|
+
width: '50%'
|
|
62
|
+
}, mq, {
|
|
63
|
+
width: '100%'
|
|
64
|
+
}),
|
|
65
|
+
connectingLines: (0, _defineProperty2.default)({}, mq, {
|
|
66
|
+
flex: '0 0 1rem',
|
|
67
|
+
borderLeft: "".concat(componentTheme.phoneConnectingLinesBorderWidth, " dotted"),
|
|
68
|
+
borderBottom: "".concat(componentTheme.phoneConnectingLinesBorderWidth, " dotted"),
|
|
69
|
+
borderColor: componentTheme.phoneConnectingLinesBorderColor,
|
|
70
|
+
marginrTop: componentTheme.phoneConnectingLinesMargin,
|
|
71
|
+
marginRight: componentTheme.phoneConnectingLinesMargin,
|
|
72
|
+
height: '2rem',
|
|
73
|
+
width: '1.5rem'
|
|
74
|
+
})
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
var _default = generateStyle;
|
|
79
|
+
exports.default = _default;
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default =
|
|
6
|
+
exports.default = void 0;
|
|
7
7
|
|
|
8
|
-
function
|
|
8
|
+
var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
9
9
|
var spacing = _ref.spacing,
|
|
10
10
|
typography = _ref.typography,
|
|
11
11
|
borders = _ref.borders,
|
|
@@ -36,4 +36,7 @@ function generator(_ref) {
|
|
|
36
36
|
phoneConnectingLinesBorderColor: colors.tiara,
|
|
37
37
|
phoneConnectingLinesMargin: spacing.small
|
|
38
38
|
};
|
|
39
|
-
}
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
var _default = generateComponentTheme;
|
|
42
|
+
exports.default = _default;
|
|
@@ -2,15 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
|
|
5
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
6
|
-
|
|
7
5
|
Object.defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
10
8
|
exports.default = exports.SessionItemResult = void 0;
|
|
11
9
|
|
|
12
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
13
|
-
|
|
14
10
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
15
11
|
|
|
16
12
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
@@ -19,14 +15,12 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits
|
|
|
19
15
|
|
|
20
16
|
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
|
|
21
17
|
|
|
22
|
-
var _react =
|
|
18
|
+
var _react = require("react");
|
|
23
19
|
|
|
24
20
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
25
21
|
|
|
26
22
|
var _reactImmutableProptypes = _interopRequireDefault(require("react-immutable-proptypes"));
|
|
27
23
|
|
|
28
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
29
|
-
|
|
30
24
|
var _uiAlerts = require("@instructure/ui-alerts");
|
|
31
25
|
|
|
32
26
|
var _uiText = require("@instructure/ui-text");
|
|
@@ -37,7 +31,7 @@ var _uiView = require("@instructure/ui-view");
|
|
|
37
31
|
|
|
38
32
|
var _uiA11yContent = require("@instructure/ui-a11y-content");
|
|
39
33
|
|
|
40
|
-
var
|
|
34
|
+
var _emotion = require("@instructure/emotion");
|
|
41
35
|
|
|
42
36
|
var _quizRce = require("@instructure/quiz-rce");
|
|
43
37
|
|
|
@@ -53,27 +47,13 @@ var _CustomPropTypes = _interopRequireDefault(require("../../../../util/CustomPr
|
|
|
53
47
|
|
|
54
48
|
var _keyboardClickable = _interopRequireDefault(require("../../../../util/keyboardClickable.js"));
|
|
55
49
|
|
|
50
|
+
var _styles = _interopRequireDefault(require("./styles.js"));
|
|
51
|
+
|
|
56
52
|
var _theme = _interopRequireDefault(require("./theme.js"));
|
|
57
53
|
|
|
58
54
|
var _dec, _class, _class2, _temp;
|
|
59
55
|
|
|
60
|
-
var
|
|
61
|
-
componentId: 'cQHeE',
|
|
62
|
-
template: function template(theme) {
|
|
63
|
-
return "\n\n.cQHeE_bvdE{padding:".concat(theme.sessionItemResultPadding || 'inherit', "}\n\n.cQHeE_ebwZ{border-top:solid ").concat(theme.topBorderWidth || 'inherit', " ").concat(theme.topBorderColor || 'inherit', "}\n\n.cQHeE_czRh{margin:").concat(theme.resultMargin || 'inherit', "}\n\n.cQHeE_cwte{color:").concat(theme.pointsColor || 'inherit', ";font-size:").concat(theme.pointFontSize || 'inherit', "}\n\n.cQHeE_cSuF{font-size:").concat(theme.questionFontSize || 'inherit', "}\n\n.cQHeE_fqsT{align-items:center;display:flex}\n\n.cQHeE_cgkp{border-color:").concat(theme.itemFeedbackWrapperBorderColor || 'inherit', ";border-radius:").concat(theme.itemFeedbackWrapperBorderRadius || 'inherit', ";border-style:").concat(theme.itemFeedbackWrapperStyle || 'inherit', ";border-width:").concat(theme.itemFeedbackWrapperBorderWidth || 'inherit', ";font-size:").concat(theme.itemFeedbackWrapperFontSize || 'inherit', ";margin-top:").concat(theme.itemFeedbackWrapperMargin || 'inherit', ";padding:").concat(theme.itemFeedbackWrapperPadding || 'inherit', ";white-space:pre-wrap}\n\n.cQHeE_dpDn{padding-bottom:").concat(theme.textPaddingBottom || 'inherit', ";padding-left:").concat(theme.textPaddingLeft || 'inherit', "}\n\n.cQHeE_couS{color:").concat(theme.itemFeedbackLabelColor || 'inherit', ";font-size:").concat(theme.itemFeedbackLabelFontSize || 'inherit', ";margin-bottom:").concat(theme.itemFeedbackMargin || 'inherit', "}\n\n.cQHeE_bcAI{font-size:").concat(theme.itemFeedbackTextSize || 'inherit', ";margin-top:").concat(theme.itemFeedbackTextMargin || 'inherit', "}");
|
|
64
|
-
},
|
|
65
|
-
'sessionItemResult': 'cQHeE_bvdE',
|
|
66
|
-
'topBorder': 'cQHeE_ebwZ',
|
|
67
|
-
'result': 'cQHeE_czRh',
|
|
68
|
-
'points': 'cQHeE_cwte',
|
|
69
|
-
'question': 'cQHeE_cSuF',
|
|
70
|
-
'sessionItemResultHeader': 'cQHeE_fqsT',
|
|
71
|
-
'itemFeedbackWrapper': 'cQHeE_cgkp',
|
|
72
|
-
'textPadding': 'cQHeE_dpDn',
|
|
73
|
-
'itemFeedbackLabel': 'cQHeE_couS',
|
|
74
|
-
'itemFeedbackText': 'cQHeE_bcAI'
|
|
75
|
-
};
|
|
76
|
-
var SessionItemResult = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
56
|
+
var SessionItemResult = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
77
57
|
(0, _inherits2.default)(SessionItemResult, _Component);
|
|
78
58
|
|
|
79
59
|
var _super = (0, _createSuper2.default)(SessionItemResult);
|
|
@@ -103,6 +83,16 @@ var SessionItemResult = (_dec = (0, _uiThemeable.themeable)(_theme.default, styl
|
|
|
103
83
|
}
|
|
104
84
|
|
|
105
85
|
(0, _createClass2.default)(SessionItemResult, [{
|
|
86
|
+
key: "componentDidMount",
|
|
87
|
+
value: function componentDidMount() {
|
|
88
|
+
this.props.makeStyles();
|
|
89
|
+
}
|
|
90
|
+
}, {
|
|
91
|
+
key: "componentDidUpdate",
|
|
92
|
+
value: function componentDidUpdate() {
|
|
93
|
+
this.props.makeStyles();
|
|
94
|
+
}
|
|
95
|
+
}, {
|
|
106
96
|
key: "position",
|
|
107
97
|
value: function position() {
|
|
108
98
|
return this.props.sessionItem.position;
|
|
@@ -125,38 +115,38 @@ var SessionItemResult = (_dec = (0, _uiThemeable.themeable)(_theme.default, styl
|
|
|
125
115
|
}, {
|
|
126
116
|
key: "renderRegradeAlert",
|
|
127
117
|
value: function renderRegradeAlert() {
|
|
128
|
-
return
|
|
118
|
+
return (0, _emotion.jsx)(_uiAlerts.Alert, {
|
|
129
119
|
variant: "warning",
|
|
130
120
|
margin: "medium"
|
|
131
|
-
},
|
|
121
|
+
}, (0, _emotion.jsx)(_uiA11yContent.PresentationContent, null, (0, _formatMessage.default)('This question has been regraded.')));
|
|
132
122
|
}
|
|
133
123
|
}, {
|
|
134
124
|
key: "renderUnscorableAlert",
|
|
135
125
|
value: function renderUnscorableAlert() {
|
|
136
126
|
// If they can edit grader feedback they should see the teacher message
|
|
137
127
|
var message = this.props.editGraderFeedback ? (0, _formatMessage.default)('There was a problem grading this question.') : (0, _formatMessage.default)('There was a problem grading this question. Please inform your instructor.');
|
|
138
|
-
return
|
|
128
|
+
return (0, _emotion.jsx)(_uiAlerts.Alert, {
|
|
139
129
|
variant: "warning",
|
|
140
130
|
margin: "medium"
|
|
141
|
-
},
|
|
131
|
+
}, (0, _emotion.jsx)(_uiA11yContent.PresentationContent, null, message));
|
|
142
132
|
}
|
|
143
133
|
}, {
|
|
144
134
|
key: "renderRegradePoints",
|
|
145
135
|
value: function renderRegradePoints() {
|
|
146
|
-
return
|
|
136
|
+
return (0, _emotion.jsx)("div", null, (0, _emotion.jsx)(_uiView.View, {
|
|
147
137
|
as: "span",
|
|
148
138
|
size: "small",
|
|
149
139
|
margin: "small"
|
|
150
|
-
},
|
|
140
|
+
}, (0, _emotion.jsx)(_uiText.Text, {
|
|
151
141
|
color: "secondary"
|
|
152
142
|
}, (0, _formatMessage.default)("Previous score { possible, plural,\n one {{points, number} / # point}\n other {{points, number} / # points}\n }", {
|
|
153
143
|
points: this.props.sessionItemResult.regradeInfo.get('originalScore') || 0,
|
|
154
144
|
possible: this.props.sessionItemResult.regradeInfo.get('originalPointsPossible')
|
|
155
|
-
}))),
|
|
145
|
+
}))), (0, _emotion.jsx)(_uiView.View, {
|
|
156
146
|
as: "span",
|
|
157
147
|
size: "small",
|
|
158
148
|
margin: "small"
|
|
159
|
-
},
|
|
149
|
+
}, (0, _emotion.jsx)(_uiText.Text, {
|
|
160
150
|
color: "warning"
|
|
161
151
|
}, (0, _formatMessage.default)("Regrade score { possible, plural,\n one {{points, number} / # point}\n other {{points, number} / # points}\n }", {
|
|
162
152
|
points: this.props.sessionItemResult.regradeInfo.get('newScore') || 0,
|
|
@@ -166,8 +156,8 @@ var SessionItemResult = (_dec = (0, _uiThemeable.themeable)(_theme.default, styl
|
|
|
166
156
|
}, {
|
|
167
157
|
key: "renderHeader",
|
|
168
158
|
value: function renderHeader() {
|
|
169
|
-
return
|
|
170
|
-
|
|
159
|
+
return (0, _emotion.jsx)("div", {
|
|
160
|
+
css: this.props.styles.sessionItemResultHeader
|
|
171
161
|
}, this.renderResultPosition(), !this.props.restrictQuantitativeData && (this.hasRegradeInfo() ? this.renderRegradePoints() : this.renderPoints()));
|
|
172
162
|
}
|
|
173
163
|
}, {
|
|
@@ -198,7 +188,7 @@ var SessionItemResult = (_dec = (0, _uiThemeable.themeable)(_theme.default, styl
|
|
|
198
188
|
});
|
|
199
189
|
}
|
|
200
190
|
|
|
201
|
-
return
|
|
191
|
+
return (0, _emotion.jsx)(_PositionBox.default, {
|
|
202
192
|
position: position,
|
|
203
193
|
headingLevel: "h3",
|
|
204
194
|
headingText: positionText
|
|
@@ -207,21 +197,22 @@ var SessionItemResult = (_dec = (0, _uiThemeable.themeable)(_theme.default, styl
|
|
|
207
197
|
}, {
|
|
208
198
|
key: "renderPoints",
|
|
209
199
|
value: function renderPoints() {
|
|
210
|
-
return
|
|
211
|
-
|
|
200
|
+
return (0, _emotion.jsx)("div", {
|
|
201
|
+
css: this.props.styles.points,
|
|
202
|
+
className: "fs-mask"
|
|
212
203
|
}, this.pointsDisplayText);
|
|
213
204
|
}
|
|
214
205
|
}, {
|
|
215
206
|
key: "renderFeedbackBox",
|
|
216
207
|
value: function renderFeedbackBox(feedbackContent, formattedFeedbackTitle) {
|
|
217
208
|
if (feedbackContent) {
|
|
218
|
-
return
|
|
209
|
+
return (0, _emotion.jsx)("div", null, (0, _emotion.jsx)(_uiHeading.Heading, {
|
|
219
210
|
level: "h4",
|
|
220
211
|
margin: "xx-small small"
|
|
221
|
-
}, formattedFeedbackTitle),
|
|
222
|
-
|
|
223
|
-
},
|
|
224
|
-
customStyles: styles.itemFeedbackText,
|
|
212
|
+
}, formattedFeedbackTitle), (0, _emotion.jsx)("div", {
|
|
213
|
+
css: this.props.styles.textPadding
|
|
214
|
+
}, (0, _emotion.jsx)(_quizRce.RichContentRendererEmotion, {
|
|
215
|
+
customStyles: this.props.styles.itemFeedbackText,
|
|
225
216
|
content: feedbackContent
|
|
226
217
|
})));
|
|
227
218
|
}
|
|
@@ -239,12 +230,12 @@ var SessionItemResult = (_dec = (0, _uiThemeable.themeable)(_theme.default, styl
|
|
|
239
230
|
var showFeedback = correctFeedback || incorrectFeedback || neutralFeedback || graderFeedback;
|
|
240
231
|
|
|
241
232
|
if (showAnswerFeedback || showFeedback) {
|
|
242
|
-
return
|
|
243
|
-
|
|
244
|
-
},
|
|
233
|
+
return (0, _emotion.jsx)("div", {
|
|
234
|
+
css: this.props.styles.itemFeedbackWrapper
|
|
235
|
+
}, (0, _emotion.jsx)(_uiHeading.Heading, {
|
|
245
236
|
level: "h3",
|
|
246
237
|
margin: "xx-small small medium"
|
|
247
|
-
}, (0, _formatMessage.default)('Feedback')),
|
|
238
|
+
}, (0, _formatMessage.default)('Feedback')), (0, _emotion.jsx)("div", {
|
|
248
239
|
"data-automation": "sdk-answer-feedback-results-view"
|
|
249
240
|
}, this.props.shouldRenderAnswerFeedback && answerFeedback), correctFeedback, incorrectFeedback, neutralFeedback, graderFeedback);
|
|
250
241
|
}
|
|
@@ -256,16 +247,16 @@ var SessionItemResult = (_dec = (0, _uiThemeable.themeable)(_theme.default, styl
|
|
|
256
247
|
|
|
257
248
|
if (!this.props.hideGraderFeedback && graderFeedback.content) {
|
|
258
249
|
if (this.props.editGraderFeedback) {
|
|
259
|
-
return
|
|
250
|
+
return (0, _emotion.jsx)("div", {
|
|
260
251
|
role: "button",
|
|
261
252
|
onClick: this.props.editGraderFeedback,
|
|
262
253
|
onKeyDown: _keyboardClickable.default,
|
|
263
|
-
|
|
254
|
+
css: this.props.styles.itemFeedbackWrapper,
|
|
264
255
|
tabIndex: "0"
|
|
265
|
-
},
|
|
266
|
-
|
|
267
|
-
}, (0, _formatMessage.default)('Feedback from grader')),
|
|
268
|
-
customStyles: styles.itemFeedbackText,
|
|
256
|
+
}, (0, _emotion.jsx)("div", {
|
|
257
|
+
css: this.props.styles.itemFeedbackLabel
|
|
258
|
+
}, (0, _formatMessage.default)('Feedback from grader')), (0, _emotion.jsx)(_quizRce.RichContentRendererEmotion, {
|
|
259
|
+
customStyles: this.props.styles.itemFeedbackText,
|
|
269
260
|
content: graderFeedback.content
|
|
270
261
|
}));
|
|
271
262
|
} else {
|
|
@@ -293,11 +284,11 @@ var SessionItemResult = (_dec = (0, _uiThemeable.themeable)(_theme.default, styl
|
|
|
293
284
|
var simpleResultsModifications = itemResultsModifications && itemResultsModifications.toJS() || {};
|
|
294
285
|
var simpleSessionItem = sessionItem.toJS();
|
|
295
286
|
var simpleSessionItemResult = sessionItemResult.toJS();
|
|
296
|
-
return
|
|
297
|
-
|
|
298
|
-
},
|
|
299
|
-
|
|
300
|
-
},
|
|
287
|
+
return (0, _emotion.jsx)("div", {
|
|
288
|
+
css: this.props.styles.result
|
|
289
|
+
}, (0, _emotion.jsx)("div", {
|
|
290
|
+
css: this.props.styles.question
|
|
291
|
+
}, (0, _emotion.jsx)(ResultInteraction, {
|
|
301
292
|
appContainer: appContainer,
|
|
302
293
|
itemBody: simpleItem.itemBody,
|
|
303
294
|
itemId: simpleSessionItem.id // needed for input group name
|
|
@@ -312,11 +303,8 @@ var SessionItemResult = (_dec = (0, _uiThemeable.themeable)(_theme.default, styl
|
|
|
312
303
|
}, {
|
|
313
304
|
key: "render",
|
|
314
305
|
value: function render() {
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
var classes = (0, _classnames.default)((_classNames = {}, (0, _defineProperty2.default)(_classNames, styles.sessionItemResult, true), (0, _defineProperty2.default)(_classNames, styles.topBorder, this.props.shouldRenderTopBorder), _classNames));
|
|
318
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
319
|
-
className: classes
|
|
306
|
+
return (0, _emotion.jsx)("div", {
|
|
307
|
+
css: this.props.styles.sessionItemResult
|
|
320
308
|
}, this.regraded() ? this.renderRegradeAlert() : null, this.unscorable() ? this.renderUnscorableAlert() : null, this.renderHeader(), this.renderSessionItemResult());
|
|
321
309
|
}
|
|
322
310
|
}, {
|
|
@@ -380,7 +368,12 @@ var SessionItemResult = (_dec = (0, _uiThemeable.themeable)(_theme.default, styl
|
|
|
380
368
|
sessionItem: _reactImmutableProptypes.default.record.isRequired,
|
|
381
369
|
sessionItemResult: _reactImmutableProptypes.default.record.isRequired,
|
|
382
370
|
shouldRenderAnswerFeedback: _propTypes.default.bool,
|
|
383
|
-
|
|
371
|
+
// eslint-disable-next-line react/no-unused-prop-types
|
|
372
|
+
shouldRenderTopBorder: _propTypes.default.bool,
|
|
373
|
+
// used in styles.js
|
|
374
|
+
// eslint-disable-next-line react/require-default-props,react/forbid-prop-types
|
|
375
|
+
styles: _propTypes.default.object,
|
|
376
|
+
makeStyles: _propTypes.default.func
|
|
384
377
|
}, _class2.defaultProps = {
|
|
385
378
|
editGraderFeedback: null,
|
|
386
379
|
hideGraderFeedback: false,
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
11
|
+
|
|
12
|
+
var generateStyle = function generateStyle(componentTheme, props) {
|
|
13
|
+
return {
|
|
14
|
+
sessionItemResult: (0, _objectSpread2.default)({
|
|
15
|
+
padding: componentTheme.sessionItemResultPadding
|
|
16
|
+
}, props.shouldRenderTopBorder && {
|
|
17
|
+
borderTop: "solid ".concat(componentTheme.topBorderWidth, " ").concat(componentTheme.topBorderColor)
|
|
18
|
+
}),
|
|
19
|
+
result: {
|
|
20
|
+
margin: componentTheme.resultMargin
|
|
21
|
+
},
|
|
22
|
+
points: {
|
|
23
|
+
color: componentTheme.pointsColor,
|
|
24
|
+
fontSize: componentTheme.pointFontSize
|
|
25
|
+
},
|
|
26
|
+
question: {
|
|
27
|
+
fontSize: componentTheme.questionFontSize
|
|
28
|
+
},
|
|
29
|
+
sessionItemResultHeader: {
|
|
30
|
+
display: 'flex',
|
|
31
|
+
alignItems: 'center'
|
|
32
|
+
},
|
|
33
|
+
itemFeedbackWrapper: {
|
|
34
|
+
marginTop: componentTheme.itemFeedbackWrapperMargin,
|
|
35
|
+
padding: componentTheme.itemFeedbackWrapperPadding,
|
|
36
|
+
borderRadius: componentTheme.itemFeedbackWrapperBorderRadius,
|
|
37
|
+
fontSize: componentTheme.itemFeedbackWrapperFontSize,
|
|
38
|
+
whiteSpace: 'pre-wrap',
|
|
39
|
+
borderStyle: componentTheme.itemFeedbackWrapperStyle,
|
|
40
|
+
borderWidth: componentTheme.itemFeedbackWrapperBorderWidth,
|
|
41
|
+
borderColor: componentTheme.itemFeedbackWrapperBorderColor
|
|
42
|
+
},
|
|
43
|
+
textPadding: {
|
|
44
|
+
paddingLeft: componentTheme.textPaddingLeft,
|
|
45
|
+
paddingBottom: componentTheme.textPaddingBottom
|
|
46
|
+
},
|
|
47
|
+
itemFeedbackLabel: {
|
|
48
|
+
color: componentTheme.itemFeedbackLabelColor,
|
|
49
|
+
fontSize: componentTheme.itemFeedbackLabelFontSize,
|
|
50
|
+
marginBottom: componentTheme.itemFeedbackMargin
|
|
51
|
+
},
|
|
52
|
+
itemFeedbackText: {
|
|
53
|
+
marginTop: componentTheme.itemFeedbackTextMargin,
|
|
54
|
+
fontSize: componentTheme.itemFeedbackTextSize
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
var _default = generateStyle;
|
|
60
|
+
exports.default = _default;
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default =
|
|
6
|
+
exports.default = void 0;
|
|
7
7
|
|
|
8
|
-
function
|
|
8
|
+
var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
9
9
|
var spacing = _ref.spacing,
|
|
10
10
|
typography = _ref.typography,
|
|
11
11
|
colors = _ref.colors,
|
|
@@ -34,4 +34,7 @@ function generator(_ref) {
|
|
|
34
34
|
textPaddingLeft: spacing.small,
|
|
35
35
|
textPaddingBottom: spacing.small
|
|
36
36
|
};
|
|
37
|
-
}
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
var _default = generateComponentTheme;
|
|
40
|
+
exports.default = _default;
|