@instructure/quiz-core 17.40.1-rc.1 → 17.40.1-rc.3
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/components/resources/quiz/instructions/Instructions/index.js +3 -1
- package/es/building/components/resources/quiz/instructions/Instructions/presenter.js +17 -2
- package/es/building/components/resources/quiz/instructions/Show/index.js +8 -3
- package/es/building/components/resources/quiz/title/Show/index.js +8 -3
- package/es/building/components/resources/quiz/title/Title/index.js +3 -1
- package/es/building/components/resources/quiz/title/Title/presenter.js +13 -2
- package/es/common/records/Quiz.js +1 -0
- package/lib/building/components/resources/quiz/instructions/Instructions/index.js +4 -1
- package/lib/building/components/resources/quiz/instructions/Instructions/presenter.js +17 -2
- package/lib/building/components/resources/quiz/instructions/Show/index.js +11 -3
- package/lib/building/components/resources/quiz/title/Show/index.js +11 -3
- package/lib/building/components/resources/quiz/title/Title/index.js +4 -1
- package/lib/building/components/resources/quiz/title/Title/presenter.js +13 -2
- package/lib/common/records/Quiz.js +1 -0
- package/package.json +10 -10
|
@@ -4,11 +4,13 @@ import { screenreaderNotification } from "../../../../../../common/actions/alert
|
|
|
4
4
|
import { clearModifications, changeQuizInstructions } from "../../../../../../common/actions/modifications.js";
|
|
5
5
|
import { saveQuizChange } from "../../../../../api/quizzes.js";
|
|
6
6
|
import makeEditable from "../../../../../../common/components/shared/functionality/makeEditable.js";
|
|
7
|
+
import { featureOn } from "../../../../../../common/util/featureCheck.js";
|
|
7
8
|
import Instructions from "./presenter.js";
|
|
8
9
|
|
|
9
10
|
function mapStateToProps(state) {
|
|
10
11
|
return {
|
|
11
|
-
errorsShowing: state.get('errorsShowing')
|
|
12
|
+
errorsShowing: state.get('errorsShowing'),
|
|
13
|
+
lockBlueprintContentEnabled: featureOn('lock_blueprint_content')
|
|
12
14
|
};
|
|
13
15
|
}
|
|
14
16
|
|
|
@@ -108,6 +108,17 @@ export var QuizInstructions = (_dec = themeable(theme, styles), _dec(_class = (_
|
|
|
108
108
|
value: function quizID() {
|
|
109
109
|
return this.props.quiz.id;
|
|
110
110
|
}
|
|
111
|
+
}, {
|
|
112
|
+
key: "isContentLocked",
|
|
113
|
+
value: function isContentLocked() {
|
|
114
|
+
var _this$props = this.props,
|
|
115
|
+
lockBlueprintContentEnabled = _this$props.lockBlueprintContentEnabled,
|
|
116
|
+
quiz = _this$props.quiz;
|
|
117
|
+
return lockBlueprintContentEnabled && quiz.originalQuizLockedByBlueprint;
|
|
118
|
+
} // =========
|
|
119
|
+
// actions
|
|
120
|
+
// =========
|
|
121
|
+
|
|
111
122
|
}, {
|
|
112
123
|
key: "saveWorkingInstructions",
|
|
113
124
|
value: function saveWorkingInstructions() {
|
|
@@ -148,10 +159,13 @@ export var QuizInstructions = (_dec = themeable(theme, styles), _dec(_class = (_
|
|
|
148
159
|
return;
|
|
149
160
|
}
|
|
150
161
|
|
|
162
|
+
var contentLocked = this.props.quiz.originalQuizLockedByBlueprint;
|
|
151
163
|
return /*#__PURE__*/React.createElement(QuizInstructionsShow, {
|
|
152
164
|
ref: this.setRef('instructionsPreview'),
|
|
153
165
|
instructions: this.props.quiz.instructions,
|
|
154
|
-
switchOnEditing: this.props.switchOnEditing
|
|
166
|
+
switchOnEditing: this.props.switchOnEditing,
|
|
167
|
+
contentLocked: this.isContentLocked(),
|
|
168
|
+
scrollKey: contentLocked ? this.props.scrollKey : null
|
|
155
169
|
});
|
|
156
170
|
}
|
|
157
171
|
}, {
|
|
@@ -166,7 +180,7 @@ export var QuizInstructions = (_dec = themeable(theme, styles), _dec(_class = (_
|
|
|
166
180
|
}, /*#__PURE__*/React.createElement(Heading, {
|
|
167
181
|
level: "h4",
|
|
168
182
|
as: "h2"
|
|
169
|
-
}, t('Instructions'))), !this.props.isEditing && /*#__PURE__*/React.createElement("div", {
|
|
183
|
+
}, t('Instructions'))), !this.props.isEditing && !this.isContentLocked() && /*#__PURE__*/React.createElement("div", {
|
|
170
184
|
className: styles.editButtonWrapper
|
|
171
185
|
}, /*#__PURE__*/React.createElement(EditButton, {
|
|
172
186
|
screenreaderText: t('Edit Instructions'),
|
|
@@ -184,6 +198,7 @@ export var QuizInstructions = (_dec = themeable(theme, styles), _dec(_class = (_
|
|
|
184
198
|
clearModifications: PropTypes.func.isRequired,
|
|
185
199
|
isEditing: PropTypes.bool.isRequired,
|
|
186
200
|
// Injected by makeEditable
|
|
201
|
+
lockBlueprintContentEnabled: PropTypes.bool.isRequired,
|
|
187
202
|
quiz: ImmutablePropTypes.record.isRequired,
|
|
188
203
|
saveQuizChange: PropTypes.func.isRequired,
|
|
189
204
|
screenreaderNotification: PropTypes.func.isRequired,
|
|
@@ -11,6 +11,7 @@ import { themeable } from '@instructure/ui-themeable';
|
|
|
11
11
|
import { RichContentRenderer } from '@instructure/quiz-rce';
|
|
12
12
|
import { isNewRCEEnabled } from "../../../../../../common/util/rceChecker.js";
|
|
13
13
|
import Overlay from "../../../../../../common/components/shared/overlay/Overlay.js";
|
|
14
|
+
import makeScrollable from "../../../../../../common/components/shared/functionality/makeScrollable.js";
|
|
14
15
|
var styles = {
|
|
15
16
|
componentId: 'cCwUt',
|
|
16
17
|
template: function template(theme) {
|
|
@@ -57,7 +58,8 @@ export var QuizInstructionsShow = (_dec = themeable(theme, styles), _dec(_class
|
|
|
57
58
|
}, /*#__PURE__*/React.createElement(Overlay, {
|
|
58
59
|
wrapperClassName: styles.instructionsShowWrapper,
|
|
59
60
|
onClick: this.switchOnEditing,
|
|
60
|
-
tabIndex: "-1"
|
|
61
|
+
tabIndex: "-1",
|
|
62
|
+
hideOverlay: this.props.contentLocked
|
|
61
63
|
}, /*#__PURE__*/React.createElement("div", {
|
|
62
64
|
"data-automation": "instructions-show-text"
|
|
63
65
|
}, /*#__PURE__*/React.createElement(RichContentRenderer, {
|
|
@@ -72,6 +74,9 @@ export var QuizInstructionsShow = (_dec = themeable(theme, styles), _dec(_class
|
|
|
72
74
|
return QuizInstructionsShow;
|
|
73
75
|
}(Component), _class2.propTypes = {
|
|
74
76
|
instructions: PropTypes.string.isRequired,
|
|
75
|
-
switchOnEditing: PropTypes.func.isRequired
|
|
77
|
+
switchOnEditing: PropTypes.func.isRequired,
|
|
78
|
+
contentLocked: PropTypes.bool
|
|
79
|
+
}, _class2.defaultProps = {
|
|
80
|
+
contentLocked: false
|
|
76
81
|
}, _temp)) || _class);
|
|
77
|
-
export default QuizInstructionsShow;
|
|
82
|
+
export default makeScrollable(QuizInstructionsShow);
|
|
@@ -11,6 +11,7 @@ import { themeable } from '@instructure/ui-themeable';
|
|
|
11
11
|
import { TruncateText } from '@instructure/ui-truncate-text';
|
|
12
12
|
import { Text } from '@instructure/ui-text';
|
|
13
13
|
import Overlay from "../../../../../../common/components/shared/overlay/Overlay.js";
|
|
14
|
+
import makeScrollable from "../../../../../../common/components/shared/functionality/makeScrollable.js";
|
|
14
15
|
var styles = {
|
|
15
16
|
componentId: 'eDyPC',
|
|
16
17
|
template: function template(theme) {
|
|
@@ -56,7 +57,8 @@ export var QuizTitleShow = (_dec = themeable(theme, styles), _dec(_class = (_tem
|
|
|
56
57
|
}, /*#__PURE__*/React.createElement(Overlay, {
|
|
57
58
|
wrapperClassName: styles.titleShowWrapper,
|
|
58
59
|
onClick: this.switchOnEditing,
|
|
59
|
-
tabIndex: "-1"
|
|
60
|
+
tabIndex: "-1",
|
|
61
|
+
hideOverlay: this.props.contentLocked
|
|
60
62
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
61
63
|
color: "primary",
|
|
62
64
|
size: "x-large"
|
|
@@ -70,6 +72,9 @@ export var QuizTitleShow = (_dec = themeable(theme, styles), _dec(_class = (_tem
|
|
|
70
72
|
return QuizTitleShow;
|
|
71
73
|
}(Component), _class2.propTypes = {
|
|
72
74
|
defaultTitle: PropTypes.string.isRequired,
|
|
73
|
-
switchOnEditing: PropTypes.func.isRequired
|
|
75
|
+
switchOnEditing: PropTypes.func.isRequired,
|
|
76
|
+
contentLocked: PropTypes.bool
|
|
77
|
+
}, _class2.defaultProps = {
|
|
78
|
+
contentLocked: false
|
|
74
79
|
}, _temp)) || _class);
|
|
75
|
-
export default QuizTitleShow;
|
|
80
|
+
export default makeScrollable(QuizTitleShow);
|
|
@@ -5,11 +5,13 @@ import { showError, hideError } from "../../../../../../common/actions/errorsSho
|
|
|
5
5
|
import { changeQuizTitle } from "../../../../../../common/actions/modifications.js";
|
|
6
6
|
import { saveQuizChange } from "../../../../../api/quizzes.js";
|
|
7
7
|
import makeEditable from "../../../../../../common/components/shared/functionality/makeEditable.js";
|
|
8
|
+
import { featureOn } from "../../../../../../common/util/featureCheck.js";
|
|
8
9
|
import Title from "./presenter.js";
|
|
9
10
|
|
|
10
11
|
function mapStateToProps(state) {
|
|
11
12
|
return {
|
|
12
|
-
errorsShowing: state.get('errorsShowing')
|
|
13
|
+
errorsShowing: state.get('errorsShowing'),
|
|
14
|
+
lockBlueprintContentEnabled: featureOn('lock_blueprint_content')
|
|
13
15
|
};
|
|
14
16
|
}
|
|
15
17
|
|
|
@@ -106,6 +106,14 @@ export var QuizTitlePresenter = (_dec = themeable(theme, styles), _dec(_class =
|
|
|
106
106
|
key: "isValid",
|
|
107
107
|
value: function isValid() {
|
|
108
108
|
return this.props.workingQuiz.isValid();
|
|
109
|
+
}
|
|
110
|
+
}, {
|
|
111
|
+
key: "isContentLocked",
|
|
112
|
+
value: function isContentLocked() {
|
|
113
|
+
var _this$props = this.props,
|
|
114
|
+
lockBlueprintContentEnabled = _this$props.lockBlueprintContentEnabled,
|
|
115
|
+
quiz = _this$props.quiz;
|
|
116
|
+
return lockBlueprintContentEnabled && quiz.originalQuizLockedByBlueprint;
|
|
109
117
|
} // =========
|
|
110
118
|
// actions
|
|
111
119
|
// =========
|
|
@@ -138,7 +146,9 @@ export var QuizTitlePresenter = (_dec = themeable(theme, styles), _dec(_class =
|
|
|
138
146
|
value: function renderShow() {
|
|
139
147
|
return /*#__PURE__*/React.createElement(QuizTitleShow, {
|
|
140
148
|
switchOnEditing: this.props.switchOnEditing,
|
|
141
|
-
defaultTitle: this.workingTitle()
|
|
149
|
+
defaultTitle: this.workingTitle(),
|
|
150
|
+
contentLocked: this.isContentLocked(),
|
|
151
|
+
scrollKey: this.isContentLocked() ? this.props.scrollKey : null
|
|
142
152
|
});
|
|
143
153
|
}
|
|
144
154
|
}, {
|
|
@@ -154,7 +164,7 @@ export var QuizTitlePresenter = (_dec = themeable(theme, styles), _dec(_class =
|
|
|
154
164
|
}, /*#__PURE__*/React.createElement(Heading, {
|
|
155
165
|
level: "h4",
|
|
156
166
|
as: "h2"
|
|
157
|
-
}, t('Title'))), !this.props.isEditing && /*#__PURE__*/React.createElement("div", {
|
|
167
|
+
}, t('Title'))), !this.props.isEditing && !this.isContentLocked() && /*#__PURE__*/React.createElement("div", {
|
|
158
168
|
className: styles.editButtonWrapper
|
|
159
169
|
}, /*#__PURE__*/React.createElement(EditButton, {
|
|
160
170
|
ref: this.handleEditButtonRef,
|
|
@@ -174,6 +184,7 @@ export var QuizTitlePresenter = (_dec = themeable(theme, styles), _dec(_class =
|
|
|
174
184
|
hideError: PropTypes.func.isRequired,
|
|
175
185
|
isEditing: PropTypes.bool.isRequired,
|
|
176
186
|
// injected by makeEditable
|
|
187
|
+
lockBlueprintContentEnabled: PropTypes.bool.isRequired,
|
|
177
188
|
onQuizUpdated: PropTypes.func.isRequired,
|
|
178
189
|
quiz: ImmutablePropTypes.record.isRequired,
|
|
179
190
|
saveQuizChange: PropTypes.func.isRequired,
|
|
@@ -19,11 +19,14 @@ var _quizzes = require("../../../../../api/quizzes.js");
|
|
|
19
19
|
|
|
20
20
|
var _makeEditable = _interopRequireDefault(require("../../../../../../common/components/shared/functionality/makeEditable.js"));
|
|
21
21
|
|
|
22
|
+
var _featureCheck = require("../../../../../../common/util/featureCheck.js");
|
|
23
|
+
|
|
22
24
|
var _presenter = _interopRequireDefault(require("./presenter.js"));
|
|
23
25
|
|
|
24
26
|
function mapStateToProps(state) {
|
|
25
27
|
return {
|
|
26
|
-
errorsShowing: state.get('errorsShowing')
|
|
28
|
+
errorsShowing: state.get('errorsShowing'),
|
|
29
|
+
lockBlueprintContentEnabled: (0, _featureCheck.featureOn)('lock_blueprint_content')
|
|
27
30
|
};
|
|
28
31
|
}
|
|
29
32
|
|
|
@@ -132,6 +132,17 @@ var QuizInstructions = (_dec = (0, _uiThemeable.themeable)(_theme.default, style
|
|
|
132
132
|
value: function quizID() {
|
|
133
133
|
return this.props.quiz.id;
|
|
134
134
|
}
|
|
135
|
+
}, {
|
|
136
|
+
key: "isContentLocked",
|
|
137
|
+
value: function isContentLocked() {
|
|
138
|
+
var _this$props = this.props,
|
|
139
|
+
lockBlueprintContentEnabled = _this$props.lockBlueprintContentEnabled,
|
|
140
|
+
quiz = _this$props.quiz;
|
|
141
|
+
return lockBlueprintContentEnabled && quiz.originalQuizLockedByBlueprint;
|
|
142
|
+
} // =========
|
|
143
|
+
// actions
|
|
144
|
+
// =========
|
|
145
|
+
|
|
135
146
|
}, {
|
|
136
147
|
key: "saveWorkingInstructions",
|
|
137
148
|
value: function saveWorkingInstructions() {
|
|
@@ -172,10 +183,13 @@ var QuizInstructions = (_dec = (0, _uiThemeable.themeable)(_theme.default, style
|
|
|
172
183
|
return;
|
|
173
184
|
}
|
|
174
185
|
|
|
186
|
+
var contentLocked = this.props.quiz.originalQuizLockedByBlueprint;
|
|
175
187
|
return /*#__PURE__*/_react.default.createElement(_index2.default, {
|
|
176
188
|
ref: this.setRef('instructionsPreview'),
|
|
177
189
|
instructions: this.props.quiz.instructions,
|
|
178
|
-
switchOnEditing: this.props.switchOnEditing
|
|
190
|
+
switchOnEditing: this.props.switchOnEditing,
|
|
191
|
+
contentLocked: this.isContentLocked(),
|
|
192
|
+
scrollKey: contentLocked ? this.props.scrollKey : null
|
|
179
193
|
});
|
|
180
194
|
}
|
|
181
195
|
}, {
|
|
@@ -190,7 +204,7 @@ var QuizInstructions = (_dec = (0, _uiThemeable.themeable)(_theme.default, style
|
|
|
190
204
|
}, /*#__PURE__*/_react.default.createElement(_uiHeading.Heading, {
|
|
191
205
|
level: "h4",
|
|
192
206
|
as: "h2"
|
|
193
|
-
}, (0, _formatMessage.default)('Instructions'))), !this.props.isEditing && /*#__PURE__*/_react.default.createElement("div", {
|
|
207
|
+
}, (0, _formatMessage.default)('Instructions'))), !this.props.isEditing && !this.isContentLocked() && /*#__PURE__*/_react.default.createElement("div", {
|
|
194
208
|
className: styles.editButtonWrapper
|
|
195
209
|
}, /*#__PURE__*/_react.default.createElement(_EditButton.default, {
|
|
196
210
|
screenreaderText: (0, _formatMessage.default)('Edit Instructions'),
|
|
@@ -207,6 +221,7 @@ var QuizInstructions = (_dec = (0, _uiThemeable.themeable)(_theme.default, style
|
|
|
207
221
|
clearModifications: _propTypes.default.func.isRequired,
|
|
208
222
|
isEditing: _propTypes.default.bool.isRequired,
|
|
209
223
|
// Injected by makeEditable
|
|
224
|
+
lockBlueprintContentEnabled: _propTypes.default.bool.isRequired,
|
|
210
225
|
quiz: _reactImmutableProptypes.default.record.isRequired,
|
|
211
226
|
saveQuizChange: _propTypes.default.func.isRequired,
|
|
212
227
|
screenreaderNotification: _propTypes.default.func.isRequired,
|
|
@@ -29,6 +29,8 @@ var _rceChecker = require("../../../../../../common/util/rceChecker.js");
|
|
|
29
29
|
|
|
30
30
|
var _Overlay = _interopRequireDefault(require("../../../../../../common/components/shared/overlay/Overlay.js"));
|
|
31
31
|
|
|
32
|
+
var _makeScrollable = _interopRequireDefault(require("../../../../../../common/components/shared/functionality/makeScrollable.js"));
|
|
33
|
+
|
|
32
34
|
var _theme = _interopRequireDefault(require("./theme.js"));
|
|
33
35
|
|
|
34
36
|
var _formatMessage = _interopRequireDefault(require("@instructure/quiz-i18n/es/format-message"));
|
|
@@ -79,7 +81,8 @@ var QuizInstructionsShow = (_dec = (0, _uiThemeable.themeable)(_theme.default, s
|
|
|
79
81
|
}, /*#__PURE__*/_react.default.createElement(_Overlay.default, {
|
|
80
82
|
wrapperClassName: styles.instructionsShowWrapper,
|
|
81
83
|
onClick: this.switchOnEditing,
|
|
82
|
-
tabIndex: "-1"
|
|
84
|
+
tabIndex: "-1",
|
|
85
|
+
hideOverlay: this.props.contentLocked
|
|
83
86
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
84
87
|
"data-automation": "instructions-show-text"
|
|
85
88
|
}, /*#__PURE__*/_react.default.createElement(_quizRce.RichContentRenderer, {
|
|
@@ -93,8 +96,13 @@ var QuizInstructionsShow = (_dec = (0, _uiThemeable.themeable)(_theme.default, s
|
|
|
93
96
|
return QuizInstructionsShow;
|
|
94
97
|
}(_react.Component), _class2.propTypes = {
|
|
95
98
|
instructions: _propTypes.default.string.isRequired,
|
|
96
|
-
switchOnEditing: _propTypes.default.func.isRequired
|
|
99
|
+
switchOnEditing: _propTypes.default.func.isRequired,
|
|
100
|
+
contentLocked: _propTypes.default.bool
|
|
101
|
+
}, _class2.defaultProps = {
|
|
102
|
+
contentLocked: false
|
|
97
103
|
}, _temp)) || _class);
|
|
98
104
|
exports.QuizInstructionsShow = QuizInstructionsShow;
|
|
99
|
-
|
|
105
|
+
|
|
106
|
+
var _default = (0, _makeScrollable.default)(QuizInstructionsShow);
|
|
107
|
+
|
|
100
108
|
exports.default = _default;
|
|
@@ -29,6 +29,8 @@ var _uiText = require("@instructure/ui-text");
|
|
|
29
29
|
|
|
30
30
|
var _Overlay = _interopRequireDefault(require("../../../../../../common/components/shared/overlay/Overlay.js"));
|
|
31
31
|
|
|
32
|
+
var _makeScrollable = _interopRequireDefault(require("../../../../../../common/components/shared/functionality/makeScrollable.js"));
|
|
33
|
+
|
|
32
34
|
var _theme = _interopRequireDefault(require("./theme.js"));
|
|
33
35
|
|
|
34
36
|
var _dec, _class, _class2, _temp;
|
|
@@ -77,7 +79,8 @@ var QuizTitleShow = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles),
|
|
|
77
79
|
}, /*#__PURE__*/_react.default.createElement(_Overlay.default, {
|
|
78
80
|
wrapperClassName: styles.titleShowWrapper,
|
|
79
81
|
onClick: this.switchOnEditing,
|
|
80
|
-
tabIndex: "-1"
|
|
82
|
+
tabIndex: "-1",
|
|
83
|
+
hideOverlay: this.props.contentLocked
|
|
81
84
|
}, /*#__PURE__*/_react.default.createElement(_uiText.Text, {
|
|
82
85
|
color: "primary",
|
|
83
86
|
size: "x-large"
|
|
@@ -90,8 +93,13 @@ var QuizTitleShow = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles),
|
|
|
90
93
|
return QuizTitleShow;
|
|
91
94
|
}(_react.Component), _class2.propTypes = {
|
|
92
95
|
defaultTitle: _propTypes.default.string.isRequired,
|
|
93
|
-
switchOnEditing: _propTypes.default.func.isRequired
|
|
96
|
+
switchOnEditing: _propTypes.default.func.isRequired,
|
|
97
|
+
contentLocked: _propTypes.default.bool
|
|
98
|
+
}, _class2.defaultProps = {
|
|
99
|
+
contentLocked: false
|
|
94
100
|
}, _temp)) || _class);
|
|
95
101
|
exports.QuizTitleShow = QuizTitleShow;
|
|
96
|
-
|
|
102
|
+
|
|
103
|
+
var _default = (0, _makeScrollable.default)(QuizTitleShow);
|
|
104
|
+
|
|
97
105
|
exports.default = _default;
|
|
@@ -21,11 +21,14 @@ var _quizzes = require("../../../../../api/quizzes.js");
|
|
|
21
21
|
|
|
22
22
|
var _makeEditable = _interopRequireDefault(require("../../../../../../common/components/shared/functionality/makeEditable.js"));
|
|
23
23
|
|
|
24
|
+
var _featureCheck = require("../../../../../../common/util/featureCheck.js");
|
|
25
|
+
|
|
24
26
|
var _presenter = _interopRequireDefault(require("./presenter.js"));
|
|
25
27
|
|
|
26
28
|
function mapStateToProps(state) {
|
|
27
29
|
return {
|
|
28
|
-
errorsShowing: state.get('errorsShowing')
|
|
30
|
+
errorsShowing: state.get('errorsShowing'),
|
|
31
|
+
lockBlueprintContentEnabled: (0, _featureCheck.featureOn)('lock_blueprint_content')
|
|
29
32
|
};
|
|
30
33
|
}
|
|
31
34
|
|
|
@@ -131,6 +131,14 @@ var QuizTitlePresenter = (_dec = (0, _uiThemeable.themeable)(_theme.default, sty
|
|
|
131
131
|
key: "isValid",
|
|
132
132
|
value: function isValid() {
|
|
133
133
|
return this.props.workingQuiz.isValid();
|
|
134
|
+
}
|
|
135
|
+
}, {
|
|
136
|
+
key: "isContentLocked",
|
|
137
|
+
value: function isContentLocked() {
|
|
138
|
+
var _this$props = this.props,
|
|
139
|
+
lockBlueprintContentEnabled = _this$props.lockBlueprintContentEnabled,
|
|
140
|
+
quiz = _this$props.quiz;
|
|
141
|
+
return lockBlueprintContentEnabled && quiz.originalQuizLockedByBlueprint;
|
|
134
142
|
} // =========
|
|
135
143
|
// actions
|
|
136
144
|
// =========
|
|
@@ -163,7 +171,9 @@ var QuizTitlePresenter = (_dec = (0, _uiThemeable.themeable)(_theme.default, sty
|
|
|
163
171
|
value: function renderShow() {
|
|
164
172
|
return /*#__PURE__*/_react.default.createElement(_index2.default, {
|
|
165
173
|
switchOnEditing: this.props.switchOnEditing,
|
|
166
|
-
defaultTitle: this.workingTitle()
|
|
174
|
+
defaultTitle: this.workingTitle(),
|
|
175
|
+
contentLocked: this.isContentLocked(),
|
|
176
|
+
scrollKey: this.isContentLocked() ? this.props.scrollKey : null
|
|
167
177
|
});
|
|
168
178
|
}
|
|
169
179
|
}, {
|
|
@@ -179,7 +189,7 @@ var QuizTitlePresenter = (_dec = (0, _uiThemeable.themeable)(_theme.default, sty
|
|
|
179
189
|
}, /*#__PURE__*/_react.default.createElement(_uiHeading.Heading, {
|
|
180
190
|
level: "h4",
|
|
181
191
|
as: "h2"
|
|
182
|
-
}, (0, _formatMessage.default)('Title'))), !this.props.isEditing && /*#__PURE__*/_react.default.createElement("div", {
|
|
192
|
+
}, (0, _formatMessage.default)('Title'))), !this.props.isEditing && !this.isContentLocked() && /*#__PURE__*/_react.default.createElement("div", {
|
|
183
193
|
className: styles.editButtonWrapper
|
|
184
194
|
}, /*#__PURE__*/_react.default.createElement(_EditButton.default, {
|
|
185
195
|
ref: this.handleEditButtonRef,
|
|
@@ -198,6 +208,7 @@ var QuizTitlePresenter = (_dec = (0, _uiThemeable.themeable)(_theme.default, sty
|
|
|
198
208
|
hideError: _propTypes.default.func.isRequired,
|
|
199
209
|
isEditing: _propTypes.default.bool.isRequired,
|
|
200
210
|
// injected by makeEditable
|
|
211
|
+
lockBlueprintContentEnabled: _propTypes.default.bool.isRequired,
|
|
201
212
|
onQuizUpdated: _propTypes.default.func.isRequired,
|
|
202
213
|
quiz: _reactImmutableProptypes.default.record.isRequired,
|
|
203
214
|
saveQuizChange: _propTypes.default.func.isRequired,
|
|
@@ -184,6 +184,7 @@ var Quiz = (_dec = (0, _withStateCache.default)(function (quiz) {
|
|
|
184
184
|
itemAnalyses: (0, _immutable.List)(),
|
|
185
185
|
items: (0, _immutable.List)(),
|
|
186
186
|
oneAtATimeType: null,
|
|
187
|
+
originalQuizLockedByBlueprint: true,
|
|
187
188
|
outcomeAlignmentSetGuid: null,
|
|
188
189
|
owner: null,
|
|
189
190
|
quizAnalysis: '0',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/quiz-core",
|
|
3
|
-
"version": "17.40.1-rc.
|
|
3
|
+
"version": "17.40.1-rc.3+6a8b0e644",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "The Quiz React SDK by Instructure Inc.",
|
|
6
6
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
@@ -41,11 +41,11 @@
|
|
|
41
41
|
],
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@instructure/outcomes-ui": "^2.1.2",
|
|
44
|
-
"@instructure/quiz-common": "17.40.1-rc.
|
|
45
|
-
"@instructure/quiz-i18n": "17.40.1-rc.
|
|
46
|
-
"@instructure/quiz-interactions": "17.40.1-rc.
|
|
47
|
-
"@instructure/quiz-number-input": "17.40.1-rc.
|
|
48
|
-
"@instructure/quiz-rce": "17.40.1-rc.
|
|
44
|
+
"@instructure/quiz-common": "17.40.1-rc.3+6a8b0e644",
|
|
45
|
+
"@instructure/quiz-i18n": "17.40.1-rc.3+6a8b0e644",
|
|
46
|
+
"@instructure/quiz-interactions": "17.40.1-rc.3+6a8b0e644",
|
|
47
|
+
"@instructure/quiz-number-input": "17.40.1-rc.3+6a8b0e644",
|
|
48
|
+
"@instructure/quiz-rce": "17.40.1-rc.3+6a8b0e644",
|
|
49
49
|
"@instructure/ui-a11y-content": "^7.20.0",
|
|
50
50
|
"@instructure/ui-alerts": "^7.20.0",
|
|
51
51
|
"@instructure/ui-avatar": "^7.20.0",
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
"eventemitter3": "^3.1.0",
|
|
107
107
|
"humps": "^2.0.0",
|
|
108
108
|
"immutable": "^3.8.1",
|
|
109
|
-
"instructure-validations": "17.40.1-rc.
|
|
109
|
+
"instructure-validations": "17.40.1-rc.3+6a8b0e644",
|
|
110
110
|
"ipaddr.js": "^1.5.4",
|
|
111
111
|
"isomorphic-fetch": "^2.2.0",
|
|
112
112
|
"isuuid": "^0.1.0",
|
|
@@ -137,7 +137,7 @@
|
|
|
137
137
|
"uuid": "^3.2.1"
|
|
138
138
|
},
|
|
139
139
|
"devDependencies": {
|
|
140
|
-
"@instructure/quiz-scripts": "17.40.1-rc.
|
|
140
|
+
"@instructure/quiz-scripts": "17.40.1-rc.3+6a8b0e644",
|
|
141
141
|
"@instructure/ui-axe-check": "^7.20.0",
|
|
142
142
|
"@instructure/ui-babel-preset": "^7.20.0",
|
|
143
143
|
"@instructure/ui-karma-config": "^7.20.0",
|
|
@@ -156,7 +156,7 @@
|
|
|
156
156
|
"intl": "^1.2.4",
|
|
157
157
|
"jquery": "^2.2.3",
|
|
158
158
|
"most-subject": "^5.3.0",
|
|
159
|
-
"quiz-presets": "17.40.1-rc.
|
|
159
|
+
"quiz-presets": "17.40.1-rc.3+6a8b0e644",
|
|
160
160
|
"react": "^16.8.6",
|
|
161
161
|
"react-addons-test-utils": "^15.6.2",
|
|
162
162
|
"react-dom": "^16.8.6",
|
|
@@ -172,5 +172,5 @@
|
|
|
172
172
|
"publishConfig": {
|
|
173
173
|
"access": "public"
|
|
174
174
|
},
|
|
175
|
-
"gitHead": "
|
|
175
|
+
"gitHead": "6a8b0e644cc12dc6c5388acf9959b151020ba630"
|
|
176
176
|
}
|