@instructure/quiz-core 22.16.1 → 22.17.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/es/building/api/quizEntries.js +25 -5
- package/es/building/components/layout/header/BuildingButtons/index.js +1 -0
- package/es/building/components/layout/header/BuildingButtons/presenter.js +4 -0
- package/es/building/components/resources/ItemFeedbackModal/index.js +4 -1
- package/es/building/components/resources/ItemFeedbackModal/presenter.js +44 -41
- package/es/building/components/resources/quizEntry/QuizEntry/index.js +2 -1
- package/es/building/components/resources/quizEntry/QuizEntry/presenter.js +6 -2
- package/es/building/components/resources/quizEntry/QuizEntryEdit/Footer/index.js +5 -1
- package/es/building/components/resources/quizEntry/QuizEntryEdit/Footer/presenter.js +39 -3
- package/es/building/components/resources/quizEntry/QuizEntryEdit/index.js +1 -0
- package/es/building/components/resources/quizEntry/QuizEntryEdit/presenter.js +1 -0
- package/es/building/components/resources/quizEntry/QuizEntryShow/components/LeftHeader.js +151 -0
- package/es/building/components/resources/quizEntry/QuizEntryShow/index.js +5 -2
- package/es/building/components/resources/quizEntry/QuizEntryShow/presenter.js +27 -102
- package/es/building/components/resources/quizEntry/QuizEntryShow/styles.js +0 -12
- package/es/common/actions/modal.js +2 -1
- package/es/common/components/ConfirmationModal/index.js +1 -1
- package/es/common/components/ConfirmationModal/presenter.js +49 -169
- package/es/common/components/SDKApp/index.js +22 -23
- package/es/common/components/layout/sidebar/Sidebar/components/TotalPointsPossible.js +37 -0
- package/es/common/components/layout/sidebar/Sidebar/index.js +29 -57
- package/es/common/components/layout/sidebar/SidebarItem/index.js +5 -1
- package/es/common/components/layout/sidebar/SidebarItem/presenter.js +40 -11
- package/es/common/components/layout/sidebar/SidebarItem/styles.js +4 -1
- package/es/common/components/layout/sidebar/Stimulus/presenter.js +26 -1
- package/{lib/common/components/resources/quizSessionResult/Header → es/common/components/resources/QuizSessionResult/QuizSessionResultHeader}/index.js +15 -23
- package/es/common/components/resources/QuizSessionResult/QuizSessionResultInfo/ScoreDisplay/components/LetterGrade.js +36 -0
- package/es/common/components/resources/QuizSessionResult/QuizSessionResultInfo/ScoreDisplay/components/PointsDisplay.js +70 -0
- package/es/common/components/resources/QuizSessionResult/QuizSessionResultInfo/ScoreDisplay/components/Progress.js +57 -0
- package/es/common/components/resources/QuizSessionResult/QuizSessionResultInfo/ScoreDisplay/index.js +49 -0
- package/es/common/components/resources/QuizSessionResult/QuizSessionResultInfo/index.js +118 -0
- package/es/common/components/resources/item/ItemEdit/index.js +5 -3
- package/es/common/components/resources/item/ItemEdit/presenter.js +3 -2
- package/es/common/components/resources/item/ItemShow/index.js +2 -1
- package/es/common/components/resources/quiz/AddContent/Body/index.js +4 -2
- package/es/common/components/resources/quiz/AddContent/Body/presenter.js +25 -6
- package/es/common/components/resources/quiz/AddContent/Body/styles.js +7 -0
- package/es/common/components/resources/quiz/AddContent/Popover/presenter.js +1 -0
- package/es/common/components/resources/sessionItemResult/SessionItemResult/components/SessionItemResultHeader.js +122 -0
- package/es/common/components/resources/sessionItemResult/SessionItemResult/index.js +6 -2
- package/es/common/components/resources/sessionItemResult/SessionItemResult/presenter.js +80 -168
- package/es/common/components/resources/sessionItemResult/SessionItemResult/styles.js +0 -8
- package/es/common/components/resources/stimulus/Stimulus/index.js +4 -1
- package/es/common/components/resources/stimulus/Stimulus/presenter.js +2 -0
- package/es/common/components/resources/stimulus/StimulusEdit/presenter.js +3 -1
- package/es/common/middleware/appSyncMiddleware.js +19 -0
- package/es/common/records/Quiz.js +8 -1
- package/es/common/records/QuizEntry.js +8 -1
- package/es/common/records/SessionItem.js +2 -1
- package/es/common/records/SessionItemResult.js +24 -0
- package/es/common/util/interactionTypePropsHelper.js +4 -2
- package/es/common/util/isMissing.js +4 -0
- package/es/configureStore.js +3 -1
- package/es/index.js +4 -2
- package/es/moderating/components/resources/ModerateTable/presenter.js +14 -9
- package/es/moderating/components/resources/ModerateTableRow/presenter.js +68 -24
- package/es/moderating/components/resources/ModerateTableRow/styles.js +0 -4
- package/es/reduxStore.js +4 -0
- package/es/taking/api/taking.js +45 -10
- package/lib/building/api/quizEntries.js +25 -5
- package/lib/building/components/layout/header/BuildingButtons/index.js +1 -0
- package/lib/building/components/layout/header/BuildingButtons/presenter.js +4 -0
- package/lib/building/components/resources/ItemFeedbackModal/index.js +4 -1
- package/lib/building/components/resources/ItemFeedbackModal/presenter.js +44 -41
- package/lib/building/components/resources/quizEntry/QuizEntry/index.js +2 -1
- package/lib/building/components/resources/quizEntry/QuizEntry/presenter.js +6 -2
- package/lib/building/components/resources/quizEntry/QuizEntryEdit/Footer/index.js +5 -1
- package/lib/building/components/resources/quizEntry/QuizEntryEdit/Footer/presenter.js +39 -3
- package/lib/building/components/resources/quizEntry/QuizEntryEdit/index.js +1 -0
- package/lib/building/components/resources/quizEntry/QuizEntryEdit/presenter.js +1 -0
- package/lib/building/components/resources/quizEntry/QuizEntryShow/components/LeftHeader.js +151 -0
- package/lib/building/components/resources/quizEntry/QuizEntryShow/index.js +5 -2
- package/lib/building/components/resources/quizEntry/QuizEntryShow/presenter.js +27 -102
- package/lib/building/components/resources/quizEntry/QuizEntryShow/styles.js +0 -12
- package/lib/common/actions/modal.js +2 -1
- package/lib/common/components/ConfirmationModal/index.js +1 -1
- package/lib/common/components/ConfirmationModal/presenter.js +49 -169
- package/lib/common/components/SDKApp/index.js +22 -23
- package/lib/common/components/layout/sidebar/Sidebar/components/TotalPointsPossible.js +37 -0
- package/lib/common/components/layout/sidebar/Sidebar/index.js +29 -57
- package/lib/common/components/layout/sidebar/SidebarItem/index.js +5 -1
- package/lib/common/components/layout/sidebar/SidebarItem/presenter.js +40 -11
- package/lib/common/components/layout/sidebar/SidebarItem/styles.js +4 -1
- package/lib/common/components/layout/sidebar/Stimulus/presenter.js +26 -1
- package/{es/common/components/resources/quizSessionResult/Header → lib/common/components/resources/QuizSessionResult/QuizSessionResultHeader}/index.js +15 -23
- package/lib/common/components/resources/QuizSessionResult/QuizSessionResultInfo/ScoreDisplay/components/LetterGrade.js +36 -0
- package/lib/common/components/resources/QuizSessionResult/QuizSessionResultInfo/ScoreDisplay/components/PointsDisplay.js +70 -0
- package/lib/common/components/resources/QuizSessionResult/QuizSessionResultInfo/ScoreDisplay/components/Progress.js +57 -0
- package/lib/common/components/resources/QuizSessionResult/QuizSessionResultInfo/ScoreDisplay/index.js +49 -0
- package/lib/common/components/resources/QuizSessionResult/QuizSessionResultInfo/index.js +118 -0
- package/lib/common/components/resources/item/ItemEdit/index.js +5 -3
- package/lib/common/components/resources/item/ItemEdit/presenter.js +3 -2
- package/lib/common/components/resources/item/ItemShow/index.js +2 -1
- package/lib/common/components/resources/quiz/AddContent/Body/index.js +4 -2
- package/lib/common/components/resources/quiz/AddContent/Body/presenter.js +25 -6
- package/lib/common/components/resources/quiz/AddContent/Body/styles.js +7 -0
- package/lib/common/components/resources/quiz/AddContent/Popover/presenter.js +1 -0
- package/lib/common/components/resources/sessionItemResult/SessionItemResult/components/SessionItemResultHeader.js +122 -0
- package/lib/common/components/resources/sessionItemResult/SessionItemResult/index.js +6 -2
- package/lib/common/components/resources/sessionItemResult/SessionItemResult/presenter.js +80 -168
- package/lib/common/components/resources/sessionItemResult/SessionItemResult/styles.js +0 -8
- package/lib/common/components/resources/stimulus/Stimulus/index.js +4 -1
- package/lib/common/components/resources/stimulus/Stimulus/presenter.js +2 -0
- package/lib/common/components/resources/stimulus/StimulusEdit/presenter.js +3 -1
- package/lib/common/middleware/appSyncMiddleware.js +19 -0
- package/lib/common/records/Quiz.js +8 -1
- package/lib/common/records/QuizEntry.js +8 -1
- package/lib/common/records/SessionItem.js +2 -1
- package/lib/common/records/SessionItemResult.js +24 -0
- package/lib/common/util/interactionTypePropsHelper.js +4 -2
- package/lib/common/util/isMissing.js +4 -0
- package/lib/configureStore.js +3 -1
- package/lib/index.js +4 -2
- package/lib/moderating/components/resources/ModerateTable/presenter.js +14 -9
- package/lib/moderating/components/resources/ModerateTableRow/presenter.js +68 -24
- package/lib/moderating/components/resources/ModerateTableRow/styles.js +0 -4
- package/lib/reduxStore.js +4 -0
- package/lib/taking/api/taking.js +45 -10
- package/package.json +10 -10
- package/es/building/components/resources/ItemFeedbackModal/styles.js +0 -13
- package/es/building/components/resources/ItemFeedbackModal/theme.js +0 -7
- package/es/common/components/resources/quizSessionResult/Info/index.js +0 -410
- package/es/common/components/resources/quizSessionResult/Info/styles.js +0 -58
- package/es/common/components/resources/quizSessionResult/Info/theme.js +0 -13
- package/lib/building/components/resources/ItemFeedbackModal/styles.js +0 -13
- package/lib/building/components/resources/ItemFeedbackModal/theme.js +0 -7
- package/lib/common/components/resources/quizSessionResult/Info/index.js +0 -410
- package/lib/common/components/resources/quizSessionResult/Info/styles.js +0 -58
- package/lib/common/components/resources/quizSessionResult/Info/theme.js +0 -13
- /package/es/common/components/resources/{quizSessionResult/Header → QuizSessionResult/QuizSessionResultHeader}/styles.js +0 -0
- /package/es/common/components/resources/{quizSessionResult/Header → QuizSessionResult/QuizSessionResultHeader}/theme.js +0 -0
- /package/lib/common/components/resources/{quizSessionResult/Header → QuizSessionResult/QuizSessionResultHeader}/styles.js +0 -0
- /package/lib/common/components/resources/{quizSessionResult/Header → QuizSessionResult/QuizSessionResultHeader}/theme.js +0 -0
|
@@ -1,165 +1,57 @@
|
|
|
1
|
-
|
|
2
|
-
if (self === void 0) {
|
|
3
|
-
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
4
|
-
}
|
|
5
|
-
return self;
|
|
6
|
-
}
|
|
7
|
-
function _call_super(_this, derived, args) {
|
|
8
|
-
derived = _get_prototype_of(derived);
|
|
9
|
-
return _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args));
|
|
10
|
-
}
|
|
11
|
-
function _class_call_check(instance, Constructor) {
|
|
12
|
-
if (!(instance instanceof Constructor)) {
|
|
13
|
-
throw new TypeError("Cannot call a class as a function");
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
function _defineProperties(target, props) {
|
|
17
|
-
for(var i = 0; i < props.length; i++){
|
|
18
|
-
var descriptor = props[i];
|
|
19
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
|
20
|
-
descriptor.configurable = true;
|
|
21
|
-
if ("value" in descriptor) descriptor.writable = true;
|
|
22
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
function _create_class(Constructor, protoProps, staticProps) {
|
|
26
|
-
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
27
|
-
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
28
|
-
return Constructor;
|
|
29
|
-
}
|
|
30
|
-
function _define_property(obj, key, value) {
|
|
31
|
-
if (key in obj) {
|
|
32
|
-
Object.defineProperty(obj, key, {
|
|
33
|
-
value: value,
|
|
34
|
-
enumerable: true,
|
|
35
|
-
configurable: true,
|
|
36
|
-
writable: true
|
|
37
|
-
});
|
|
38
|
-
} else {
|
|
39
|
-
obj[key] = value;
|
|
40
|
-
}
|
|
41
|
-
return obj;
|
|
42
|
-
}
|
|
43
|
-
function _get_prototype_of(o) {
|
|
44
|
-
_get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {
|
|
45
|
-
return o.__proto__ || Object.getPrototypeOf(o);
|
|
46
|
-
};
|
|
47
|
-
return _get_prototype_of(o);
|
|
48
|
-
}
|
|
49
|
-
function _inherits(subClass, superClass) {
|
|
50
|
-
if (typeof superClass !== "function" && superClass !== null) {
|
|
51
|
-
throw new TypeError("Super expression must either be null or a function");
|
|
52
|
-
}
|
|
53
|
-
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
54
|
-
constructor: {
|
|
55
|
-
value: subClass,
|
|
56
|
-
writable: true,
|
|
57
|
-
configurable: true
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
if (superClass) _set_prototype_of(subClass, superClass);
|
|
61
|
-
}
|
|
62
|
-
function _possible_constructor_return(self, call) {
|
|
63
|
-
if (call && (_type_of(call) === "object" || typeof call === "function")) {
|
|
64
|
-
return call;
|
|
65
|
-
}
|
|
66
|
-
return _assert_this_initialized(self);
|
|
67
|
-
}
|
|
68
|
-
function _set_prototype_of(o, p) {
|
|
69
|
-
_set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
70
|
-
o.__proto__ = p;
|
|
71
|
-
return o;
|
|
72
|
-
};
|
|
73
|
-
return _set_prototype_of(o, p);
|
|
74
|
-
}
|
|
75
|
-
function _type_of(obj) {
|
|
76
|
-
"@swc/helpers - typeof";
|
|
77
|
-
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
78
|
-
}
|
|
79
|
-
function _is_native_reflect_construct() {
|
|
80
|
-
try {
|
|
81
|
-
var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
82
|
-
} catch (_) {}
|
|
83
|
-
return (_is_native_reflect_construct = function() {
|
|
84
|
-
return !!result;
|
|
85
|
-
})();
|
|
86
|
-
}
|
|
87
|
-
import React, { Component } from 'react';
|
|
1
|
+
import React, { useCallback } from 'react';
|
|
88
2
|
import PropTypes from 'prop-types';
|
|
89
3
|
import { Button, CloseButton } from '@instructure/ui-buttons';
|
|
90
4
|
import { Text } from '@instructure/ui-text';
|
|
91
5
|
import { Heading } from '@instructure/ui-heading';
|
|
92
6
|
import t from '@instructure/quiz-i18n/format-message';
|
|
93
7
|
import { ImportantModal, ModalHeader, ModalBody, ModalFooter, XSMALL_SIDE_MARGIN } from '@instructure/quiz-common';
|
|
94
|
-
export
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
}, _this.props.closeModal);
|
|
110
|
-
}), _define_property(_this, "doAction", function() {
|
|
111
|
-
var _this_props = _this.props, onContinue = _this_props.onContinue, onCancel = _this_props.onCancel;
|
|
112
|
-
if (_this.state.action === 'continue') {
|
|
113
|
-
onContinue && onContinue();
|
|
114
|
-
} else if (_this.state.action === 'cancel') {
|
|
115
|
-
onCancel && onCancel();
|
|
116
|
-
}
|
|
117
|
-
_this.setState({
|
|
118
|
-
action: null
|
|
119
|
-
});
|
|
120
|
-
});
|
|
121
|
-
return _this;
|
|
122
|
-
}
|
|
123
|
-
_create_class(ConfirmationModal, [
|
|
124
|
-
{
|
|
125
|
-
key: "render",
|
|
126
|
-
value: function render() {
|
|
127
|
-
var _this_props = this.props, title = _this_props.title, text = _this_props.text, cancelText = _this_props.cancelText, continueText = _this_props.continueText, size = _this_props.size, shouldReturnFocus = _this_props.shouldReturnFocus, continueVariant = _this_props.continueVariant, automationPrefix = _this_props.automationPrefix;
|
|
128
|
-
return /*#__PURE__*/ React.createElement(ImportantModal, {
|
|
129
|
-
open: this.props.modalOpen,
|
|
130
|
-
size: size || 'small',
|
|
131
|
-
label: title || t('Confirm'),
|
|
132
|
-
onDismiss: this.cancelAction,
|
|
133
|
-
"data-automation": automationPrefix ? "sdk-".concat(automationPrefix, "-confirmation-modal") : 'sdk-confirmation-modal',
|
|
134
|
-
shouldReturnFocus: shouldReturnFocus,
|
|
135
|
-
onClose: this.doAction
|
|
136
|
-
}, /*#__PURE__*/ React.createElement(ModalHeader, null, /*#__PURE__*/ React.createElement(Heading, {
|
|
137
|
-
level: "reset",
|
|
138
|
-
as: "h2",
|
|
139
|
-
"data-automation": automationPrefix ? "sdk-".concat(automationPrefix, "-confirmation-modal-heading") : 'sdk-confirmation-modal-heading'
|
|
140
|
-
}, title || t('Confirm')), /*#__PURE__*/ React.createElement(CloseButton, {
|
|
141
|
-
onClick: this.cancelAction,
|
|
142
|
-
placement: "end",
|
|
143
|
-
offset: "medium",
|
|
144
|
-
screenReaderLabel: t('Close')
|
|
145
|
-
})), /*#__PURE__*/ React.createElement(ModalBody, null, /*#__PURE__*/ React.createElement(Text, {
|
|
146
|
-
color: "primary"
|
|
147
|
-
}, text || t('Are you sure?'))), /*#__PURE__*/ React.createElement(ModalFooter, null, /*#__PURE__*/ React.createElement(Button, {
|
|
148
|
-
onClick: this.cancelAction,
|
|
149
|
-
margin: XSMALL_SIDE_MARGIN,
|
|
150
|
-
"data-automation": automationPrefix ? "sdk-".concat(automationPrefix, "-confirmation-modal-cancel") : 'sdk-confirmation-modal-cancel'
|
|
151
|
-
}, cancelText || t('Cancel')), /*#__PURE__*/ React.createElement(Button, {
|
|
152
|
-
color: continueVariant || 'primary',
|
|
153
|
-
onClick: this.continueAction,
|
|
154
|
-
margin: XSMALL_SIDE_MARGIN,
|
|
155
|
-
"data-automation": automationPrefix ? "sdk-".concat(automationPrefix, "-confirmation-modal-confirm") : 'sdk-confirmation-modal-confirm'
|
|
156
|
-
}, continueText || t('Confirm'))));
|
|
157
|
-
}
|
|
158
|
-
}
|
|
8
|
+
export function ConfirmationModal(param) {
|
|
9
|
+
var closeModal = param.closeModal, modalOpen = param.modalOpen, title = param.title, text = param.text, cancelText = param.cancelText, continueText = param.continueText, continueVariant = param.continueVariant, size = param.size, _param_shouldReturnFocus = param.shouldReturnFocus, shouldReturnFocus = _param_shouldReturnFocus === void 0 ? true : _param_shouldReturnFocus, submitButtonDisabled = param.submitButtonDisabled, onContinue = param.onContinue, onCancel = param.onCancel, automationPrefix = param.automationPrefix;
|
|
10
|
+
var continueAction = useCallback(function() {
|
|
11
|
+
onContinue && onContinue();
|
|
12
|
+
closeModal();
|
|
13
|
+
}, [
|
|
14
|
+
onContinue,
|
|
15
|
+
closeModal
|
|
16
|
+
]);
|
|
17
|
+
var cancelAction = useCallback(function() {
|
|
18
|
+
onCancel && onCancel();
|
|
19
|
+
closeModal();
|
|
20
|
+
}, [
|
|
21
|
+
onCancel,
|
|
22
|
+
closeModal
|
|
159
23
|
]);
|
|
160
|
-
return
|
|
161
|
-
|
|
162
|
-
|
|
24
|
+
return /*#__PURE__*/ React.createElement(ImportantModal, {
|
|
25
|
+
open: modalOpen,
|
|
26
|
+
size: size || 'small',
|
|
27
|
+
label: title || t('Confirm'),
|
|
28
|
+
onDismiss: cancelAction,
|
|
29
|
+
"data-automation": automationPrefix ? "sdk-".concat(automationPrefix, "-confirmation-modal") : 'sdk-confirmation-modal',
|
|
30
|
+
shouldReturnFocus: shouldReturnFocus
|
|
31
|
+
}, /*#__PURE__*/ React.createElement(ModalHeader, null, /*#__PURE__*/ React.createElement(Heading, {
|
|
32
|
+
level: "reset",
|
|
33
|
+
as: "h2",
|
|
34
|
+
"data-automation": automationPrefix ? "sdk-".concat(automationPrefix, "-confirmation-modal-heading") : 'sdk-confirmation-modal-heading'
|
|
35
|
+
}, title || t('Confirm')), /*#__PURE__*/ React.createElement(CloseButton, {
|
|
36
|
+
onClick: cancelAction,
|
|
37
|
+
placement: "end",
|
|
38
|
+
offset: "medium",
|
|
39
|
+
screenReaderLabel: t('Close')
|
|
40
|
+
})), /*#__PURE__*/ React.createElement(ModalBody, null, /*#__PURE__*/ React.createElement(Text, {
|
|
41
|
+
color: "primary"
|
|
42
|
+
}, text || t('Are you sure?'))), /*#__PURE__*/ React.createElement(ModalFooter, null, /*#__PURE__*/ React.createElement(Button, {
|
|
43
|
+
onClick: cancelAction,
|
|
44
|
+
margin: XSMALL_SIDE_MARGIN,
|
|
45
|
+
"data-automation": automationPrefix ? "sdk-".concat(automationPrefix, "-confirmation-modal-cancel") : 'sdk-confirmation-modal-cancel'
|
|
46
|
+
}, cancelText || t('Cancel')), /*#__PURE__*/ React.createElement(Button, {
|
|
47
|
+
color: continueVariant || 'primary',
|
|
48
|
+
disabled: submitButtonDisabled,
|
|
49
|
+
onClick: continueAction,
|
|
50
|
+
margin: XSMALL_SIDE_MARGIN,
|
|
51
|
+
"data-automation": automationPrefix ? "sdk-".concat(automationPrefix, "-confirmation-modal-confirm") : 'sdk-confirmation-modal-confirm'
|
|
52
|
+
}, continueText || t('Confirm'))));
|
|
53
|
+
}
|
|
54
|
+
ConfirmationModal.propTypes = {
|
|
163
55
|
closeModal: PropTypes.func.isRequired,
|
|
164
56
|
modalOpen: PropTypes.bool.isRequired,
|
|
165
57
|
title: PropTypes.string,
|
|
@@ -172,20 +64,8 @@ _define_property(ConfirmationModal, "propTypes", {
|
|
|
172
64
|
continueVariant: PropTypes.string,
|
|
173
65
|
size: PropTypes.string,
|
|
174
66
|
shouldReturnFocus: PropTypes.bool,
|
|
67
|
+
submitButtonDisabled: PropTypes.bool,
|
|
175
68
|
onContinue: PropTypes.func,
|
|
176
69
|
onCancel: PropTypes.func,
|
|
177
70
|
automationPrefix: PropTypes.string
|
|
178
|
-
}
|
|
179
|
-
_define_property(ConfirmationModal, "defaultProps", {
|
|
180
|
-
title: null,
|
|
181
|
-
text: null,
|
|
182
|
-
cancelText: null,
|
|
183
|
-
continueText: null,
|
|
184
|
-
continueVariant: null,
|
|
185
|
-
size: null,
|
|
186
|
-
shouldReturnFocus: true,
|
|
187
|
-
onContinue: null,
|
|
188
|
-
onCancel: null,
|
|
189
|
-
automationPrefix: null
|
|
190
|
-
});
|
|
191
|
-
export default ConfirmationModal;
|
|
71
|
+
};
|
|
@@ -97,7 +97,7 @@ import { DragDropContext } from 'react-dnd';
|
|
|
97
97
|
import { jsx } from '@instructure/emotion';
|
|
98
98
|
import { ApplyLocale } from '@instructure/ui-i18n';
|
|
99
99
|
import { Provider } from '../../react-redux';
|
|
100
|
-
import store from '../../../reduxStore';
|
|
100
|
+
import store, { setAppDispatch } from '../../../reduxStore';
|
|
101
101
|
import { getLocale, withStyleOverrides } from '@instructure/quiz-common';
|
|
102
102
|
import { set } from '../../actions/ui';
|
|
103
103
|
import { addAlert } from '../../actions/alerts';
|
|
@@ -118,6 +118,7 @@ var UndecoratedSDKApp = /*#__PURE__*/ function(Component) {
|
|
|
118
118
|
function UndecoratedSDKApp(props) {
|
|
119
119
|
_class_call_check(this, UndecoratedSDKApp);
|
|
120
120
|
var _this;
|
|
121
|
+
var _this_props_rceConfig;
|
|
121
122
|
_this = _call_super(this, UndecoratedSDKApp, [
|
|
122
123
|
props
|
|
123
124
|
]), _define_property(_this, "addAlert", function(opts) {
|
|
@@ -126,8 +127,27 @@ var UndecoratedSDKApp = /*#__PURE__*/ function(Component) {
|
|
|
126
127
|
// TODO: move to something like this down the line
|
|
127
128
|
// so we dont implicitly share state
|
|
128
129
|
// this.store = this.configureStore()
|
|
130
|
+
setAppDispatch(props.appDispatch);
|
|
129
131
|
_this.store = store;
|
|
130
132
|
_this.setLocale();
|
|
133
|
+
// Initialize Redux store with props BEFORE render to prevent race conditions
|
|
134
|
+
// where child components make API calls before the token is set
|
|
135
|
+
_this.store.dispatch([
|
|
136
|
+
setAPIEndpoint(_this.props.apiEndpoint),
|
|
137
|
+
setCanvasOrigin((_this_props_rceConfig = _this.props.rceConfig) === null || _this_props_rceConfig === void 0 ? void 0 : _this_props_rceConfig.canvasOrigin),
|
|
138
|
+
_this.setAppContainer(_this.props.appContainer),
|
|
139
|
+
setUserToken(_this.props.userToken),
|
|
140
|
+
setOutcomesEndpoint(_this.props.outcomesEndpoint),
|
|
141
|
+
setOutcomesToken(_this.props.outcomesToken),
|
|
142
|
+
setContextUuid(_this.props.contextUuid),
|
|
143
|
+
setExternalAccountUuid(_this.props.externalAccountUuid)
|
|
144
|
+
]);
|
|
145
|
+
if (_this.props.itemBankSharingEnabled) {
|
|
146
|
+
_this.store.dispatch(addFeatures('item_bank_sharing'));
|
|
147
|
+
}
|
|
148
|
+
if (_this.props.gradeByQuestionEnabled !== null) {
|
|
149
|
+
_this.store.dispatch(setGradeByQuestionEnabled(_this.props.gradeByQuestionEnabled));
|
|
150
|
+
}
|
|
131
151
|
return _this;
|
|
132
152
|
}
|
|
133
153
|
_create_class(UndecoratedSDKApp, [
|
|
@@ -151,28 +171,6 @@ var UndecoratedSDKApp = /*#__PURE__*/ function(Component) {
|
|
|
151
171
|
return set('appContainer', selectors);
|
|
152
172
|
}
|
|
153
173
|
},
|
|
154
|
-
{
|
|
155
|
-
key: "UNSAFE_componentWillMount",
|
|
156
|
-
value: function UNSAFE_componentWillMount() {
|
|
157
|
-
var _this_props_rceConfig;
|
|
158
|
-
this.store.dispatch([
|
|
159
|
-
setAPIEndpoint(this.props.apiEndpoint),
|
|
160
|
-
setCanvasOrigin((_this_props_rceConfig = this.props.rceConfig) === null || _this_props_rceConfig === void 0 ? void 0 : _this_props_rceConfig.canvasOrigin),
|
|
161
|
-
this.setAppContainer(this.props.appContainer),
|
|
162
|
-
setUserToken(this.props.userToken),
|
|
163
|
-
setOutcomesEndpoint(this.props.outcomesEndpoint),
|
|
164
|
-
setOutcomesToken(this.props.outcomesToken),
|
|
165
|
-
setContextUuid(this.props.contextUuid),
|
|
166
|
-
setExternalAccountUuid(this.props.externalAccountUuid)
|
|
167
|
-
]);
|
|
168
|
-
if (this.props.itemBankSharingEnabled) {
|
|
169
|
-
this.store.dispatch(addFeatures('item_bank_sharing'));
|
|
170
|
-
}
|
|
171
|
-
if (this.props.gradeByQuestionEnabled !== null) {
|
|
172
|
-
this.store.dispatch(setGradeByQuestionEnabled(this.props.gradeByQuestionEnabled));
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
},
|
|
176
174
|
{
|
|
177
175
|
key: "componentDidMount",
|
|
178
176
|
value: function componentDidMount() {
|
|
@@ -272,6 +270,7 @@ _define_property(UndecoratedSDKApp, "propTypes", {
|
|
|
272
270
|
})),
|
|
273
271
|
userToken: PropTypes.string.isRequired,
|
|
274
272
|
disableAlertLiveRegion: PropTypes.bool,
|
|
273
|
+
appDispatch: PropTypes.func.isRequired,
|
|
275
274
|
styles: PropTypes.object
|
|
276
275
|
});
|
|
277
276
|
_define_property(UndecoratedSDKApp, "contextTypes", {
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import t from '@instructure/quiz-i18n/format-message';
|
|
3
|
+
import { Text } from '@instructure/ui-text';
|
|
4
|
+
import { View } from '@instructure/ui-view';
|
|
5
|
+
import { AccessibleContent } from '@instructure/ui-a11y-content';
|
|
6
|
+
export function TotalPointsPossible(param) {
|
|
7
|
+
var sidebarOpen = param.sidebarOpen, totalPointsPossible = param.totalPointsPossible;
|
|
8
|
+
if (typeof totalPointsPossible !== 'number') {
|
|
9
|
+
return null;
|
|
10
|
+
}
|
|
11
|
+
var pointsText = /*#__PURE__*/ React.createElement(Text, {
|
|
12
|
+
key: "pointsText",
|
|
13
|
+
size: "small",
|
|
14
|
+
weight: "bold"
|
|
15
|
+
}, t("{\n totalPointsPossible, plural,\n one {# pt}\n other {# pts}\n }", {
|
|
16
|
+
totalPointsPossible: totalPointsPossible
|
|
17
|
+
}));
|
|
18
|
+
var responsiveText = pointsText;
|
|
19
|
+
if (sidebarOpen) {
|
|
20
|
+
responsiveText = /*#__PURE__*/ React.createElement(Text, {
|
|
21
|
+
size: "small"
|
|
22
|
+
}, t.rich('Total question points = <points/>', {
|
|
23
|
+
points: function() {
|
|
24
|
+
return pointsText;
|
|
25
|
+
}
|
|
26
|
+
}));
|
|
27
|
+
}
|
|
28
|
+
return /*#__PURE__*/ React.createElement(View, {
|
|
29
|
+
borderWidth: "0 0 small 0",
|
|
30
|
+
padding: "small x-small",
|
|
31
|
+
textAlign: sidebarOpen ? 'start' : 'center'
|
|
32
|
+
}, /*#__PURE__*/ React.createElement(AccessibleContent, {
|
|
33
|
+
alt: t('Total question points = {totalPointsPossible}', {
|
|
34
|
+
totalPointsPossible: totalPointsPossible
|
|
35
|
+
})
|
|
36
|
+
}, responsiveText));
|
|
37
|
+
}
|
|
@@ -99,18 +99,12 @@ function _is_native_reflect_construct() {
|
|
|
99
99
|
return !!result;
|
|
100
100
|
})();
|
|
101
101
|
}
|
|
102
|
-
function _ts_decorate(decorators, target, key, desc) {
|
|
103
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
104
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
105
|
-
else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
106
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
107
|
-
}
|
|
108
102
|
import { Component } from 'react';
|
|
109
103
|
import PropTypes from 'prop-types';
|
|
110
104
|
import { List } from 'immutable';
|
|
111
105
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
|
112
106
|
import { IconMoveStartLine, IconMoveEndLine, IconPinSolid, IconQuizInstructionsLine, IconQuizTitleLine } from '@instructure/ui-icons';
|
|
113
|
-
import {
|
|
107
|
+
import { PresentationContent, ScreenReaderContent } from '@instructure/ui-a11y-content';
|
|
114
108
|
import { IconButton } from '@instructure/ui-buttons';
|
|
115
109
|
import { Link } from '@instructure/ui-link';
|
|
116
110
|
import { Text } from '@instructure/ui-text';
|
|
@@ -124,15 +118,18 @@ import { onPhone } from '../../../../util/windowChecks';
|
|
|
124
118
|
import CustomPropTypes from '../../../../util/CustomPropTypes';
|
|
125
119
|
import noop from '../../../../util/noop';
|
|
126
120
|
import Pin from './Pin';
|
|
121
|
+
import { TotalPointsPossible } from './components/TotalPointsPossible';
|
|
122
|
+
import { connect } from '../../../../react-redux';
|
|
123
|
+
import { getActiveQuiz } from '../../../../../common/selectors/quizzes';
|
|
127
124
|
import generateStyle from './styles';
|
|
128
125
|
import generateComponentTheme from './theme';
|
|
129
|
-
|
|
126
|
+
var BaseSidebar = /*#__PURE__*/ function(Component) {
|
|
130
127
|
"use strict";
|
|
131
|
-
_inherits(
|
|
132
|
-
function
|
|
133
|
-
_class_call_check(this,
|
|
128
|
+
_inherits(BaseSidebar, Component);
|
|
129
|
+
function BaseSidebar() {
|
|
130
|
+
_class_call_check(this, BaseSidebar);
|
|
134
131
|
var _this;
|
|
135
|
-
_this = _call_super(this,
|
|
132
|
+
_this = _call_super(this, BaseSidebar, arguments), _define_property(_this, "scrollToTitle", function(e) {
|
|
136
133
|
e.preventDefault(); // prevent default link navigation
|
|
137
134
|
_this.props.scrollToItem(null)(TITLE_SCROLL_KEY);
|
|
138
135
|
}), _define_property(_this, "scrollToInfo", function(e) {
|
|
@@ -158,7 +155,7 @@ export var Sidebar = /*#__PURE__*/ function(Component) {
|
|
|
158
155
|
});
|
|
159
156
|
return _this;
|
|
160
157
|
}
|
|
161
|
-
_create_class(
|
|
158
|
+
_create_class(BaseSidebar, [
|
|
162
159
|
{
|
|
163
160
|
key: "componentDidMount",
|
|
164
161
|
value: function componentDidMount() {
|
|
@@ -317,41 +314,6 @@ export var Sidebar = /*#__PURE__*/ function(Component) {
|
|
|
317
314
|
})));
|
|
318
315
|
}
|
|
319
316
|
},
|
|
320
|
-
{
|
|
321
|
-
key: "renderTotalPointsPossible",
|
|
322
|
-
value: function renderTotalPointsPossible() {
|
|
323
|
-
var _this_props = this.props, sidebarOpen = _this_props.sidebarOpen, totalPointsPossible = _this_props.totalPointsPossible;
|
|
324
|
-
if (typeof totalPointsPossible !== 'number') {
|
|
325
|
-
return null;
|
|
326
|
-
}
|
|
327
|
-
var pointsText = /*#__PURE__*/ jsx(Text, {
|
|
328
|
-
key: "pointsText",
|
|
329
|
-
size: "small",
|
|
330
|
-
weight: "bold"
|
|
331
|
-
}, t("{\n totalPointsPossible, plural,\n one {# pt}\n other {# pts}\n }", {
|
|
332
|
-
totalPointsPossible: totalPointsPossible
|
|
333
|
-
}));
|
|
334
|
-
var responsiveText = pointsText;
|
|
335
|
-
if (sidebarOpen) {
|
|
336
|
-
responsiveText = /*#__PURE__*/ jsx(Text, {
|
|
337
|
-
size: "small"
|
|
338
|
-
}, t.rich('Total question points = <points/>', {
|
|
339
|
-
points: function() {
|
|
340
|
-
return pointsText;
|
|
341
|
-
}
|
|
342
|
-
}));
|
|
343
|
-
}
|
|
344
|
-
return /*#__PURE__*/ jsx(View, {
|
|
345
|
-
borderWidth: "0 0 small 0",
|
|
346
|
-
padding: "small x-small",
|
|
347
|
-
textAlign: sidebarOpen ? 'start' : 'center'
|
|
348
|
-
}, /*#__PURE__*/ jsx(AccessibleContent, {
|
|
349
|
-
alt: t('Total question points = {totalPointsPossible}', {
|
|
350
|
-
totalPointsPossible: totalPointsPossible
|
|
351
|
-
})
|
|
352
|
-
}, responsiveText));
|
|
353
|
-
}
|
|
354
|
-
},
|
|
355
317
|
{
|
|
356
318
|
key: "renderPinned",
|
|
357
319
|
value: function renderPinned() {
|
|
@@ -390,6 +352,7 @@ export var Sidebar = /*#__PURE__*/ function(Component) {
|
|
|
390
352
|
{
|
|
391
353
|
key: "render",
|
|
392
354
|
value: function render() {
|
|
355
|
+
var _this_props = this.props, sidebarOpen = _this_props.sidebarOpen, totalPointsPossible = _this_props.totalPointsPossible, isSurvey = _this_props.isSurvey;
|
|
393
356
|
return /*#__PURE__*/ jsx(View, null, /*#__PURE__*/ jsx("div", {
|
|
394
357
|
css: this.props.styles.commonContainer,
|
|
395
358
|
id: "sidebar-wrapper",
|
|
@@ -410,17 +373,20 @@ export var Sidebar = /*#__PURE__*/ function(Component) {
|
|
|
410
373
|
onClick: noop,
|
|
411
374
|
id: SIDEBAR_NAV_ID,
|
|
412
375
|
"aria-label": t('Question Navigator')
|
|
413
|
-
}, this.renderSidebarHeader(),
|
|
376
|
+
}, this.renderSidebarHeader(), !isSurvey && /*#__PURE__*/ jsx(TotalPointsPossible, {
|
|
377
|
+
sidebarOpen: sidebarOpen,
|
|
378
|
+
totalPointsPossible: totalPointsPossible
|
|
379
|
+
}), this.renderPinned(), this.renderTitle(), this.renderInstructions(), this.renderResults(), /*#__PURE__*/ jsx("div", {
|
|
414
380
|
css: this.props.styles.sidebarContent
|
|
415
381
|
}, this.props.children)))));
|
|
416
382
|
}
|
|
417
383
|
}
|
|
418
384
|
]);
|
|
419
|
-
return
|
|
385
|
+
return BaseSidebar;
|
|
420
386
|
}(Component);
|
|
421
|
-
_define_property(
|
|
422
|
-
_define_property(
|
|
423
|
-
_define_property(
|
|
387
|
+
_define_property(BaseSidebar, "displayName", 'Sidebar');
|
|
388
|
+
_define_property(BaseSidebar, "componentId", "Quizzes".concat(BaseSidebar.displayName));
|
|
389
|
+
_define_property(BaseSidebar, "propTypes", {
|
|
424
390
|
children: PropTypes.oneOfType([
|
|
425
391
|
PropTypes.element,
|
|
426
392
|
PropTypes.arrayOf(PropTypes.element),
|
|
@@ -430,6 +396,7 @@ _define_property(Sidebar, "propTypes", {
|
|
|
430
396
|
taking: PropTypes.bool,
|
|
431
397
|
scrollToItem: CustomPropTypes.higherOrderFunction.isRequired,
|
|
432
398
|
sidebarOpen: PropTypes.bool.isRequired,
|
|
399
|
+
isSurvey: PropTypes.bool.isRequired,
|
|
433
400
|
pinnedItems: ImmutablePropTypes.listOf(PropTypes.shape({
|
|
434
401
|
sessionItemId: PropTypes.string.isRequired,
|
|
435
402
|
position: PropTypes.number.isRequired
|
|
@@ -443,7 +410,7 @@ _define_property(Sidebar, "propTypes", {
|
|
|
443
410
|
makeStyles: PropTypes.func,
|
|
444
411
|
styles: PropTypes.object
|
|
445
412
|
});
|
|
446
|
-
_define_property(
|
|
413
|
+
_define_property(BaseSidebar, "defaultProps", {
|
|
447
414
|
grading: false,
|
|
448
415
|
taking: false,
|
|
449
416
|
title: null,
|
|
@@ -452,7 +419,12 @@ _define_property(Sidebar, "defaultProps", {
|
|
|
452
419
|
totalPointsPossible: null,
|
|
453
420
|
shouldCloseOnBlur: onPhone()
|
|
454
421
|
});
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
422
|
+
export var UnconnectedSidebar = withStyleOverrides(generateStyle, generateComponentTheme)(BaseSidebar);
|
|
423
|
+
function mapStateToProps(state) {
|
|
424
|
+
var quiz = getActiveQuiz(state);
|
|
425
|
+
return {
|
|
426
|
+
isSurvey: quiz.isSurvey()
|
|
427
|
+
};
|
|
428
|
+
}
|
|
429
|
+
export var Sidebar = connect(mapStateToProps)(UnconnectedSidebar);
|
|
458
430
|
export default Sidebar;
|
|
@@ -4,14 +4,18 @@ import { fileUploading } from '../../../../selectors/calls';
|
|
|
4
4
|
import { connect } from '../../../../react-redux';
|
|
5
5
|
import { SidebarItem as SidebarItemPresenter } from './presenter';
|
|
6
6
|
import { scrollToItem as scrollToItemAction } from '../../../../actions/scrolling';
|
|
7
|
+
import { getActiveQuiz } from '../../../../../common/selectors/quizzes';
|
|
7
8
|
import t from '@instructure/quiz-i18n/format-message';
|
|
8
9
|
export var mapStateToProps = function(state, props) {
|
|
10
|
+
var quiz = getActiveQuiz(state);
|
|
9
11
|
var displayPosition = props.quizEntry ? props.quizEntry.positionToDisplay(props.position) : t('{position, number}', {
|
|
10
12
|
position: props.position
|
|
11
13
|
});
|
|
12
14
|
return {
|
|
13
15
|
displayPosition: displayPosition,
|
|
14
|
-
preventScrollToItem: fileUploading(state) && isOneQuestionAtATime(state)
|
|
16
|
+
preventScrollToItem: fileUploading(state) && isOneQuestionAtATime(state),
|
|
17
|
+
isSurvey: quiz.isSurvey(),
|
|
18
|
+
isRequired: props.quizEntry ? props.quizEntry.isRequired : false
|
|
15
19
|
};
|
|
16
20
|
};
|
|
17
21
|
export var mapDispatchToProps = function(dispatch, props) {
|
|
@@ -93,8 +93,10 @@ function _ts_decorate(decorators, target, key, desc) {
|
|
|
93
93
|
import { Component } from 'react';
|
|
94
94
|
import PropTypes from 'prop-types';
|
|
95
95
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
|
96
|
+
import { View } from '@instructure/ui-view';
|
|
96
97
|
import { Link } from '@instructure/ui-link';
|
|
97
98
|
import { jsx } from '@instructure/emotion';
|
|
99
|
+
import { IconArrowNestLine } from '@instructure/ui-icons';
|
|
98
100
|
import PositionSummary from '../PositionSummary';
|
|
99
101
|
import t from '@instructure/quiz-i18n/format-message';
|
|
100
102
|
import { RichContentRenderer } from '@instructure/quiz-rce';
|
|
@@ -103,6 +105,20 @@ import generateComponentTheme from './theme';
|
|
|
103
105
|
import { Flex, END_EDITING_TRIGGER_CLASSNAME, withStyleOverrides } from '@instructure/quiz-common';
|
|
104
106
|
import { Tooltip } from '@instructure/ui-tooltip';
|
|
105
107
|
import { AccessibleContent } from '@instructure/ui-a11y-content';
|
|
108
|
+
import { RequiredIndicator } from '../../../../../building/components/resources/quizEntry/QuizEntryShow/components/LeftHeader';
|
|
109
|
+
function SideBarItemRightContent(param) {
|
|
110
|
+
var isSurvey = param.isSurvey, isRequired = param.isRequired, pointPossibleText = param.pointPossibleText;
|
|
111
|
+
if (!isSurvey) {
|
|
112
|
+
return /*#__PURE__*/ jsx(View, {
|
|
113
|
+
as: "div",
|
|
114
|
+
width: "40%"
|
|
115
|
+
}, pointPossibleText);
|
|
116
|
+
}
|
|
117
|
+
if (!isRequired) {
|
|
118
|
+
return null;
|
|
119
|
+
}
|
|
120
|
+
return /*#__PURE__*/ jsx(RequiredIndicator, null);
|
|
121
|
+
}
|
|
106
122
|
export var SidebarItem = /*#__PURE__*/ function(Component) {
|
|
107
123
|
"use strict";
|
|
108
124
|
_inherits(SidebarItem, Component);
|
|
@@ -169,25 +185,35 @@ export var SidebarItem = /*#__PURE__*/ function(Component) {
|
|
|
169
185
|
{
|
|
170
186
|
key: "renderButton",
|
|
171
187
|
value: function renderButton() {
|
|
172
|
-
var _this_props = this.props, displayPosition = _this_props.displayPosition, itemId = _this_props.itemId, isAnswered = _this_props.isAnswered;
|
|
173
|
-
var
|
|
188
|
+
var _this_props = this.props, displayPosition = _this_props.displayPosition, itemId = _this_props.itemId, isAnswered = _this_props.isAnswered, inStimulus = _this_props.inStimulus, sidebarOpen = _this_props.sidebarOpen;
|
|
189
|
+
var baseContent = !isAnswered && isAnswered !== null ? t('Navigate to question at position {displayPosition}, unanswered', {
|
|
174
190
|
displayPosition: displayPosition
|
|
175
191
|
}) : t('Navigate to question at position {displayPosition}', {
|
|
176
192
|
displayPosition: displayPosition
|
|
177
193
|
});
|
|
194
|
+
var stimulusContent = !isAnswered && isAnswered !== null ? t('Navigate to stimulus question at position {displayPosition}, unanswered', {
|
|
195
|
+
displayPosition: displayPosition
|
|
196
|
+
}) : t('Navigate to stimulus question at position {displayPosition}', {
|
|
197
|
+
displayPosition: displayPosition
|
|
198
|
+
});
|
|
199
|
+
var content = inStimulus ? stimulusContent : baseContent;
|
|
178
200
|
return /*#__PURE__*/ jsx(Tooltip, {
|
|
179
|
-
renderTip:
|
|
201
|
+
renderTip: sidebarOpen ? '' : /*#__PURE__*/ jsx("span", {
|
|
180
202
|
"aria-hidden": "true"
|
|
181
203
|
}, content),
|
|
182
204
|
placement: "start",
|
|
183
|
-
on:
|
|
205
|
+
on: sidebarOpen ? [] : [
|
|
184
206
|
'hover',
|
|
185
207
|
'focus'
|
|
186
208
|
]
|
|
187
|
-
}, /*#__PURE__*/ jsx(
|
|
209
|
+
}, inStimulus && !sidebarOpen ? /*#__PURE__*/ jsx(IconArrowNestLine, {
|
|
210
|
+
css: {
|
|
211
|
+
margin: '-10px 5px 0 -8px'
|
|
212
|
+
}
|
|
213
|
+
}) : null, /*#__PURE__*/ jsx(Link, {
|
|
188
214
|
href: "#",
|
|
189
215
|
size: "small",
|
|
190
|
-
margin:
|
|
216
|
+
margin: inStimulus && !sidebarOpen ? '0 0 0 -5px 0' : '0 small',
|
|
191
217
|
isWithinText: false,
|
|
192
218
|
forceButtonRole: false,
|
|
193
219
|
onClick: this.scrollToItem,
|
|
@@ -210,7 +236,7 @@ export var SidebarItem = /*#__PURE__*/ function(Component) {
|
|
|
210
236
|
{
|
|
211
237
|
key: "renderOpen",
|
|
212
238
|
value: function renderOpen() {
|
|
213
|
-
var _this_props = this.props, children = _this_props.children, itemName = _this_props.itemName, pointsPossible = _this_props.pointsPossible, styles = _this_props.styles;
|
|
239
|
+
var _this_props = this.props, children = _this_props.children, itemName = _this_props.itemName, pointsPossible = _this_props.pointsPossible, styles = _this_props.styles, isSurvey = _this_props.isSurvey, isRequired = _this_props.isRequired;
|
|
214
240
|
var parentDivClass = "sidebarIsOpen ".concat(END_EDITING_TRIGGER_CLASSNAME);
|
|
215
241
|
return /*#__PURE__*/ jsx("div", {
|
|
216
242
|
className: parentDivClass,
|
|
@@ -229,10 +255,11 @@ export var SidebarItem = /*#__PURE__*/ function(Component) {
|
|
|
229
255
|
}, /*#__PURE__*/ jsx("div", {
|
|
230
256
|
className: "interactionType",
|
|
231
257
|
css: this.props.styles.interactionType
|
|
232
|
-
}, itemName), /*#__PURE__*/ jsx(
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
258
|
+
}, itemName), /*#__PURE__*/ jsx(SideBarItemRightContent, {
|
|
259
|
+
isSurvey: isSurvey,
|
|
260
|
+
isRequired: isRequired,
|
|
261
|
+
pointPossibleText: this.getPointsText(pointsPossible || 0)
|
|
262
|
+
})), /*#__PURE__*/ jsx("div", {
|
|
236
263
|
css: this.props.styles.itemBody
|
|
237
264
|
}, /*#__PURE__*/ jsx(RichContentRenderer, {
|
|
238
265
|
content: this.props.itemBody
|
|
@@ -266,6 +293,8 @@ _define_property(SidebarItem, "propTypes", {
|
|
|
266
293
|
preventScrollToItem: PropTypes.bool.isRequired,
|
|
267
294
|
quizEntry: ImmutablePropTypes.record,
|
|
268
295
|
sidebarOpen: PropTypes.bool.isRequired,
|
|
296
|
+
isSurvey: PropTypes.bool.isRequired,
|
|
297
|
+
isRequired: PropTypes.bool.isRequired,
|
|
269
298
|
// from connect
|
|
270
299
|
scrollToItem: PropTypes.func.isRequired,
|
|
271
300
|
styles: PropTypes.object,
|
|
@@ -58,7 +58,10 @@ var generateStyle = function(componentTheme, props) {
|
|
|
58
58
|
displayNumber: {
|
|
59
59
|
color: componentTheme.darkTextColor,
|
|
60
60
|
fontSize: componentTheme.numberFontSize,
|
|
61
|
-
fontWeight: componentTheme.numberFontWeight
|
|
61
|
+
fontWeight: componentTheme.numberFontWeight,
|
|
62
|
+
minWidth: '2ch',
|
|
63
|
+
display: 'inline-block',
|
|
64
|
+
textAlign: 'center'
|
|
62
65
|
},
|
|
63
66
|
itemBody: {
|
|
64
67
|
fontSize: componentTheme.itemBodyFontSize,
|