@instructure/quiz-core 17.46.2-rc.0 → 17.46.2-rc.10
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/banks/components/BankEntryRow/presenter.js +1 -3
- package/es/building/components/resources/ItemFeedbackModal/presenter.js +1 -4
- package/es/building/components/resources/quiz/instructions/Edit/presenter.js +1 -3
- package/es/building/components/resources/quiz/instructions/Show/index.js +1 -3
- package/es/building/components/resources/quizEntry/QuizEntry/presenter.js +1 -3
- package/es/common/components/layout/sidebar/SidebarItem/presenter.js +1 -3
- package/es/common/components/resources/item/ItemEdit/index.js +1 -2
- package/es/common/components/resources/item/ItemEdit/presenter.js +0 -2
- package/es/common/components/resources/item/ItemOverride/index.js +1 -2
- package/es/common/components/resources/item/ItemOverride/presenter.js +2 -4
- package/es/common/components/resources/quiz/instructions/Instructions.js +1 -3
- package/es/common/components/resources/sessionItemResult/ResultStimulus/index.js +1 -3
- package/es/common/components/resources/sessionItemResult/SessionItemResult/presenter.js +3 -7
- package/es/common/components/resources/stimulus/StimulusEditInfo/presenter.js +1 -3
- package/es/common/components/resources/stimulus/StimulusShowInfo/index.js +1 -3
- package/es/common/util/RceConfigProvider.js +51 -35
- package/es/common/util/interactionTypePropsHelper.js +2 -5
- package/es/common/util/rceChecker.js +1 -1
- package/es/common/util/windowChecks.js +6 -5
- package/es/grading/api/updateResults.js +2 -1
- package/es/reporting/components/itemAnalysis/ItemAnalysisRow/presenter.js +1 -3
- package/lib/banks/components/BankEntryRow/presenter.js +1 -4
- package/lib/building/components/resources/ItemFeedbackModal/presenter.js +1 -5
- package/lib/building/components/resources/quiz/instructions/Edit/presenter.js +1 -4
- package/lib/building/components/resources/quiz/instructions/Show/index.js +1 -4
- package/lib/building/components/resources/quizEntry/QuizEntry/presenter.js +1 -4
- package/lib/common/components/layout/sidebar/SidebarItem/presenter.js +1 -4
- package/lib/common/components/resources/item/ItemEdit/index.js +1 -2
- package/lib/common/components/resources/item/ItemEdit/presenter.js +0 -2
- package/lib/common/components/resources/item/ItemOverride/index.js +1 -2
- package/lib/common/components/resources/item/ItemOverride/presenter.js +2 -4
- package/lib/common/components/resources/quiz/instructions/Instructions.js +1 -4
- package/lib/common/components/resources/sessionItemResult/ResultStimulus/index.js +1 -4
- package/lib/common/components/resources/sessionItemResult/SessionItemResult/presenter.js +3 -8
- package/lib/common/components/resources/stimulus/StimulusEditInfo/presenter.js +1 -4
- package/lib/common/components/resources/stimulus/StimulusShowInfo/index.js +1 -4
- package/lib/common/util/RceConfigProvider.js +50 -34
- package/lib/common/util/interactionTypePropsHelper.js +2 -6
- package/lib/common/util/rceChecker.js +1 -1
- package/lib/common/util/windowChecks.js +13 -7
- package/lib/grading/api/updateResults.js +2 -1
- package/lib/reporting/components/itemAnalysis/ItemAnalysisRow/presenter.js +1 -4
- package/package.json +9 -9
|
@@ -20,7 +20,6 @@ import { PresentationContent, ScreenReaderContent } from '@instructure/ui-a11y-c
|
|
|
20
20
|
import { Alert } from '@instructure/ui-alerts';
|
|
21
21
|
import { themeable } from '@instructure/ui-themeable';
|
|
22
22
|
import { RichContentRenderer } from '@instructure/quiz-rce';
|
|
23
|
-
import { isNewRCEEnabled } from "../../../common/util/rceChecker.js";
|
|
24
23
|
import { BUILD_TRAY_POSITION, COPY_MOVE_BANK_ENTRY_MODAL, SET_EDIT_BUTTON_FOCUS, withI18nSupport } from '@instructure/quiz-common';
|
|
25
24
|
import { extractTextFromHtml } from '@instructure/quiz-interactions';
|
|
26
25
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
@@ -280,8 +279,7 @@ export var BankEntryRow = (_dec = themeable(theme, styles), _dec(_class = (_temp
|
|
|
280
279
|
if (itemOrStimulus.itemBody) {
|
|
281
280
|
return /*#__PURE__*/React.createElement(RichContentRenderer, {
|
|
282
281
|
customStyles: styles.stem,
|
|
283
|
-
content: itemOrStimulus.itemBody
|
|
284
|
-
useNewRce: isNewRCEEnabled()
|
|
282
|
+
content: itemOrStimulus.itemBody
|
|
285
283
|
});
|
|
286
284
|
} else {
|
|
287
285
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -12,7 +12,6 @@ import { Button, CloseButton } from '@instructure/ui-buttons';
|
|
|
12
12
|
import { Heading } from '@instructure/ui-heading';
|
|
13
13
|
import { themeable } from '@instructure/ui-themeable';
|
|
14
14
|
import { RichContentRenderer, RCE_THREE_LINES_HEIGHT } from '@instructure/quiz-rce';
|
|
15
|
-
import { isNewRCEEnabled } from "../../../../common/util/rceChecker.js";
|
|
16
15
|
import { RichContentInput } from "../../../../common/components/RichContentInput/index.js";
|
|
17
16
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
18
17
|
import { Modal, ModalHeader, ModalBody, ModalFooter, ITEM_FEEDBACK_MODAL, ITEM_FEEDBACK_MODAL_FEEDBACK, XSMALL_SIDE_MARGIN } from '@instructure/quiz-common';
|
|
@@ -108,7 +107,6 @@ export var ItemFeedbackModal = (_dec = themeable(theme, styles), _dec(_class = (
|
|
|
108
107
|
parentType: this.props.parentType,
|
|
109
108
|
parentId: this.props.parentId,
|
|
110
109
|
importModalCloseOverride: this.returnToFeedback,
|
|
111
|
-
useNewRce: isNewRCEEnabled(),
|
|
112
110
|
height: RCE_THREE_LINES_HEIGHT
|
|
113
111
|
}));
|
|
114
112
|
}
|
|
@@ -117,8 +115,7 @@ export var ItemFeedbackModal = (_dec = themeable(theme, styles), _dec(_class = (
|
|
|
117
115
|
value: function renderContent() {
|
|
118
116
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(RichContentRenderer, {
|
|
119
117
|
customStyles: styles.itemStem,
|
|
120
|
-
content: this.props.item.itemBody
|
|
121
|
-
useNewRce: isNewRCEEnabled()
|
|
118
|
+
content: this.props.item.itemBody
|
|
122
119
|
}), this.renderRichContentInput('correct', t('For a correct answer')), this.renderRichContentInput('incorrect', t('For an incorrect answer')), this.renderRichContentInput('neutral', t('Provide general feedback (regardless of answer)')));
|
|
123
120
|
}
|
|
124
121
|
}, {
|
|
@@ -11,7 +11,6 @@ import { Button } from '@instructure/ui-buttons';
|
|
|
11
11
|
import { themeable } from '@instructure/ui-themeable';
|
|
12
12
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
13
13
|
import RichContentInput from "../../../../../../common/components/RichContentInput/index.js";
|
|
14
|
-
import { isNewRCEEnabled } from "../../../../../../common/util/rceChecker.js";
|
|
15
14
|
import wrapWithOutsideClick from "../../../../../../common/components/shared/functionality/componentWithOutsideClick.js";
|
|
16
15
|
import CustomPropTypes from "../../../../../../common/util/CustomPropTypes.js";
|
|
17
16
|
import elementsForSelectors from "../../../../../../common/util/ElementsForSelectors.js";
|
|
@@ -89,8 +88,7 @@ var QuizInstructionsEdit = (_dec = themeable(theme, styles), _dec(_class = (_tem
|
|
|
89
88
|
onKeyUp: this.props.onInputChange,
|
|
90
89
|
onChange: this.props.onInputChange,
|
|
91
90
|
parentType: PARENT_TYPE_QUIZ,
|
|
92
|
-
parentId: this.props.quizId
|
|
93
|
-
useNewRce: isNewRCEEnabled()
|
|
91
|
+
parentId: this.props.quizId
|
|
94
92
|
}), /*#__PURE__*/React.createElement("div", {
|
|
95
93
|
className: styles.footer
|
|
96
94
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
@@ -9,7 +9,6 @@ import React, { Component } from 'react';
|
|
|
9
9
|
import PropTypes from 'prop-types';
|
|
10
10
|
import { themeable } from '@instructure/ui-themeable';
|
|
11
11
|
import { RichContentRenderer } from '@instructure/quiz-rce';
|
|
12
|
-
import { isNewRCEEnabled } from "../../../../../../common/util/rceChecker.js";
|
|
13
12
|
import Overlay from "../../../../../../common/components/shared/overlay/Overlay.js";
|
|
14
13
|
import makeScrollable from "../../../../../../common/components/shared/functionality/makeScrollable.js";
|
|
15
14
|
var styles = {
|
|
@@ -64,8 +63,7 @@ export var QuizInstructionsShow = (_dec = themeable(theme, styles), _dec(_class
|
|
|
64
63
|
"data-automation": "instructions-show-text"
|
|
65
64
|
}, /*#__PURE__*/React.createElement(RichContentRenderer, {
|
|
66
65
|
customStyles: styles.instructionsShowText,
|
|
67
|
-
content: this.props.instructions || t('Add Instructions...')
|
|
68
|
-
useNewRce: isNewRCEEnabled()
|
|
66
|
+
content: this.props.instructions || t('Add Instructions...')
|
|
69
67
|
}))));
|
|
70
68
|
}
|
|
71
69
|
}]);
|
|
@@ -26,7 +26,6 @@ import ItemOverride from "../../../../../common/components/resources/item/ItemOv
|
|
|
26
26
|
import AddToBankOptions from "../../AddToBankOptions/index.js";
|
|
27
27
|
import TagDisplay from "../../../../../common/components/shared/TagDisplay/index.js";
|
|
28
28
|
import Item from "../../../../../common/records/Item.js";
|
|
29
|
-
import { isNewRCEEnabled } from "../../../../../common/util/rceChecker.js";
|
|
30
29
|
import { BUILD_TRAY_OPEN, PARENT_TYPE_QUIZ, REGRADE_MODAL, SHOULD_CLONE_ITEM } from '@instructure/quiz-common';
|
|
31
30
|
import QuizEntryShow from "../QuizEntryShow/index.js";
|
|
32
31
|
import QuizEntryEdit from "../QuizEntryEdit/index.js";
|
|
@@ -174,8 +173,7 @@ export var QuizEntry = (_dec = themeable(theme, styles), _dec(_class = (_temp =
|
|
|
174
173
|
initialFocusId: this.props.initialFocusId,
|
|
175
174
|
handleValidationErrorsFromApi: this.props.handleValidationErrorsFromApi,
|
|
176
175
|
clearValidationErrorsFromApi: this.props.clearValidationErrorsFromApi,
|
|
177
|
-
haveValidationErrorsFromApi: Boolean(Object.values(this.props.validationErrorsFromApi).length)
|
|
178
|
-
useNewRce: isNewRCEEnabled()
|
|
176
|
+
haveValidationErrorsFromApi: Boolean(Object.values(this.props.validationErrorsFromApi).length)
|
|
179
177
|
}, pick(this.props, ['displayPosition', 'guid', 'draggingOnBuild', 'newHoverPosition', 'quizEntry', 'quizEntries', 'quizId', 'isContentLockedByBlueprint', 'setUi', 'switchOffEditing', 'switchOnEditing', 'shouldClone', 'scrollKey', 'editQuizEntryToggle', 'onEditQuizEntryToggle', 'stimulusOrientation']));
|
|
180
178
|
}
|
|
181
179
|
}, {
|
|
@@ -17,7 +17,6 @@ import { themeable } from '@instructure/ui-themeable';
|
|
|
17
17
|
import PositionSummary from "../PositionSummary/index.js";
|
|
18
18
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
19
19
|
import { RichContentRenderer } from '@instructure/quiz-rce';
|
|
20
|
-
import { isNewRCEEnabled } from "../../../../util/rceChecker.js";
|
|
21
20
|
var styles = {
|
|
22
21
|
componentId: 'cwwgG',
|
|
23
22
|
template: function template(theme) {
|
|
@@ -160,8 +159,7 @@ export var SidebarItem = (_dec = themeable(theme, styles), _dec(_class = (_temp
|
|
|
160
159
|
}, this.getPointsText(pointsPossible || 0))), /*#__PURE__*/React.createElement("div", {
|
|
161
160
|
className: styles.itemBody
|
|
162
161
|
}, /*#__PURE__*/React.createElement(RichContentRenderer, {
|
|
163
|
-
content: this.props.itemBody
|
|
164
|
-
useNewRce: isNewRCEEnabled()
|
|
162
|
+
content: this.props.itemBody
|
|
165
163
|
})))), /*#__PURE__*/React.createElement(Flex.Item, null, /*#__PURE__*/React.createElement("div", {
|
|
166
164
|
className: styles.pinWrapper
|
|
167
165
|
}, children))));
|
|
@@ -37,8 +37,7 @@ export function mapStateToProps(state, props) {
|
|
|
37
37
|
partialDeepScoringEnabled: featureOn('partial_deep_scoring'),
|
|
38
38
|
partialScoringEnabled: featureOn('partial_scoring'),
|
|
39
39
|
quizId: getActiveQuizId(state),
|
|
40
|
-
showCalculator: featureOn('calculator_per_question')
|
|
41
|
-
useNewRce: featureOn('use_new_rce')
|
|
40
|
+
showCalculator: featureOn('calculator_per_question')
|
|
42
41
|
};
|
|
43
42
|
}
|
|
44
43
|
|
|
@@ -180,7 +180,6 @@ ItemEdit.propTypes = {
|
|
|
180
180
|
setUploadStatus: PropTypes.func.isRequired,
|
|
181
181
|
initialFocusId: PropTypes.string,
|
|
182
182
|
showCalculator: PropTypes.bool,
|
|
183
|
-
useNewRce: PropTypes.bool,
|
|
184
183
|
clearValidationErrorsFromApi: PropTypes.func.isRequired,
|
|
185
184
|
validationErrorsFromApi: PropTypes.objectOf(PropTypes.arrayOf(PropTypes.shape({
|
|
186
185
|
type: PropTypes.string,
|
|
@@ -199,7 +198,6 @@ ItemEdit.defaultProps = {
|
|
|
199
198
|
partialScoringEnabled: false,
|
|
200
199
|
initialFocusId: null,
|
|
201
200
|
showCalculator: false,
|
|
202
|
-
useNewRce: false,
|
|
203
201
|
validationErrorsFromApi: {}
|
|
204
202
|
};
|
|
205
203
|
export default ItemEdit;
|
|
@@ -18,8 +18,7 @@ function mapStateToProps(state, props) {
|
|
|
18
18
|
oneQuestionAtATime: isActiveQuizWorkingInstanceOneQuestionAtATime(state),
|
|
19
19
|
partialDeepScoringEnabled: featureOn('partial_deep_scoring'),
|
|
20
20
|
partialScoringEnabled: featureOn('partial_scoring'),
|
|
21
|
-
quizId: getActiveQuizId(state)
|
|
22
|
-
useNewRce: featureOn('use_new_rce')
|
|
21
|
+
quizId: getActiveQuizId(state)
|
|
23
22
|
};
|
|
24
23
|
}
|
|
25
24
|
|
|
@@ -76,13 +76,11 @@ ItemOverride.propTypes = {
|
|
|
76
76
|
partialScoringEnabled: PropTypes.bool,
|
|
77
77
|
quizId: PropTypes.string.isRequired,
|
|
78
78
|
screenreaderNotification: PropTypes.func.isRequired,
|
|
79
|
-
setOneQuestionAtATime: PropTypes.func.isRequired
|
|
80
|
-
useNewRce: PropTypes.bool
|
|
79
|
+
setOneQuestionAtATime: PropTypes.func.isRequired
|
|
81
80
|
};
|
|
82
81
|
ItemOverride.defaultProps = {
|
|
83
82
|
errorsAreShowing: false,
|
|
84
83
|
partialScoringEnabled: false,
|
|
85
|
-
partialDeepScoringEnabled: false
|
|
86
|
-
useNewRce: false
|
|
84
|
+
partialDeepScoringEnabled: false
|
|
87
85
|
};
|
|
88
86
|
export default ItemOverride;
|
|
@@ -10,7 +10,6 @@ import React, { Component } from 'react';
|
|
|
10
10
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
|
11
11
|
import { themeable } from '@instructure/ui-themeable';
|
|
12
12
|
import { RichContentRenderer } from '@instructure/quiz-rce';
|
|
13
|
-
import { isNewRCEEnabled } from "../../../../util/rceChecker.js";
|
|
14
13
|
import makeScrollable from "../../../shared/functionality/makeScrollable.js"; // ================================
|
|
15
14
|
// renders the quiz instructions on
|
|
16
15
|
// the Preview and Take pages
|
|
@@ -44,8 +43,7 @@ export var QuizInstructions = (_dec = themeable(theme, styles), _dec(_class = (_
|
|
|
44
43
|
tabIndex: "-1"
|
|
45
44
|
}, /*#__PURE__*/React.createElement(RichContentRenderer, {
|
|
46
45
|
customStyles: styles.text,
|
|
47
|
-
content: this.props.quiz.instructions
|
|
48
|
-
useNewRce: isNewRCEEnabled()
|
|
46
|
+
content: this.props.quiz.instructions
|
|
49
47
|
}));
|
|
50
48
|
}
|
|
51
49
|
}]);
|
|
@@ -10,7 +10,6 @@ import PropTypes from 'prop-types';
|
|
|
10
10
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
|
11
11
|
import { themeable } from '@instructure/ui-themeable';
|
|
12
12
|
import { RichContentRenderer } from '@instructure/quiz-rce';
|
|
13
|
-
import { isNewRCEEnabled } from "../../../../util/rceChecker.js";
|
|
14
13
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
15
14
|
var styles = {
|
|
16
15
|
componentId: 'fcFqb',
|
|
@@ -66,8 +65,7 @@ export var ResultStimulus = (_dec = themeable(theme, styles), _dec(_class = (_te
|
|
|
66
65
|
}, /*#__PURE__*/React.createElement("div", {
|
|
67
66
|
className: styles.title
|
|
68
67
|
}, title)), /*#__PURE__*/React.createElement(RichContentRenderer, {
|
|
69
|
-
content: body
|
|
70
|
-
useNewRce: isNewRCEEnabled()
|
|
68
|
+
content: body
|
|
71
69
|
}));
|
|
72
70
|
}
|
|
73
71
|
}, {
|
|
@@ -18,7 +18,6 @@ import { View } from '@instructure/ui-view';
|
|
|
18
18
|
import { PresentationContent } from '@instructure/ui-a11y-content';
|
|
19
19
|
import { themeable } from '@instructure/ui-themeable';
|
|
20
20
|
import { RichContentRenderer } from '@instructure/quiz-rce';
|
|
21
|
-
import { isNewRCEEnabled } from "../../../../util/rceChecker.js";
|
|
22
21
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
23
22
|
import PositionBox from "../../positionBox/PositionBox.js";
|
|
24
23
|
import { COMPONENT_RESULT } from '@instructure/quiz-common';
|
|
@@ -191,8 +190,7 @@ export var SessionItemResult = (_dec = themeable(theme, styles), _dec(_class = (
|
|
|
191
190
|
className: styles.textPadding
|
|
192
191
|
}, /*#__PURE__*/React.createElement(RichContentRenderer, {
|
|
193
192
|
customStyles: styles.itemFeedbackText,
|
|
194
|
-
content: feedbackContent
|
|
195
|
-
useNewRce: isNewRCEEnabled()
|
|
193
|
+
content: feedbackContent
|
|
196
194
|
})));
|
|
197
195
|
}
|
|
198
196
|
}
|
|
@@ -236,8 +234,7 @@ export var SessionItemResult = (_dec = themeable(theme, styles), _dec(_class = (
|
|
|
236
234
|
className: styles.itemFeedbackLabel
|
|
237
235
|
}, t('Feedback from grader')), /*#__PURE__*/React.createElement(RichContentRenderer, {
|
|
238
236
|
customStyles: styles.itemFeedbackText,
|
|
239
|
-
content: graderFeedback.content
|
|
240
|
-
useNewRce: isNewRCEEnabled()
|
|
237
|
+
content: graderFeedback.content
|
|
241
238
|
}));
|
|
242
239
|
} else {
|
|
243
240
|
return this.renderFeedbackBox(graderFeedback.content, t('Feedback from grader'));
|
|
@@ -277,8 +274,7 @@ export var SessionItemResult = (_dec = themeable(theme, styles), _dec(_class = (
|
|
|
277
274
|
properties: simpleItem.properties || {},
|
|
278
275
|
scoringData: simpleSessionItem.scoringData,
|
|
279
276
|
scoredData: simpleSessionItemResult.scoredData,
|
|
280
|
-
itemResultsModifications: simpleResultsModifications[simpleSessionItem.id]
|
|
281
|
-
useNewRce: isNewRCEEnabled()
|
|
277
|
+
itemResultsModifications: simpleResultsModifications[simpleSessionItem.id]
|
|
282
278
|
})), this.renderItemFeedback(simpleSessionItemResult));
|
|
283
279
|
}
|
|
284
280
|
}, {
|
|
@@ -16,7 +16,6 @@ import { themeable } from '@instructure/ui-themeable';
|
|
|
16
16
|
import { Heading } from '@instructure/ui-heading';
|
|
17
17
|
import RichContentInput from "../../../RichContentInput/index.js";
|
|
18
18
|
import { toErrors } from "../../../../util/instUIMessages.js";
|
|
19
|
-
import { isNewRCEEnabled } from "../../../../util/rceChecker.js";
|
|
20
19
|
import Errors from "../../../shared/errors/Errors.js";
|
|
21
20
|
import { SimpleSelect } from '@instructure/ui-simple-select';
|
|
22
21
|
import { IconUpdownLine } from '@instructure/ui-icons';
|
|
@@ -177,8 +176,7 @@ export var StimulusEditInfo = (_dec = themeable(theme, styles), _dec(_class = (_
|
|
|
177
176
|
onKeyUp: this.onBodyChange,
|
|
178
177
|
onBlur: this.onBodyChange,
|
|
179
178
|
onChange: this.onBodyChange,
|
|
180
|
-
uploadPath: this.fileUploadUrl()
|
|
181
|
-
useNewRce: isNewRCEEnabled()
|
|
179
|
+
uploadPath: this.fileUploadUrl()
|
|
182
180
|
}), /*#__PURE__*/React.createElement(Errors, {
|
|
183
181
|
errorList: this.errorsList('body')
|
|
184
182
|
})), /*#__PURE__*/React.createElement("div", {
|
|
@@ -8,7 +8,6 @@ import { Heading } from '@instructure/ui-heading';
|
|
|
8
8
|
import { Text } from '@instructure/ui-text';
|
|
9
9
|
import { View } from '@instructure/ui-view';
|
|
10
10
|
import { RichContentRenderer } from '@instructure/quiz-rce';
|
|
11
|
-
import { isNewRCEEnabled } from "../../../../util/rceChecker.js";
|
|
12
11
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
13
12
|
|
|
14
13
|
var StimulusShowInfo = /*#__PURE__*/function (_Component) {
|
|
@@ -58,8 +57,7 @@ var StimulusShowInfo = /*#__PURE__*/function (_Component) {
|
|
|
58
57
|
}, this.props.stimulus.title), instructions, /*#__PURE__*/React.createElement("div", {
|
|
59
58
|
"data-automation": "sdk-stimulus-LeftPanelShow-content"
|
|
60
59
|
}, /*#__PURE__*/React.createElement(RichContentRenderer, {
|
|
61
|
-
content: this.props.stimulus.body
|
|
62
|
-
useNewRce: isNewRCEEnabled()
|
|
60
|
+
content: this.props.stimulus.body
|
|
63
61
|
})));
|
|
64
62
|
}
|
|
65
63
|
}]);
|
|
@@ -14,7 +14,7 @@ import { RceConfigContext, RceConfigKeys } from '@instructure/quiz-common';
|
|
|
14
14
|
import { addError } from "../actions/alerts.js";
|
|
15
15
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
16
16
|
import { extractTextFromHtml } from '@instructure/quiz-interactions';
|
|
17
|
-
import {
|
|
17
|
+
import { isQuizTaking, isQuizBuilding } from "./windowChecks.js";
|
|
18
18
|
|
|
19
19
|
var _ref4 = /*#__PURE__*/React.createElement(Card, {
|
|
20
20
|
wrapped: true
|
|
@@ -50,39 +50,37 @@ export var RceConfigProviderComponent = function RceConfigProviderComponent(prop
|
|
|
50
50
|
switch (_context.prev = _context.next) {
|
|
51
51
|
case 0:
|
|
52
52
|
if (hasAllPropsForRcs()) {
|
|
53
|
-
_context.next =
|
|
53
|
+
_context.next = 2;
|
|
54
54
|
break;
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
handleErrorFunc('Invalid RCS configuration');
|
|
58
57
|
return _context.abrupt("return");
|
|
59
58
|
|
|
60
|
-
case
|
|
61
|
-
_context.next =
|
|
59
|
+
case 2:
|
|
60
|
+
_context.next = 4;
|
|
62
61
|
return props.rcsJwtRefreshFn(jwt);
|
|
63
62
|
|
|
64
|
-
case
|
|
63
|
+
case 4:
|
|
65
64
|
response = _context.sent;
|
|
66
65
|
refreshedToken = response === null || response === void 0 ? void 0 : (_response$json = response.json) === null || _response$json === void 0 ? void 0 : _response$json.token; // inst-redux-service-middleware response structure
|
|
67
66
|
|
|
68
67
|
if (refreshedToken) {
|
|
69
|
-
_context.next =
|
|
68
|
+
_context.next = 11;
|
|
70
69
|
break;
|
|
71
70
|
}
|
|
72
71
|
|
|
73
|
-
handleErrorFunc('Unable to refresh RCS token');
|
|
74
72
|
normalizedStem = questionStem !== null && questionStem !== void 0 ? questionStem : 'Unknown stem';
|
|
75
73
|
extractedText = extractTextFromHtml(normalizedStem);
|
|
76
|
-
|
|
74
|
+
handleError(t('Error while answering "{stem}": Full functionality of the Rich Content Editor may not have been available to the user.', {
|
|
77
75
|
stem: extractedText
|
|
78
76
|
}));
|
|
79
77
|
return _context.abrupt("return");
|
|
80
78
|
|
|
81
|
-
case
|
|
79
|
+
case 11:
|
|
82
80
|
setJwt(refreshedToken);
|
|
83
81
|
setTokenFn(refreshedToken);
|
|
84
82
|
|
|
85
|
-
case
|
|
83
|
+
case 13:
|
|
86
84
|
case "end":
|
|
87
85
|
return _context.stop();
|
|
88
86
|
}
|
|
@@ -95,26 +93,44 @@ export var RceConfigProviderComponent = function RceConfigProviderComponent(prop
|
|
|
95
93
|
};
|
|
96
94
|
}();
|
|
97
95
|
|
|
98
|
-
var
|
|
99
|
-
|
|
96
|
+
var handleError = function handleError(quizLogMessage) {
|
|
97
|
+
if (shouldAlertUser()) {
|
|
98
|
+
alertTheUser(alertMessage());
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
if (shouldsetEventToQuizLog()) {
|
|
102
|
+
setEventToQuizLog(quizLogMessage);
|
|
103
|
+
}
|
|
100
104
|
};
|
|
101
105
|
|
|
102
|
-
var
|
|
103
|
-
|
|
106
|
+
var alertTheUser = function alertTheUser(message) {
|
|
107
|
+
store.dispatch(addError(message));
|
|
108
|
+
};
|
|
104
109
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
rendererEnhancement: (_rendererEnhancement = {}, _defineProperty(_rendererEnhancement, RceConfigKeys.handleError, handleErrorFunc), _defineProperty(_rendererEnhancement, RceConfigKeys.canvasOrigin, props.canvasOrigin), _rendererEnhancement),
|
|
108
|
-
featureFlags: (_featureFlags = {}, _defineProperty(_featureFlags, RceConfigKeys.isNewRCEAppsEnabled, props.isNewRCEAppsEnabled), _defineProperty(_featureFlags, RceConfigKeys.rce5Renderer, props.rce5Renderer), _featureFlags)
|
|
109
|
-
};
|
|
110
|
+
var setEventToQuizLog = function setEventToQuizLog(message) {
|
|
111
|
+
props.setEventToQuizLog(message);
|
|
110
112
|
};
|
|
111
113
|
|
|
112
|
-
var
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
114
|
+
var alertMessage = function alertMessage() {
|
|
115
|
+
return isQuizTaking() ? t('The Rich Content Editor has encountered an issue. ' + 'It has been logged for your instructor to review. Please refresh and try again.') : t('The Rich Content Editor has encountered an issue. Please refresh and try again.');
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
var shouldAlertUser = function shouldAlertUser() {
|
|
119
|
+
return isQuizTaking() || isQuizBuilding();
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
var shouldsetEventToQuizLog = function shouldsetEventToQuizLog() {
|
|
123
|
+
return isQuizTaking();
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
var getConfig = function getConfig() {
|
|
127
|
+
var _featureFlags, _ref2;
|
|
116
128
|
|
|
117
|
-
|
|
129
|
+
return {
|
|
130
|
+
featureFlags: (_featureFlags = {}, _defineProperty(_featureFlags, RceConfigKeys.isNewRCEEnabled, props.isNewRCEEnabled), _defineProperty(_featureFlags, RceConfigKeys.rce5Renderer, props.rce5Renderer), _defineProperty(_featureFlags, RceConfigKeys.isNewRCEAppsEnabled, props.isNewRCEAppsEnabled), _featureFlags),
|
|
131
|
+
rcs: hasAllPropsForRcs() && canvasConfig ? (_ref2 = {}, _defineProperty(_ref2, RceConfigKeys.canvasUserId, props.canvasUserId), _defineProperty(_ref2, RceConfigKeys.contextId, props.contextId), _defineProperty(_ref2, RceConfigKeys.contextType, props.contextType), _defineProperty(_ref2, RceConfigKeys.rcsHost, props.rcsHost), _defineProperty(_ref2, RceConfigKeys.rcsJwt, jwt), _defineProperty(_ref2, RceConfigKeys.rcsJwtRefreshFn, refreshToken), _defineProperty(_ref2, RceConfigKeys.canvasConfig, canvasConfig), _ref2) : null,
|
|
132
|
+
rendererEnhancement: _defineProperty({}, RceConfigKeys.canvasOrigin, props.canvasOrigin)
|
|
133
|
+
};
|
|
118
134
|
};
|
|
119
135
|
|
|
120
136
|
useEffect(function () {
|
|
@@ -124,7 +140,7 @@ export var RceConfigProviderComponent = function RceConfigProviderComponent(prop
|
|
|
124
140
|
while (1) {
|
|
125
141
|
switch (_context2.prev = _context2.next) {
|
|
126
142
|
case 0:
|
|
127
|
-
if (!(!props.
|
|
143
|
+
if (!(!props.isNewRCEEnabled && !props.rce5Renderer)) {
|
|
128
144
|
_context2.next = 2;
|
|
129
145
|
break;
|
|
130
146
|
}
|
|
@@ -139,7 +155,7 @@ export var RceConfigProviderComponent = function RceConfigProviderComponent(prop
|
|
|
139
155
|
break;
|
|
140
156
|
}
|
|
141
157
|
|
|
142
|
-
|
|
158
|
+
handleError(t('Error: Full functionality of the Rich Content Editor may not have been available to the user.'));
|
|
143
159
|
return _context2.abrupt("return");
|
|
144
160
|
|
|
145
161
|
case 6:
|
|
@@ -163,7 +179,7 @@ export var RceConfigProviderComponent = function RceConfigProviderComponent(prop
|
|
|
163
179
|
case 16:
|
|
164
180
|
json = _context2.sent;
|
|
165
181
|
setCanvasConfig(json);
|
|
166
|
-
|
|
182
|
+
setEventToQuizLog(null);
|
|
167
183
|
_context2.next = 25;
|
|
168
184
|
break;
|
|
169
185
|
|
|
@@ -171,7 +187,7 @@ export var RceConfigProviderComponent = function RceConfigProviderComponent(prop
|
|
|
171
187
|
_context2.prev = 21;
|
|
172
188
|
_context2.t0 = _context2["catch"](2);
|
|
173
189
|
setCanvasConfig(null);
|
|
174
|
-
|
|
190
|
+
handleError(t('Error: Full functionality of the Rich Content Editor including accessibility features may not have been available to the user.'));
|
|
175
191
|
|
|
176
192
|
case 25:
|
|
177
193
|
_context2.prev = 25;
|
|
@@ -185,10 +201,10 @@ export var RceConfigProviderComponent = function RceConfigProviderComponent(prop
|
|
|
185
201
|
}
|
|
186
202
|
}, _callee2, null, [[2, 21, 25, 28]]);
|
|
187
203
|
}))();
|
|
188
|
-
}, [props.
|
|
204
|
+
}, [props.isNewRCEEnabled, props.rce5Renderer]);
|
|
189
205
|
|
|
190
206
|
if (props.loadedApiFeatures) {
|
|
191
|
-
if (props.
|
|
207
|
+
if (props.isNewRCEEnabled || props.rce5Renderer) {
|
|
192
208
|
if (!canvasConfigLoading) {
|
|
193
209
|
return /*#__PURE__*/React.createElement(RceConfigContext.Provider, {
|
|
194
210
|
value: getConfig()
|
|
@@ -203,10 +219,10 @@ export var RceConfigProviderComponent = function RceConfigProviderComponent(prop
|
|
|
203
219
|
};
|
|
204
220
|
RceConfigProviderComponent.propTypes = {
|
|
205
221
|
children: PropTypes.node.isRequired,
|
|
206
|
-
|
|
222
|
+
isNewRCEEnabled: PropTypes.bool.isRequired,
|
|
207
223
|
rce5Renderer: PropTypes.bool.isRequired,
|
|
208
224
|
isNewRCEAppsEnabled: PropTypes.bool,
|
|
209
|
-
|
|
225
|
+
setEventToQuizLog: PropTypes.func.isRequired,
|
|
210
226
|
contextId: PropTypes.string,
|
|
211
227
|
contextType: PropTypes.string,
|
|
212
228
|
canvasUserId: PropTypes.string,
|
|
@@ -230,7 +246,7 @@ RceConfigProviderComponent.defaultProps = {
|
|
|
230
246
|
|
|
231
247
|
var mapStateToProps = function mapStateToProps(state, ownProps) {
|
|
232
248
|
return {
|
|
233
|
-
|
|
249
|
+
isNewRCEEnabled: isNewRCEEnabled(),
|
|
234
250
|
rce5Renderer: isRCE5RendererEnabled(),
|
|
235
251
|
isNewRCEAppsEnabled: isNewRCEAppsEnabled(),
|
|
236
252
|
loadedApiFeatures: state.getIn(['ui', 'loadedApiFeatures']) || ownProps.loadedApiFeatures
|
|
@@ -238,7 +254,7 @@ var mapStateToProps = function mapStateToProps(state, ownProps) {
|
|
|
238
254
|
};
|
|
239
255
|
|
|
240
256
|
var mapDispatchToProps = {
|
|
241
|
-
|
|
257
|
+
setEventToQuizLog: setRCEError
|
|
242
258
|
};
|
|
243
259
|
var RceConfigProvider = connect(mapStateToProps, mapDispatchToProps)(RceConfigProviderComponent);
|
|
244
260
|
export { RceConfigProvider };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import RichContentInput from "../components/RichContentInput/index.js";
|
|
2
2
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
3
|
-
import { isNewRCEEnabled } from "../../common/util/rceChecker.js";
|
|
4
3
|
export var propsForInteractionEdit = function propsForInteractionEdit(props, additionalOptions) {
|
|
5
4
|
var item = props.workingItem.toJS();
|
|
6
5
|
|
|
@@ -69,8 +68,7 @@ export var propsForInteractionEdit = function propsForInteractionEdit(props, add
|
|
|
69
68
|
setOneQuestionAtATime: setOneQuestionAtATime,
|
|
70
69
|
stemErrors: props.workingItem.errorsFor('itemBody').toJS(),
|
|
71
70
|
initialFocusId: props.initialFocusId,
|
|
72
|
-
calculatorType: item.calculatorType
|
|
73
|
-
useNewRce: props.useNewRce
|
|
71
|
+
calculatorType: item.calculatorType
|
|
74
72
|
};
|
|
75
73
|
};
|
|
76
74
|
export var propsForInteractionShow = function propsForInteractionShow(item) {
|
|
@@ -83,7 +81,6 @@ export var propsForInteractionShow = function propsForInteractionShow(item) {
|
|
|
83
81
|
itemBody: item.itemBody || '',
|
|
84
82
|
properties: item.properties,
|
|
85
83
|
notifyScreenreader: true,
|
|
86
|
-
scoringData: item.scoringData
|
|
87
|
-
useNewRce: isNewRCEEnabled()
|
|
84
|
+
scoringData: item.scoringData
|
|
88
85
|
};
|
|
89
86
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { featureOn } from "./featureCheck.js";
|
|
2
2
|
var newRCEFeatureName = 'use_new_rce';
|
|
3
|
-
var newRCEAppsFeatureName = '
|
|
3
|
+
var newRCEAppsFeatureName = 'rce5_apps';
|
|
4
4
|
var rce5RendererFeatureName = 'rce5_renderer';
|
|
5
5
|
export function isNewRCEEnabled() {
|
|
6
6
|
return featureOn(newRCEFeatureName);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isDuringQuizTake, isDuringQuizBuild } from '@instructure/quiz-common';
|
|
1
2
|
export var media = {
|
|
2
3
|
'phone-break-point': 'only screen and (max-width: 48rem)',
|
|
3
4
|
'tablet-break-point': 'only screen and (max-width: 64rem)'
|
|
@@ -12,9 +13,9 @@ export var onTablet = function onTablet() {
|
|
|
12
13
|
var mediaQueryString = media['tablet-break-point'];
|
|
13
14
|
return !onPhone(windowObj) && windowObj.matchMedia(mediaQueryString).matches;
|
|
14
15
|
};
|
|
15
|
-
export var
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
return
|
|
16
|
+
export var isQuizTaking = function isQuizTaking() {
|
|
17
|
+
return isDuringQuizTake();
|
|
18
|
+
};
|
|
19
|
+
export var isQuizBuilding = function isQuizBuilding() {
|
|
20
|
+
return isDuringQuizBuild();
|
|
20
21
|
};
|
|
@@ -27,7 +27,8 @@ export var postQuizSessionResults = function postQuizSessionResults(sessionId, s
|
|
|
27
27
|
var fetcher = new Fetcher();
|
|
28
28
|
return fetcher.post(url, params).then(function (quizSessionResult) {
|
|
29
29
|
return dispatch([postToParent({
|
|
30
|
-
subject: SUBMISSION_UPDATE_SUBJECT
|
|
30
|
+
subject: SUBMISSION_UPDATE_SUBJECT,
|
|
31
|
+
percentage: quizSessionResult.percentage
|
|
31
32
|
}), handleQuizSessionResultsResponse([quizSessionResult]), fetchQuizSessionCb(sessionId)]);
|
|
32
33
|
});
|
|
33
34
|
};
|
|
@@ -14,7 +14,6 @@ import { Heading } from '@instructure/ui-heading';
|
|
|
14
14
|
import { ScreenReaderContent, PresentationContent } from '@instructure/ui-a11y-content';
|
|
15
15
|
import { themeable } from '@instructure/ui-themeable';
|
|
16
16
|
import { RichContentRenderer } from '@instructure/quiz-rce';
|
|
17
|
-
import { isNewRCEEnabled } from "../../../../common/util/rceChecker.js";
|
|
18
17
|
import Card from "../../../../common/components/shared/Card/index.js";
|
|
19
18
|
import ExpandButton from "../../../../common/components/shared/ExpandButton/index.js";
|
|
20
19
|
import Spinner from "../../../../common/components/shared/spinner/Spinner.js";
|
|
@@ -127,8 +126,7 @@ export var ItemAnalysisRow = (_dec = themeable(theme, styles), _dec(_class = (_t
|
|
|
127
126
|
value: function renderStem() {
|
|
128
127
|
return /*#__PURE__*/React.createElement(RichContentRenderer, {
|
|
129
128
|
customStyles: styles.stem,
|
|
130
|
-
content: this.props.itemAnalysis.itemBody
|
|
131
|
-
useNewRce: isNewRCEEnabled()
|
|
129
|
+
content: this.props.itemAnalysis.itemBody
|
|
132
130
|
});
|
|
133
131
|
}
|
|
134
132
|
}, {
|
|
@@ -47,8 +47,6 @@ var _uiThemeable = require("@instructure/ui-themeable");
|
|
|
47
47
|
|
|
48
48
|
var _quizRce = require("@instructure/quiz-rce");
|
|
49
49
|
|
|
50
|
-
var _rceChecker = require("../../../common/util/rceChecker.js");
|
|
51
|
-
|
|
52
50
|
var _quizCommon = require("@instructure/quiz-common");
|
|
53
51
|
|
|
54
52
|
var _quizInteractions = require("@instructure/quiz-interactions");
|
|
@@ -322,8 +320,7 @@ var BankEntryRow = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles),
|
|
|
322
320
|
if (itemOrStimulus.itemBody) {
|
|
323
321
|
return /*#__PURE__*/_react.default.createElement(_quizRce.RichContentRenderer, {
|
|
324
322
|
customStyles: styles.stem,
|
|
325
|
-
content: itemOrStimulus.itemBody
|
|
326
|
-
useNewRce: (0, _rceChecker.isNewRCEEnabled)()
|
|
323
|
+
content: itemOrStimulus.itemBody
|
|
327
324
|
});
|
|
328
325
|
} else {
|
|
329
326
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -31,8 +31,6 @@ var _uiThemeable = require("@instructure/ui-themeable");
|
|
|
31
31
|
|
|
32
32
|
var _quizRce = require("@instructure/quiz-rce");
|
|
33
33
|
|
|
34
|
-
var _rceChecker = require("../../../../common/util/rceChecker.js");
|
|
35
|
-
|
|
36
34
|
var _index = require("../../../../common/components/RichContentInput/index.js");
|
|
37
35
|
|
|
38
36
|
var _formatMessage = _interopRequireDefault(require("@instructure/quiz-i18n/es/format-message"));
|
|
@@ -134,7 +132,6 @@ var ItemFeedbackModal = (_dec = (0, _uiThemeable.themeable)(_theme.default, styl
|
|
|
134
132
|
parentType: this.props.parentType,
|
|
135
133
|
parentId: this.props.parentId,
|
|
136
134
|
importModalCloseOverride: this.returnToFeedback,
|
|
137
|
-
useNewRce: (0, _rceChecker.isNewRCEEnabled)(),
|
|
138
135
|
height: _quizRce.RCE_THREE_LINES_HEIGHT
|
|
139
136
|
}));
|
|
140
137
|
}
|
|
@@ -143,8 +140,7 @@ var ItemFeedbackModal = (_dec = (0, _uiThemeable.themeable)(_theme.default, styl
|
|
|
143
140
|
value: function renderContent() {
|
|
144
141
|
return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_quizRce.RichContentRenderer, {
|
|
145
142
|
customStyles: styles.itemStem,
|
|
146
|
-
content: this.props.item.itemBody
|
|
147
|
-
useNewRce: (0, _rceChecker.isNewRCEEnabled)()
|
|
143
|
+
content: this.props.item.itemBody
|
|
148
144
|
}), this.renderRichContentInput('correct', (0, _formatMessage.default)('For a correct answer')), this.renderRichContentInput('incorrect', (0, _formatMessage.default)('For an incorrect answer')), this.renderRichContentInput('neutral', (0, _formatMessage.default)('Provide general feedback (regardless of answer)')));
|
|
149
145
|
}
|
|
150
146
|
}, {
|
|
@@ -29,8 +29,6 @@ var _formatMessage = _interopRequireDefault(require("@instructure/quiz-i18n/es/f
|
|
|
29
29
|
|
|
30
30
|
var _index = _interopRequireDefault(require("../../../../../../common/components/RichContentInput/index.js"));
|
|
31
31
|
|
|
32
|
-
var _rceChecker = require("../../../../../../common/util/rceChecker.js");
|
|
33
|
-
|
|
34
32
|
var _componentWithOutsideClick = _interopRequireDefault(require("../../../../../../common/components/shared/functionality/componentWithOutsideClick.js"));
|
|
35
33
|
|
|
36
34
|
var _CustomPropTypes = _interopRequireDefault(require("../../../../../../common/util/CustomPropTypes.js"));
|
|
@@ -115,8 +113,7 @@ var QuizInstructionsEdit = (_dec = (0, _uiThemeable.themeable)(_theme.default, s
|
|
|
115
113
|
onKeyUp: this.props.onInputChange,
|
|
116
114
|
onChange: this.props.onInputChange,
|
|
117
115
|
parentType: _quizCommon.PARENT_TYPE_QUIZ,
|
|
118
|
-
parentId: this.props.quizId
|
|
119
|
-
useNewRce: (0, _rceChecker.isNewRCEEnabled)()
|
|
116
|
+
parentId: this.props.quizId
|
|
120
117
|
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
121
118
|
className: styles.footer
|
|
122
119
|
}, /*#__PURE__*/_react.default.createElement(_uiButtons.Button, {
|
|
@@ -25,8 +25,6 @@ var _uiThemeable = require("@instructure/ui-themeable");
|
|
|
25
25
|
|
|
26
26
|
var _quizRce = require("@instructure/quiz-rce");
|
|
27
27
|
|
|
28
|
-
var _rceChecker = require("../../../../../../common/util/rceChecker.js");
|
|
29
|
-
|
|
30
28
|
var _Overlay = _interopRequireDefault(require("../../../../../../common/components/shared/overlay/Overlay.js"));
|
|
31
29
|
|
|
32
30
|
var _makeScrollable = _interopRequireDefault(require("../../../../../../common/components/shared/functionality/makeScrollable.js"));
|
|
@@ -87,8 +85,7 @@ var QuizInstructionsShow = (_dec = (0, _uiThemeable.themeable)(_theme.default, s
|
|
|
87
85
|
"data-automation": "instructions-show-text"
|
|
88
86
|
}, /*#__PURE__*/_react.default.createElement(_quizRce.RichContentRenderer, {
|
|
89
87
|
customStyles: styles.instructionsShowText,
|
|
90
|
-
content: this.props.instructions || (0, _formatMessage.default)('Add Instructions...')
|
|
91
|
-
useNewRce: (0, _rceChecker.isNewRCEEnabled)()
|
|
88
|
+
content: this.props.instructions || (0, _formatMessage.default)('Add Instructions...')
|
|
92
89
|
}))));
|
|
93
90
|
}
|
|
94
91
|
}]);
|
|
@@ -59,8 +59,6 @@ var _index8 = _interopRequireDefault(require("../../../../../common/components/s
|
|
|
59
59
|
|
|
60
60
|
var _Item = _interopRequireDefault(require("../../../../../common/records/Item.js"));
|
|
61
61
|
|
|
62
|
-
var _rceChecker = require("../../../../../common/util/rceChecker.js");
|
|
63
|
-
|
|
64
62
|
var _quizCommon = require("@instructure/quiz-common");
|
|
65
63
|
|
|
66
64
|
var _index9 = _interopRequireDefault(require("../QuizEntryShow/index.js"));
|
|
@@ -216,8 +214,7 @@ var QuizEntry = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _de
|
|
|
216
214
|
initialFocusId: this.props.initialFocusId,
|
|
217
215
|
handleValidationErrorsFromApi: this.props.handleValidationErrorsFromApi,
|
|
218
216
|
clearValidationErrorsFromApi: this.props.clearValidationErrorsFromApi,
|
|
219
|
-
haveValidationErrorsFromApi: Boolean(Object.values(this.props.validationErrorsFromApi).length)
|
|
220
|
-
useNewRce: (0, _rceChecker.isNewRCEEnabled)()
|
|
217
|
+
haveValidationErrorsFromApi: Boolean(Object.values(this.props.validationErrorsFromApi).length)
|
|
221
218
|
}, (0, _pick.default)(this.props, ['displayPosition', 'guid', 'draggingOnBuild', 'newHoverPosition', 'quizEntry', 'quizEntries', 'quizId', 'isContentLockedByBlueprint', 'setUi', 'switchOffEditing', 'switchOnEditing', 'shouldClone', 'scrollKey', 'editQuizEntryToggle', 'onEditQuizEntryToggle', 'stimulusOrientation']));
|
|
222
219
|
}
|
|
223
220
|
}, {
|
|
@@ -41,8 +41,6 @@ var _formatMessage = _interopRequireDefault(require("@instructure/quiz-i18n/es/f
|
|
|
41
41
|
|
|
42
42
|
var _quizRce = require("@instructure/quiz-rce");
|
|
43
43
|
|
|
44
|
-
var _rceChecker = require("../../../../util/rceChecker.js");
|
|
45
|
-
|
|
46
44
|
var _theme = _interopRequireDefault(require("./theme.js"));
|
|
47
45
|
|
|
48
46
|
var _dec, _class, _class2, _temp;
|
|
@@ -188,8 +186,7 @@ var SidebarItem = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _
|
|
|
188
186
|
}, this.getPointsText(pointsPossible || 0))), /*#__PURE__*/_react.default.createElement("div", {
|
|
189
187
|
className: styles.itemBody
|
|
190
188
|
}, /*#__PURE__*/_react.default.createElement(_quizRce.RichContentRenderer, {
|
|
191
|
-
content: this.props.itemBody
|
|
192
|
-
useNewRce: (0, _rceChecker.isNewRCEEnabled)()
|
|
189
|
+
content: this.props.itemBody
|
|
193
190
|
})))), /*#__PURE__*/_react.default.createElement(_uiFlex.Flex.Item, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
194
191
|
className: styles.pinWrapper
|
|
195
192
|
}, children))));
|
|
@@ -65,8 +65,7 @@ function mapStateToProps(state, props) {
|
|
|
65
65
|
partialDeepScoringEnabled: (0, _featureCheck.featureOn)('partial_deep_scoring'),
|
|
66
66
|
partialScoringEnabled: (0, _featureCheck.featureOn)('partial_scoring'),
|
|
67
67
|
quizId: (0, _quizzes2.getActiveQuizId)(state),
|
|
68
|
-
showCalculator: (0, _featureCheck.featureOn)('calculator_per_question')
|
|
69
|
-
useNewRce: (0, _featureCheck.featureOn)('use_new_rce')
|
|
68
|
+
showCalculator: (0, _featureCheck.featureOn)('calculator_per_question')
|
|
70
69
|
};
|
|
71
70
|
}
|
|
72
71
|
|
|
@@ -211,7 +211,6 @@ ItemEdit.propTypes = {
|
|
|
211
211
|
setUploadStatus: _propTypes.default.func.isRequired,
|
|
212
212
|
initialFocusId: _propTypes.default.string,
|
|
213
213
|
showCalculator: _propTypes.default.bool,
|
|
214
|
-
useNewRce: _propTypes.default.bool,
|
|
215
214
|
clearValidationErrorsFromApi: _propTypes.default.func.isRequired,
|
|
216
215
|
validationErrorsFromApi: _propTypes.default.objectOf(_propTypes.default.arrayOf(_propTypes.default.shape({
|
|
217
216
|
type: _propTypes.default.string,
|
|
@@ -230,7 +229,6 @@ ItemEdit.defaultProps = {
|
|
|
230
229
|
partialScoringEnabled: false,
|
|
231
230
|
initialFocusId: null,
|
|
232
231
|
showCalculator: false,
|
|
233
|
-
useNewRce: false,
|
|
234
232
|
validationErrorsFromApi: {}
|
|
235
233
|
};
|
|
236
234
|
var _default = ItemEdit;
|
|
@@ -38,8 +38,7 @@ function mapStateToProps(state, props) {
|
|
|
38
38
|
oneQuestionAtATime: (0, _quizzes2.isActiveQuizWorkingInstanceOneQuestionAtATime)(state),
|
|
39
39
|
partialDeepScoringEnabled: (0, _featureCheck.featureOn)('partial_deep_scoring'),
|
|
40
40
|
partialScoringEnabled: (0, _featureCheck.featureOn)('partial_scoring'),
|
|
41
|
-
quizId: (0, _quizzes2.getActiveQuizId)(state)
|
|
42
|
-
useNewRce: (0, _featureCheck.featureOn)('use_new_rce')
|
|
41
|
+
quizId: (0, _quizzes2.getActiveQuizId)(state)
|
|
43
42
|
};
|
|
44
43
|
}
|
|
45
44
|
|
|
@@ -99,14 +99,12 @@ ItemOverride.propTypes = {
|
|
|
99
99
|
partialScoringEnabled: _propTypes.default.bool,
|
|
100
100
|
quizId: _propTypes.default.string.isRequired,
|
|
101
101
|
screenreaderNotification: _propTypes.default.func.isRequired,
|
|
102
|
-
setOneQuestionAtATime: _propTypes.default.func.isRequired
|
|
103
|
-
useNewRce: _propTypes.default.bool
|
|
102
|
+
setOneQuestionAtATime: _propTypes.default.func.isRequired
|
|
104
103
|
};
|
|
105
104
|
ItemOverride.defaultProps = {
|
|
106
105
|
errorsAreShowing: false,
|
|
107
106
|
partialScoringEnabled: false,
|
|
108
|
-
partialDeepScoringEnabled: false
|
|
109
|
-
useNewRce: false
|
|
107
|
+
partialDeepScoringEnabled: false
|
|
110
108
|
};
|
|
111
109
|
var _default = ItemOverride;
|
|
112
110
|
exports.default = _default;
|
|
@@ -25,8 +25,6 @@ var _uiThemeable = require("@instructure/ui-themeable");
|
|
|
25
25
|
|
|
26
26
|
var _quizRce = require("@instructure/quiz-rce");
|
|
27
27
|
|
|
28
|
-
var _rceChecker = require("../../../../util/rceChecker.js");
|
|
29
|
-
|
|
30
28
|
var _makeScrollable = _interopRequireDefault(require("../../../shared/functionality/makeScrollable.js"));
|
|
31
29
|
|
|
32
30
|
var _theme = _interopRequireDefault(require("./theme.js"));
|
|
@@ -63,8 +61,7 @@ var QuizInstructions = (_dec = (0, _uiThemeable.themeable)(_theme.default, style
|
|
|
63
61
|
tabIndex: "-1"
|
|
64
62
|
}, /*#__PURE__*/_react.default.createElement(_quizRce.RichContentRenderer, {
|
|
65
63
|
customStyles: styles.text,
|
|
66
|
-
content: this.props.quiz.instructions
|
|
67
|
-
useNewRce: (0, _rceChecker.isNewRCEEnabled)()
|
|
64
|
+
content: this.props.quiz.instructions
|
|
68
65
|
}));
|
|
69
66
|
}
|
|
70
67
|
}]);
|
|
@@ -27,8 +27,6 @@ var _uiThemeable = require("@instructure/ui-themeable");
|
|
|
27
27
|
|
|
28
28
|
var _quizRce = require("@instructure/quiz-rce");
|
|
29
29
|
|
|
30
|
-
var _rceChecker = require("../../../../util/rceChecker.js");
|
|
31
|
-
|
|
32
30
|
var _formatMessage = _interopRequireDefault(require("@instructure/quiz-i18n/es/format-message"));
|
|
33
31
|
|
|
34
32
|
var _theme = _interopRequireDefault(require("./theme.js"));
|
|
@@ -87,8 +85,7 @@ var ResultStimulus = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles)
|
|
|
87
85
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
88
86
|
className: styles.title
|
|
89
87
|
}, title)), /*#__PURE__*/_react.default.createElement(_quizRce.RichContentRenderer, {
|
|
90
|
-
content: body
|
|
91
|
-
useNewRce: (0, _rceChecker.isNewRCEEnabled)()
|
|
88
|
+
content: body
|
|
92
89
|
}));
|
|
93
90
|
}
|
|
94
91
|
}, {
|
|
@@ -41,8 +41,6 @@ var _uiThemeable = require("@instructure/ui-themeable");
|
|
|
41
41
|
|
|
42
42
|
var _quizRce = require("@instructure/quiz-rce");
|
|
43
43
|
|
|
44
|
-
var _rceChecker = require("../../../../util/rceChecker.js");
|
|
45
|
-
|
|
46
44
|
var _formatMessage = _interopRequireDefault(require("@instructure/quiz-i18n/es/format-message"));
|
|
47
45
|
|
|
48
46
|
var _PositionBox = _interopRequireDefault(require("../../positionBox/PositionBox.js"));
|
|
@@ -224,8 +222,7 @@ var SessionItemResult = (_dec = (0, _uiThemeable.themeable)(_theme.default, styl
|
|
|
224
222
|
className: styles.textPadding
|
|
225
223
|
}, /*#__PURE__*/_react.default.createElement(_quizRce.RichContentRenderer, {
|
|
226
224
|
customStyles: styles.itemFeedbackText,
|
|
227
|
-
content: feedbackContent
|
|
228
|
-
useNewRce: (0, _rceChecker.isNewRCEEnabled)()
|
|
225
|
+
content: feedbackContent
|
|
229
226
|
})));
|
|
230
227
|
}
|
|
231
228
|
}
|
|
@@ -269,8 +266,7 @@ var SessionItemResult = (_dec = (0, _uiThemeable.themeable)(_theme.default, styl
|
|
|
269
266
|
className: styles.itemFeedbackLabel
|
|
270
267
|
}, (0, _formatMessage.default)('Feedback from grader')), /*#__PURE__*/_react.default.createElement(_quizRce.RichContentRenderer, {
|
|
271
268
|
customStyles: styles.itemFeedbackText,
|
|
272
|
-
content: graderFeedback.content
|
|
273
|
-
useNewRce: (0, _rceChecker.isNewRCEEnabled)()
|
|
269
|
+
content: graderFeedback.content
|
|
274
270
|
}));
|
|
275
271
|
} else {
|
|
276
272
|
return this.renderFeedbackBox(graderFeedback.content, (0, _formatMessage.default)('Feedback from grader'));
|
|
@@ -310,8 +306,7 @@ var SessionItemResult = (_dec = (0, _uiThemeable.themeable)(_theme.default, styl
|
|
|
310
306
|
properties: simpleItem.properties || {},
|
|
311
307
|
scoringData: simpleSessionItem.scoringData,
|
|
312
308
|
scoredData: simpleSessionItemResult.scoredData,
|
|
313
|
-
itemResultsModifications: simpleResultsModifications[simpleSessionItem.id]
|
|
314
|
-
useNewRce: (0, _rceChecker.isNewRCEEnabled)()
|
|
309
|
+
itemResultsModifications: simpleResultsModifications[simpleSessionItem.id]
|
|
315
310
|
})), this.renderItemFeedback(simpleSessionItemResult));
|
|
316
311
|
}
|
|
317
312
|
}, {
|
|
@@ -39,8 +39,6 @@ var _index = _interopRequireDefault(require("../../../RichContentInput/index.js"
|
|
|
39
39
|
|
|
40
40
|
var _instUIMessages = require("../../../../util/instUIMessages.js");
|
|
41
41
|
|
|
42
|
-
var _rceChecker = require("../../../../util/rceChecker.js");
|
|
43
|
-
|
|
44
42
|
var _Errors = _interopRequireDefault(require("../../../shared/errors/Errors.js"));
|
|
45
43
|
|
|
46
44
|
var _uiSimpleSelect = require("@instructure/ui-simple-select");
|
|
@@ -210,8 +208,7 @@ var StimulusEditInfo = (_dec = (0, _uiThemeable.themeable)(_theme.default, style
|
|
|
210
208
|
onKeyUp: this.onBodyChange,
|
|
211
209
|
onBlur: this.onBodyChange,
|
|
212
210
|
onChange: this.onBodyChange,
|
|
213
|
-
uploadPath: this.fileUploadUrl()
|
|
214
|
-
useNewRce: (0, _rceChecker.isNewRCEEnabled)()
|
|
211
|
+
uploadPath: this.fileUploadUrl()
|
|
215
212
|
}), /*#__PURE__*/_react.default.createElement(_Errors.default, {
|
|
216
213
|
errorList: this.errorsList('body')
|
|
217
214
|
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -29,8 +29,6 @@ var _uiView = require("@instructure/ui-view");
|
|
|
29
29
|
|
|
30
30
|
var _quizRce = require("@instructure/quiz-rce");
|
|
31
31
|
|
|
32
|
-
var _rceChecker = require("../../../../util/rceChecker.js");
|
|
33
|
-
|
|
34
32
|
var _formatMessage = _interopRequireDefault(require("@instructure/quiz-i18n/es/format-message"));
|
|
35
33
|
|
|
36
34
|
var StimulusShowInfo = /*#__PURE__*/function (_Component) {
|
|
@@ -80,8 +78,7 @@ var StimulusShowInfo = /*#__PURE__*/function (_Component) {
|
|
|
80
78
|
}, this.props.stimulus.title), instructions, /*#__PURE__*/_react.default.createElement("div", {
|
|
81
79
|
"data-automation": "sdk-stimulus-LeftPanelShow-content"
|
|
82
80
|
}, /*#__PURE__*/_react.default.createElement(_quizRce.RichContentRenderer, {
|
|
83
|
-
content: this.props.stimulus.body
|
|
84
|
-
useNewRce: (0, _rceChecker.isNewRCEEnabled)()
|
|
81
|
+
content: this.props.stimulus.body
|
|
85
82
|
})));
|
|
86
83
|
}
|
|
87
84
|
}]);
|
|
@@ -77,39 +77,37 @@ var RceConfigProviderComponent = function RceConfigProviderComponent(props) {
|
|
|
77
77
|
switch (_context.prev = _context.next) {
|
|
78
78
|
case 0:
|
|
79
79
|
if (hasAllPropsForRcs()) {
|
|
80
|
-
_context.next =
|
|
80
|
+
_context.next = 2;
|
|
81
81
|
break;
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
handleErrorFunc('Invalid RCS configuration');
|
|
85
84
|
return _context.abrupt("return");
|
|
86
85
|
|
|
87
|
-
case
|
|
88
|
-
_context.next =
|
|
86
|
+
case 2:
|
|
87
|
+
_context.next = 4;
|
|
89
88
|
return props.rcsJwtRefreshFn(jwt);
|
|
90
89
|
|
|
91
|
-
case
|
|
90
|
+
case 4:
|
|
92
91
|
response = _context.sent;
|
|
93
92
|
refreshedToken = response === null || response === void 0 ? void 0 : (_response$json = response.json) === null || _response$json === void 0 ? void 0 : _response$json.token; // inst-redux-service-middleware response structure
|
|
94
93
|
|
|
95
94
|
if (refreshedToken) {
|
|
96
|
-
_context.next =
|
|
95
|
+
_context.next = 11;
|
|
97
96
|
break;
|
|
98
97
|
}
|
|
99
98
|
|
|
100
|
-
handleErrorFunc('Unable to refresh RCS token');
|
|
101
99
|
normalizedStem = questionStem !== null && questionStem !== void 0 ? questionStem : 'Unknown stem';
|
|
102
100
|
extractedText = (0, _quizInteractions.extractTextFromHtml)(normalizedStem);
|
|
103
|
-
|
|
101
|
+
handleError((0, _formatMessage.default)('Error while answering "{stem}": Full functionality of the Rich Content Editor may not have been available to the user.', {
|
|
104
102
|
stem: extractedText
|
|
105
103
|
}));
|
|
106
104
|
return _context.abrupt("return");
|
|
107
105
|
|
|
108
|
-
case
|
|
106
|
+
case 11:
|
|
109
107
|
setJwt(refreshedToken);
|
|
110
108
|
setTokenFn(refreshedToken);
|
|
111
109
|
|
|
112
|
-
case
|
|
110
|
+
case 13:
|
|
113
111
|
case "end":
|
|
114
112
|
return _context.stop();
|
|
115
113
|
}
|
|
@@ -122,26 +120,44 @@ var RceConfigProviderComponent = function RceConfigProviderComponent(props) {
|
|
|
122
120
|
};
|
|
123
121
|
}();
|
|
124
122
|
|
|
125
|
-
var
|
|
126
|
-
|
|
123
|
+
var handleError = function handleError(quizLogMessage) {
|
|
124
|
+
if (shouldAlertUser()) {
|
|
125
|
+
alertTheUser(alertMessage());
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
if (shouldsetEventToQuizLog()) {
|
|
129
|
+
setEventToQuizLog(quizLogMessage);
|
|
130
|
+
}
|
|
127
131
|
};
|
|
128
132
|
|
|
129
|
-
var
|
|
130
|
-
|
|
133
|
+
var alertTheUser = function alertTheUser(message) {
|
|
134
|
+
_reduxStore.default.dispatch((0, _alerts.addError)(message));
|
|
135
|
+
};
|
|
131
136
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
rendererEnhancement: (_rendererEnhancement = {}, (0, _defineProperty2.default)(_rendererEnhancement, _quizCommon.RceConfigKeys.handleError, handleErrorFunc), (0, _defineProperty2.default)(_rendererEnhancement, _quizCommon.RceConfigKeys.canvasOrigin, props.canvasOrigin), _rendererEnhancement),
|
|
135
|
-
featureFlags: (_featureFlags = {}, (0, _defineProperty2.default)(_featureFlags, _quizCommon.RceConfigKeys.isNewRCEAppsEnabled, props.isNewRCEAppsEnabled), (0, _defineProperty2.default)(_featureFlags, _quizCommon.RceConfigKeys.rce5Renderer, props.rce5Renderer), _featureFlags)
|
|
136
|
-
};
|
|
137
|
+
var setEventToQuizLog = function setEventToQuizLog(message) {
|
|
138
|
+
props.setEventToQuizLog(message);
|
|
137
139
|
};
|
|
138
140
|
|
|
139
|
-
var
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
141
|
+
var alertMessage = function alertMessage() {
|
|
142
|
+
return (0, _windowChecks.isQuizTaking)() ? (0, _formatMessage.default)('The Rich Content Editor has encountered an issue. ' + 'It has been logged for your instructor to review. Please refresh and try again.') : (0, _formatMessage.default)('The Rich Content Editor has encountered an issue. Please refresh and try again.');
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
var shouldAlertUser = function shouldAlertUser() {
|
|
146
|
+
return (0, _windowChecks.isQuizTaking)() || (0, _windowChecks.isQuizBuilding)();
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
var shouldsetEventToQuizLog = function shouldsetEventToQuizLog() {
|
|
150
|
+
return (0, _windowChecks.isQuizTaking)();
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
var getConfig = function getConfig() {
|
|
154
|
+
var _featureFlags, _ref2;
|
|
143
155
|
|
|
144
|
-
|
|
156
|
+
return {
|
|
157
|
+
featureFlags: (_featureFlags = {}, (0, _defineProperty2.default)(_featureFlags, _quizCommon.RceConfigKeys.isNewRCEEnabled, props.isNewRCEEnabled), (0, _defineProperty2.default)(_featureFlags, _quizCommon.RceConfigKeys.rce5Renderer, props.rce5Renderer), (0, _defineProperty2.default)(_featureFlags, _quizCommon.RceConfigKeys.isNewRCEAppsEnabled, props.isNewRCEAppsEnabled), _featureFlags),
|
|
158
|
+
rcs: hasAllPropsForRcs() && canvasConfig ? (_ref2 = {}, (0, _defineProperty2.default)(_ref2, _quizCommon.RceConfigKeys.canvasUserId, props.canvasUserId), (0, _defineProperty2.default)(_ref2, _quizCommon.RceConfigKeys.contextId, props.contextId), (0, _defineProperty2.default)(_ref2, _quizCommon.RceConfigKeys.contextType, props.contextType), (0, _defineProperty2.default)(_ref2, _quizCommon.RceConfigKeys.rcsHost, props.rcsHost), (0, _defineProperty2.default)(_ref2, _quizCommon.RceConfigKeys.rcsJwt, jwt), (0, _defineProperty2.default)(_ref2, _quizCommon.RceConfigKeys.rcsJwtRefreshFn, refreshToken), (0, _defineProperty2.default)(_ref2, _quizCommon.RceConfigKeys.canvasConfig, canvasConfig), _ref2) : null,
|
|
159
|
+
rendererEnhancement: (0, _defineProperty2.default)({}, _quizCommon.RceConfigKeys.canvasOrigin, props.canvasOrigin)
|
|
160
|
+
};
|
|
145
161
|
};
|
|
146
162
|
|
|
147
163
|
(0, _react.useEffect)(function () {
|
|
@@ -151,7 +167,7 @@ var RceConfigProviderComponent = function RceConfigProviderComponent(props) {
|
|
|
151
167
|
while (1) {
|
|
152
168
|
switch (_context2.prev = _context2.next) {
|
|
153
169
|
case 0:
|
|
154
|
-
if (!(!props.
|
|
170
|
+
if (!(!props.isNewRCEEnabled && !props.rce5Renderer)) {
|
|
155
171
|
_context2.next = 2;
|
|
156
172
|
break;
|
|
157
173
|
}
|
|
@@ -166,7 +182,7 @@ var RceConfigProviderComponent = function RceConfigProviderComponent(props) {
|
|
|
166
182
|
break;
|
|
167
183
|
}
|
|
168
184
|
|
|
169
|
-
|
|
185
|
+
handleError((0, _formatMessage.default)('Error: Full functionality of the Rich Content Editor may not have been available to the user.'));
|
|
170
186
|
return _context2.abrupt("return");
|
|
171
187
|
|
|
172
188
|
case 6:
|
|
@@ -190,7 +206,7 @@ var RceConfigProviderComponent = function RceConfigProviderComponent(props) {
|
|
|
190
206
|
case 16:
|
|
191
207
|
json = _context2.sent;
|
|
192
208
|
setCanvasConfig(json);
|
|
193
|
-
|
|
209
|
+
setEventToQuizLog(null);
|
|
194
210
|
_context2.next = 25;
|
|
195
211
|
break;
|
|
196
212
|
|
|
@@ -198,7 +214,7 @@ var RceConfigProviderComponent = function RceConfigProviderComponent(props) {
|
|
|
198
214
|
_context2.prev = 21;
|
|
199
215
|
_context2.t0 = _context2["catch"](2);
|
|
200
216
|
setCanvasConfig(null);
|
|
201
|
-
|
|
217
|
+
handleError((0, _formatMessage.default)('Error: Full functionality of the Rich Content Editor including accessibility features may not have been available to the user.'));
|
|
202
218
|
|
|
203
219
|
case 25:
|
|
204
220
|
_context2.prev = 25;
|
|
@@ -212,10 +228,10 @@ var RceConfigProviderComponent = function RceConfigProviderComponent(props) {
|
|
|
212
228
|
}
|
|
213
229
|
}, _callee2, null, [[2, 21, 25, 28]]);
|
|
214
230
|
}))();
|
|
215
|
-
}, [props.
|
|
231
|
+
}, [props.isNewRCEEnabled, props.rce5Renderer]);
|
|
216
232
|
|
|
217
233
|
if (props.loadedApiFeatures) {
|
|
218
|
-
if (props.
|
|
234
|
+
if (props.isNewRCEEnabled || props.rce5Renderer) {
|
|
219
235
|
if (!canvasConfigLoading) {
|
|
220
236
|
return /*#__PURE__*/_react.default.createElement(_quizCommon.RceConfigContext.Provider, {
|
|
221
237
|
value: getConfig()
|
|
@@ -232,10 +248,10 @@ var RceConfigProviderComponent = function RceConfigProviderComponent(props) {
|
|
|
232
248
|
exports.RceConfigProviderComponent = RceConfigProviderComponent;
|
|
233
249
|
RceConfigProviderComponent.propTypes = {
|
|
234
250
|
children: _propTypes.default.node.isRequired,
|
|
235
|
-
|
|
251
|
+
isNewRCEEnabled: _propTypes.default.bool.isRequired,
|
|
236
252
|
rce5Renderer: _propTypes.default.bool.isRequired,
|
|
237
253
|
isNewRCEAppsEnabled: _propTypes.default.bool,
|
|
238
|
-
|
|
254
|
+
setEventToQuizLog: _propTypes.default.func.isRequired,
|
|
239
255
|
contextId: _propTypes.default.string,
|
|
240
256
|
contextType: _propTypes.default.string,
|
|
241
257
|
canvasUserId: _propTypes.default.string,
|
|
@@ -259,7 +275,7 @@ RceConfigProviderComponent.defaultProps = {
|
|
|
259
275
|
|
|
260
276
|
var mapStateToProps = function mapStateToProps(state, ownProps) {
|
|
261
277
|
return {
|
|
262
|
-
|
|
278
|
+
isNewRCEEnabled: (0, _rceChecker.isNewRCEEnabled)(),
|
|
263
279
|
rce5Renderer: (0, _rceChecker.isRCE5RendererEnabled)(),
|
|
264
280
|
isNewRCEAppsEnabled: (0, _rceChecker.isNewRCEAppsEnabled)(),
|
|
265
281
|
loadedApiFeatures: state.getIn(['ui', 'loadedApiFeatures']) || ownProps.loadedApiFeatures
|
|
@@ -267,7 +283,7 @@ var mapStateToProps = function mapStateToProps(state, ownProps) {
|
|
|
267
283
|
};
|
|
268
284
|
|
|
269
285
|
var mapDispatchToProps = {
|
|
270
|
-
|
|
286
|
+
setEventToQuizLog: _rce.setRCEError
|
|
271
287
|
};
|
|
272
288
|
var RceConfigProvider = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(RceConfigProviderComponent);
|
|
273
289
|
exports.RceConfigProvider = RceConfigProvider;
|
|
@@ -11,8 +11,6 @@ var _index = _interopRequireDefault(require("../components/RichContentInput/inde
|
|
|
11
11
|
|
|
12
12
|
var _formatMessage = _interopRequireDefault(require("@instructure/quiz-i18n/es/format-message"));
|
|
13
13
|
|
|
14
|
-
var _rceChecker = require("../../common/util/rceChecker.js");
|
|
15
|
-
|
|
16
14
|
var propsForInteractionEdit = function propsForInteractionEdit(props, additionalOptions) {
|
|
17
15
|
var item = props.workingItem.toJS();
|
|
18
16
|
|
|
@@ -81,8 +79,7 @@ var propsForInteractionEdit = function propsForInteractionEdit(props, additional
|
|
|
81
79
|
setOneQuestionAtATime: setOneQuestionAtATime,
|
|
82
80
|
stemErrors: props.workingItem.errorsFor('itemBody').toJS(),
|
|
83
81
|
initialFocusId: props.initialFocusId,
|
|
84
|
-
calculatorType: item.calculatorType
|
|
85
|
-
useNewRce: props.useNewRce
|
|
82
|
+
calculatorType: item.calculatorType
|
|
86
83
|
};
|
|
87
84
|
};
|
|
88
85
|
|
|
@@ -98,8 +95,7 @@ var propsForInteractionShow = function propsForInteractionShow(item) {
|
|
|
98
95
|
itemBody: item.itemBody || '',
|
|
99
96
|
properties: item.properties,
|
|
100
97
|
notifyScreenreader: true,
|
|
101
|
-
scoringData: item.scoringData
|
|
102
|
-
useNewRce: (0, _rceChecker.isNewRCEEnabled)()
|
|
98
|
+
scoringData: item.scoringData
|
|
103
99
|
};
|
|
104
100
|
};
|
|
105
101
|
|
|
@@ -11,7 +11,7 @@ exports.default = void 0;
|
|
|
11
11
|
var _featureCheck = require("./featureCheck.js");
|
|
12
12
|
|
|
13
13
|
var newRCEFeatureName = 'use_new_rce';
|
|
14
|
-
var newRCEAppsFeatureName = '
|
|
14
|
+
var newRCEAppsFeatureName = 'rce5_apps';
|
|
15
15
|
var rce5RendererFeatureName = 'rce5_renderer';
|
|
16
16
|
|
|
17
17
|
function isNewRCEEnabled() {
|
|
@@ -3,7 +3,10 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.isQuizBuilding = exports.isQuizTaking = exports.onTablet = exports.onPhone = exports.media = void 0;
|
|
7
|
+
|
|
8
|
+
var _quizCommon = require("@instructure/quiz-common");
|
|
9
|
+
|
|
7
10
|
var media = {
|
|
8
11
|
'phone-break-point': 'only screen and (max-width: 48rem)',
|
|
9
12
|
'tablet-break-point': 'only screen and (max-width: 64rem)'
|
|
@@ -26,11 +29,14 @@ var onTablet = function onTablet() {
|
|
|
26
29
|
|
|
27
30
|
exports.onTablet = onTablet;
|
|
28
31
|
|
|
29
|
-
var
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
var isQuizTaking = function isQuizTaking() {
|
|
33
|
+
return (0, _quizCommon.isDuringQuizTake)();
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
exports.isQuizTaking = isQuizTaking;
|
|
37
|
+
|
|
38
|
+
var isQuizBuilding = function isQuizBuilding() {
|
|
39
|
+
return (0, _quizCommon.isDuringQuizBuild)();
|
|
34
40
|
};
|
|
35
41
|
|
|
36
|
-
exports.
|
|
42
|
+
exports.isQuizBuilding = isQuizBuilding;
|
|
@@ -41,7 +41,8 @@ var postQuizSessionResults = function postQuizSessionResults(sessionId, sessionI
|
|
|
41
41
|
var fetcher = new _Fetcher.default();
|
|
42
42
|
return fetcher.post(url, params).then(function (quizSessionResult) {
|
|
43
43
|
return dispatch([(0, _postMessage.postToParent)({
|
|
44
|
-
subject: _quizCommon.SUBMISSION_UPDATE_SUBJECT
|
|
44
|
+
subject: _quizCommon.SUBMISSION_UPDATE_SUBJECT,
|
|
45
|
+
percentage: quizSessionResult.percentage
|
|
45
46
|
}), (0, _callHandlers.handleQuizSessionResultsResponse)([quizSessionResult]), fetchQuizSessionCb(sessionId)]);
|
|
46
47
|
});
|
|
47
48
|
};
|
|
@@ -35,8 +35,6 @@ var _uiThemeable = require("@instructure/ui-themeable");
|
|
|
35
35
|
|
|
36
36
|
var _quizRce = require("@instructure/quiz-rce");
|
|
37
37
|
|
|
38
|
-
var _rceChecker = require("../../../../common/util/rceChecker.js");
|
|
39
|
-
|
|
40
38
|
var _index = _interopRequireDefault(require("../../../../common/components/shared/Card/index.js"));
|
|
41
39
|
|
|
42
40
|
var _index2 = _interopRequireDefault(require("../../../../common/components/shared/ExpandButton/index.js"));
|
|
@@ -162,8 +160,7 @@ var ItemAnalysisRow = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles
|
|
|
162
160
|
value: function renderStem() {
|
|
163
161
|
return /*#__PURE__*/_react.default.createElement(_quizRce.RichContentRenderer, {
|
|
164
162
|
customStyles: styles.stem,
|
|
165
|
-
content: this.props.itemAnalysis.itemBody
|
|
166
|
-
useNewRce: (0, _rceChecker.isNewRCEEnabled)()
|
|
163
|
+
content: this.props.itemAnalysis.itemBody
|
|
167
164
|
});
|
|
168
165
|
}
|
|
169
166
|
}, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/quiz-core",
|
|
3
|
-
"version": "17.46.2-rc.
|
|
3
|
+
"version": "17.46.2-rc.10+a1445c66f",
|
|
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.46.2-rc.
|
|
45
|
-
"@instructure/quiz-i18n": "17.46.2-rc.
|
|
46
|
-
"@instructure/quiz-interactions": "17.46.2-rc.
|
|
47
|
-
"@instructure/quiz-number-input": "17.46.2-rc.
|
|
48
|
-
"@instructure/quiz-rce": "17.46.2-rc.
|
|
44
|
+
"@instructure/quiz-common": "17.46.2-rc.10+a1445c66f",
|
|
45
|
+
"@instructure/quiz-i18n": "17.46.2-rc.10+a1445c66f",
|
|
46
|
+
"@instructure/quiz-interactions": "17.46.2-rc.10+a1445c66f",
|
|
47
|
+
"@instructure/quiz-number-input": "17.46.2-rc.10+a1445c66f",
|
|
48
|
+
"@instructure/quiz-rce": "17.46.2-rc.10+a1445c66f",
|
|
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.46.2-rc.
|
|
109
|
+
"instructure-validations": "17.46.2-rc.10+a1445c66f",
|
|
110
110
|
"ipaddr.js": "^1.5.4",
|
|
111
111
|
"isomorphic-fetch": "^2.2.0",
|
|
112
112
|
"isuuid": "^0.1.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.46.2-rc.
|
|
159
|
+
"quiz-presets": "17.46.2-rc.10+a1445c66f",
|
|
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": "a1445c66fb7fe3272e7c88c127f546eea1c45347"
|
|
176
176
|
}
|