@instructure/quiz-core 22.3.2-rc.8 → 22.4.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/quizzes.js +1 -6
- package/es/building/components/resources/quiz/title/Edit/index.js +61 -68
- package/es/building/components/resources/quiz/title/Edit/styles.js +38 -0
- package/es/building/components/resources/quiz/title/Edit/theme.js +17 -0
- package/es/common/actions/modifications.js +0 -11
- package/es/common/components/resources/item/ItemEdit/index.js +3 -5
- package/es/common/components/resources/item/ItemEdit/presenter.js +2 -4
- package/es/common/components/shared/errors/Errors.js +69 -0
- package/es/common/components/shared/errors/styles.js +16 -0
- package/es/common/components/shared/errors/theme.js +10 -0
- package/es/common/records/Quiz.js +0 -1
- package/es/common/util/interactionTypePropsHelper.js +1 -2
- package/es/index.js +2 -1
- package/lib/building/api/quizzes.js +0 -6
- package/lib/building/components/resources/quiz/title/Edit/index.js +60 -69
- package/lib/building/components/resources/quiz/title/Edit/styles.js +45 -0
- package/lib/building/components/resources/quiz/title/Edit/theme.js +23 -0
- package/lib/common/actions/modifications.js +0 -12
- package/lib/common/components/resources/item/ItemEdit/index.js +3 -5
- package/lib/common/components/resources/item/ItemEdit/presenter.js +2 -4
- package/lib/common/components/shared/errors/Errors.js +76 -0
- package/lib/common/components/shared/errors/styles.js +22 -0
- package/lib/common/components/shared/errors/theme.js +16 -0
- package/lib/common/records/Quiz.js +0 -1
- package/lib/common/util/interactionTypePropsHelper.js +1 -2
- package/lib/index.js +8 -7
- package/package.json +33 -34
|
@@ -3,7 +3,7 @@ import { noop } from 'lodash';
|
|
|
3
3
|
import { DO_NOTHING, NEW_QUIZ_ID, QUIZ_SAVE_CALL, PARENT_TYPE_BANK, PARENT_TYPE_QUIZ, PARENT_TYPE_QUIZ_SESSION } from '@instructure/quiz-common';
|
|
4
4
|
import Fetcher from '../../common/util/Fetcher';
|
|
5
5
|
import { getQTIInfo } from './qtiImports';
|
|
6
|
-
import { changeQuizAllowBacktracking, changeQuizAllowClearMCSelection, changeQuizChoiceElimination, changeQuizHasTimeLimit, changeQuizOneAtATimeType, changeQuizDefaultRceSettings, changeQuizShuffleQuestions, changeQuizShuffleAnswers, changeQuizRequireStudentAccessCode, changeQuizStudentAccessCode, changeSessionTimeLimitInSeconds, changeQuizFilterIpAddress, changeQuizIpFilters, changeQuizCalculatorType, changeResultsFeedback, changeResultsFeedbackEnabled
|
|
6
|
+
import { changeQuizAllowBacktracking, changeQuizAllowClearMCSelection, changeQuizChoiceElimination, changeQuizHasTimeLimit, changeQuizOneAtATimeType, changeQuizDefaultRceSettings, changeQuizShuffleQuestions, changeQuizShuffleAnswers, changeQuizRequireStudentAccessCode, changeQuizStudentAccessCode, changeSessionTimeLimitInSeconds, changeQuizFilterIpAddress, changeQuizIpFilters, changeQuizCalculatorType, changeResultsFeedback, changeResultsFeedbackEnabled } from '../../common/actions/modifications';
|
|
7
7
|
import { handleQuizResponse } from '../../common/api/callHandlers';
|
|
8
8
|
import { getUploadUrl, sendFileToS3 } from '../../common/api/fileUpload';
|
|
9
9
|
import { interactionTypeFetch } from '../../common/api/interactionTypes';
|
|
@@ -190,11 +190,6 @@ export function setQuizShuffleAnswers(quizId, value, completeCb) {
|
|
|
190
190
|
shuffle_answers: Boolean(value)
|
|
191
191
|
}, changeQuizShuffleAnswers(quizId, value), completeCb);
|
|
192
192
|
}
|
|
193
|
-
export function setQuizDisableDocumentAccess(quizId, value, completeCb) {
|
|
194
|
-
return setQuizProperty(quizId, {
|
|
195
|
-
disable_document_access: Boolean(value)
|
|
196
|
-
}, changeQuizDisableDocumentAccess(quizId, value), completeCb);
|
|
197
|
-
}
|
|
198
193
|
export function setRequireStudentAccessCode(quizId, value, completeCb) {
|
|
199
194
|
return setQuizProperty(quizId, {
|
|
200
195
|
require_student_access_code: Boolean(value)
|
|
@@ -4,7 +4,7 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConst
|
|
|
4
4
|
import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
|
|
5
5
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
6
6
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
7
|
-
var _TitleEdit;
|
|
7
|
+
var _dec, _class, _TitleEdit;
|
|
8
8
|
function _callSuper(_this, derived, args) {
|
|
9
9
|
function isNativeReflectConstruct() {
|
|
10
10
|
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
@@ -20,14 +20,17 @@ function _callSuper(_this, derived, args) {
|
|
|
20
20
|
return _possibleConstructorReturn(_this, isNativeReflectConstruct() ? Reflect.construct(derived, args || [], _getPrototypeOf(_this).constructor) : derived.apply(_this, args));
|
|
21
21
|
}
|
|
22
22
|
/** @jsx jsx */
|
|
23
|
-
import
|
|
23
|
+
import { Component } from 'react';
|
|
24
24
|
import PropTypes from 'prop-types';
|
|
25
25
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
|
26
|
+
import ReactDOM from 'react-dom';
|
|
26
27
|
import defer from 'lodash/defer';
|
|
27
28
|
import { jsx } from '@instructure/emotion';
|
|
29
|
+
import generateStyle from './styles';
|
|
30
|
+
import generateComponentTheme from './theme';
|
|
31
|
+
import Errors from '../../../../../../common/components/shared/errors/Errors';
|
|
28
32
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
29
|
-
import {
|
|
30
|
-
import { ScreenReaderContent } from '@instructure/ui-a11y-content';
|
|
33
|
+
import { withStyleOverrides } from '@instructure/quiz-common';
|
|
31
34
|
|
|
32
35
|
// =================================
|
|
33
36
|
|
|
@@ -37,23 +40,19 @@ import { ScreenReaderContent } from '@instructure/ui-a11y-content';
|
|
|
37
40
|
|
|
38
41
|
// =================================
|
|
39
42
|
|
|
40
|
-
export var TitleEdit = /*#__PURE__*/function (_Component) {
|
|
41
|
-
function TitleEdit(
|
|
43
|
+
export var TitleEdit = (_dec = withStyleOverrides(generateStyle, generateComponentTheme), _dec(_class = (_TitleEdit = /*#__PURE__*/function (_Component) {
|
|
44
|
+
function TitleEdit() {
|
|
42
45
|
var _this2;
|
|
43
46
|
_classCallCheck(this, TitleEdit);
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
_defineProperty(_this2, "inputRef", null);
|
|
47
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
48
|
+
args[_key] = arguments[_key];
|
|
49
|
+
}
|
|
50
|
+
_this2 = _callSuper(this, TitleEdit, [].concat(args));
|
|
49
51
|
_defineProperty(_this2, "defer", function (fn) {
|
|
50
|
-
// to enable
|
|
52
|
+
// to enable syncronous testing
|
|
51
53
|
var deferFn = _this2.props.deferMock || defer;
|
|
52
54
|
deferFn(fn);
|
|
53
55
|
});
|
|
54
|
-
_defineProperty(_this2, "setInputRef", function (node) {
|
|
55
|
-
_this2.inputRef.current = node;
|
|
56
|
-
});
|
|
57
56
|
_defineProperty(_this2, "switchOffEditing", function () {
|
|
58
57
|
var fromEnterPressed = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
59
58
|
_this2.ifValidElseError(function () {
|
|
@@ -82,21 +81,26 @@ export var TitleEdit = /*#__PURE__*/function (_Component) {
|
|
|
82
81
|
_defineProperty(_this2, "handleBlur", function (e) {
|
|
83
82
|
_this2.switchOffEditing(false);
|
|
84
83
|
});
|
|
85
|
-
_this2.inputRef = React.createRef();
|
|
86
84
|
return _this2;
|
|
87
85
|
}
|
|
88
86
|
_inherits(TitleEdit, _Component);
|
|
89
87
|
return _createClass(TitleEdit, [{
|
|
90
88
|
key: "componentDidMount",
|
|
91
|
-
value:
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
89
|
+
value:
|
|
90
|
+
// todo: extract this into a shared method
|
|
91
|
+
// to be used on many components
|
|
92
|
+
function componentDidMount() {
|
|
93
|
+
this.props.makeStyles();
|
|
94
|
+
var input = ReactDOM.findDOMNode(this.input);
|
|
95
|
+
// some browsers add chars so * 2 to ensure at end
|
|
96
|
+
var valLength = input.value.length * 2;
|
|
97
|
+
input.focus();
|
|
98
|
+
input.setSelectionRange(valLength, valLength);
|
|
99
|
+
}
|
|
100
|
+
}, {
|
|
101
|
+
key: "componentDidUpdate",
|
|
102
|
+
value: function componentDidUpdate() {
|
|
103
|
+
this.props.makeStyles();
|
|
100
104
|
}
|
|
101
105
|
}, {
|
|
102
106
|
key: "ifValidElseError",
|
|
@@ -117,57 +121,46 @@ export var TitleEdit = /*#__PURE__*/function (_Component) {
|
|
|
117
121
|
};
|
|
118
122
|
}
|
|
119
123
|
}, {
|
|
120
|
-
key: "
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
124
|
+
key: "hasErrors",
|
|
125
|
+
value: function hasErrors() {
|
|
126
|
+
return this.props.errorsAreShowing && this.props.errors.size > 0;
|
|
127
|
+
}
|
|
128
|
+
}, {
|
|
129
|
+
key: "renderErrors",
|
|
130
|
+
value: function renderErrors() {
|
|
131
|
+
if (this.hasErrors()) {
|
|
132
|
+
return jsx("div", {
|
|
133
|
+
css: this.props.styles.errorsWrapper
|
|
134
|
+
}, jsx(Errors, {
|
|
135
|
+
errorList: this.props.errors
|
|
136
|
+
}));
|
|
126
137
|
}
|
|
127
|
-
var errorList = (_this$props$errors = this.props.errors) === null || _this$props$errors === void 0 || (_this$props$errors = _this$props$errors.toArray()) === null || _this$props$errors === void 0 ? void 0 : _this$props$errors.map(function (error) {
|
|
128
|
-
if (typeof error === 'object') {
|
|
129
|
-
return error;
|
|
130
|
-
}
|
|
131
|
-
return {
|
|
132
|
-
text: error,
|
|
133
|
-
type: 'newError'
|
|
134
|
-
};
|
|
135
|
-
});
|
|
136
|
-
return errorList || [];
|
|
137
138
|
}
|
|
138
139
|
}, {
|
|
139
140
|
key: "render",
|
|
140
141
|
value: function render() {
|
|
141
|
-
return jsx(
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
142
|
+
return jsx("div", {
|
|
143
|
+
ref: this.setRef('wrapper'),
|
|
144
|
+
css: this.props.styles.titleEditWrapper,
|
|
145
|
+
onBlur: this.handleBlur,
|
|
145
146
|
"data-automation": "sdk-quiz-title-edit-wrapper"
|
|
146
|
-
}, jsx(
|
|
147
|
-
|
|
148
|
-
|
|
147
|
+
}, jsx("div", {
|
|
148
|
+
css: this.props.styles.inputWrapper
|
|
149
|
+
}, jsx("input", {
|
|
150
|
+
ref: this.setRef('input'),
|
|
151
|
+
type: "text",
|
|
152
|
+
"aria-label": t('title'),
|
|
149
153
|
placeholder: t('Add a Title...'),
|
|
150
|
-
|
|
154
|
+
value: this.props.value,
|
|
151
155
|
onKeyDown: this.handleKeyDown,
|
|
152
156
|
onKeyUp: this.handleKeyUp,
|
|
153
157
|
onChange: this.props.onInputChange,
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
themeOverride: {
|
|
158
|
-
padding: 0,
|
|
159
|
-
borderColor: 'transparent',
|
|
160
|
-
mediumFontSize: '1.75rem',
|
|
161
|
-
fontWeight: '400'
|
|
162
|
-
}
|
|
163
|
-
})));
|
|
158
|
+
css: this.props.styles.titleEditInput,
|
|
159
|
+
"data-automation": "sdk-quiz-title-edit"
|
|
160
|
+
})), this.renderErrors());
|
|
164
161
|
}
|
|
165
162
|
}]);
|
|
166
|
-
}(Component)
|
|
167
|
-
_TitleEdit = TitleEdit;
|
|
168
|
-
_defineProperty(TitleEdit, "displayName", 'TitleEdit');
|
|
169
|
-
_defineProperty(TitleEdit, "componentId", "Quizzes".concat(_TitleEdit.displayName));
|
|
170
|
-
_defineProperty(TitleEdit, "propTypes", {
|
|
163
|
+
}(Component), _defineProperty(_TitleEdit, "displayName", 'TitleEdit'), _defineProperty(_TitleEdit, "componentId", "Quizzes".concat(_TitleEdit.displayName)), _defineProperty(_TitleEdit, "propTypes", {
|
|
171
164
|
value: PropTypes.string.isRequired,
|
|
172
165
|
isValid: PropTypes.bool.isRequired,
|
|
173
166
|
showError: PropTypes.func.isRequired,
|
|
@@ -177,10 +170,10 @@ _defineProperty(TitleEdit, "propTypes", {
|
|
|
177
170
|
onInputChange: PropTypes.func.isRequired,
|
|
178
171
|
saveAndPreview: PropTypes.func.isRequired,
|
|
179
172
|
deferMock: PropTypes.func,
|
|
180
|
-
styles: PropTypes.object
|
|
181
|
-
|
|
182
|
-
_defineProperty(
|
|
173
|
+
styles: PropTypes.object,
|
|
174
|
+
makeStyles: PropTypes.func
|
|
175
|
+
}), _defineProperty(_TitleEdit, "defaultProps", {
|
|
183
176
|
errorsAreShowing: false,
|
|
184
177
|
deferMock: defer
|
|
185
|
-
});
|
|
178
|
+
}), _TitleEdit)) || _class);
|
|
186
179
|
export default TitleEdit;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
4
|
+
var generateStyle = function generateStyle(componentTheme, props) {
|
|
5
|
+
var wrapperStyles = {
|
|
6
|
+
width: '100%',
|
|
7
|
+
flex: '1 1 auto',
|
|
8
|
+
display: 'flex',
|
|
9
|
+
flexDirection: 'column',
|
|
10
|
+
justifyContent: 'center'
|
|
11
|
+
};
|
|
12
|
+
var errorBorderStyles = {
|
|
13
|
+
margin: componentTheme.errorBorderMargin,
|
|
14
|
+
padding: componentTheme.errorBorderPadding,
|
|
15
|
+
border: "solid 1px ".concat(componentTheme.errorBorderColor),
|
|
16
|
+
borderRadius: componentTheme.errorBorderBorderRadius
|
|
17
|
+
};
|
|
18
|
+
return {
|
|
19
|
+
titleEditWrapper: {
|
|
20
|
+
position: 'relative',
|
|
21
|
+
width: '100%',
|
|
22
|
+
height: '5rem',
|
|
23
|
+
boxSizing: 'border-box',
|
|
24
|
+
paddingLeft: componentTheme.titleEditWrapperLeftPadding,
|
|
25
|
+
paddingRight: componentTheme.titleEditWrapperRightPadding,
|
|
26
|
+
display: 'flex',
|
|
27
|
+
flexDirection: 'column',
|
|
28
|
+
justifyContent: 'center'
|
|
29
|
+
},
|
|
30
|
+
titleEditInput: _objectSpread({
|
|
31
|
+
fontFamily: componentTheme.titleEditInputFontFamily,
|
|
32
|
+
fontSize: componentTheme.titleEditInputFontSize
|
|
33
|
+
}, props.errorsAreShowing && props.errors.size > 0 && errorBorderStyles),
|
|
34
|
+
inputWrapper: wrapperStyles,
|
|
35
|
+
errorsWrapper: wrapperStyles
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
export default generateStyle;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
2
|
+
var spacing = _ref.spacing,
|
|
3
|
+
colors = _ref.colors,
|
|
4
|
+
typography = _ref.typography,
|
|
5
|
+
borders = _ref.borders;
|
|
6
|
+
return {
|
|
7
|
+
titleEditWrapperLeftPadding: spacing.large,
|
|
8
|
+
titleEditWrapperRightPadding: spacing.large,
|
|
9
|
+
titleEditInputFontFamily: typography.fontFamily,
|
|
10
|
+
titleEditInputFontSize: typography.fontSizeXLarge,
|
|
11
|
+
errorBorderMargin: spacing.xxSmall,
|
|
12
|
+
errorBorderPadding: spacing.xxSmall,
|
|
13
|
+
errorBorderColor: colors.contrasts.red4570,
|
|
14
|
+
errorBorderBorderRadius: borders.radiusSmall
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export default generateComponentTheme;
|
|
@@ -99,17 +99,6 @@ export function changeQuizShuffleAnswers(quizId, value) {
|
|
|
99
99
|
}
|
|
100
100
|
};
|
|
101
101
|
}
|
|
102
|
-
export function changeQuizDisableDocumentAccess(quizId, value) {
|
|
103
|
-
return {
|
|
104
|
-
type: QUIZ_MODIFICATION,
|
|
105
|
-
payload: {
|
|
106
|
-
id: quizId,
|
|
107
|
-
modifications: {
|
|
108
|
-
disableDocumentAccess: Boolean(value)
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
102
|
export function changeQuizRequireStudentAccessCode(quizId, value) {
|
|
114
103
|
return {
|
|
115
104
|
type: QUIZ_MODIFICATION,
|
|
@@ -5,7 +5,7 @@ import ItemEdit from './presenter';
|
|
|
5
5
|
import makeEditable from '../../../shared/functionality/makeEditable';
|
|
6
6
|
import { openModal } from '../../../../actions/modal';
|
|
7
7
|
import { occludeQuizEntries } from '../../../../actions/ui';
|
|
8
|
-
import { generateImportModalId } from '
|
|
8
|
+
import { generateImportModalId } from '../../../../../common/components/ImportModal';
|
|
9
9
|
import { showError, hideError } from '../../../../actions/errorsShowing';
|
|
10
10
|
import { uploadStatus as setUploadStatus } from '../../../../actions/upload';
|
|
11
11
|
import * as modificationActions from '../../../../actions/modifications';
|
|
@@ -13,9 +13,8 @@ import { addError, screenreaderNotification } from '../../../../actions/alerts';
|
|
|
13
13
|
import { updateItem } from '../../../../../building/api/items';
|
|
14
14
|
import { interactionFileUpload, setOneAtATimeType } from '../../../../../building/api/quizzes';
|
|
15
15
|
import { featureOn } from '../../../../util/featureCheck';
|
|
16
|
-
import { getActiveQuizId, isActiveQuizWorkingInstanceOneQuestionAtATime } from '
|
|
16
|
+
import { getActiveQuizId, isActiveQuizWorkingInstanceOneQuestionAtATime } from '../../../../../common/selectors/quizzes';
|
|
17
17
|
export function mapStateToProps(state, props) {
|
|
18
|
-
var _props$showCalculator;
|
|
19
18
|
// Error Related:
|
|
20
19
|
var workingItem = props.entry.getWorkingInstance();
|
|
21
20
|
var isValid = workingItem.isValid();
|
|
@@ -40,8 +39,7 @@ export function mapStateToProps(state, props) {
|
|
|
40
39
|
partialScoringEnabled: featureOn('partial_scoring'),
|
|
41
40
|
quizId: getActiveQuizId(state),
|
|
42
41
|
scope: props.scope,
|
|
43
|
-
rootAccountUuid: state.getIn(['outcomes', 'externalAccountUuid'])
|
|
44
|
-
showCalculatorOption: (_props$showCalculator = props.showCalculator) !== null && _props$showCalculator !== void 0 ? _props$showCalculator : true // used by Studio team to control calculator checkbox visibility
|
|
42
|
+
rootAccountUuid: state.getIn(['outcomes', 'externalAccountUuid'])
|
|
45
43
|
};
|
|
46
44
|
}
|
|
47
45
|
function mapDispatchToProps(dispatch) {
|
|
@@ -191,8 +191,7 @@ _defineProperty(ItemEdit, "propTypes", {
|
|
|
191
191
|
launch_context_uuid: PropTypes.string,
|
|
192
192
|
root_account_name: PropTypes.string
|
|
193
193
|
}),
|
|
194
|
-
rootAccountUuid: PropTypes.string
|
|
195
|
-
showCalculatorOption: PropTypes.bool
|
|
194
|
+
rootAccountUuid: PropTypes.string
|
|
196
195
|
});
|
|
197
196
|
_defineProperty(ItemEdit, "defaultProps", {
|
|
198
197
|
additionalOptions: [],
|
|
@@ -208,7 +207,6 @@ _defineProperty(ItemEdit, "defaultProps", {
|
|
|
208
207
|
initialFocusId: null,
|
|
209
208
|
validationErrorsFromApi: {},
|
|
210
209
|
scope: {},
|
|
211
|
-
rootAccountUuid: null
|
|
212
|
-
showCalculatorOption: true
|
|
210
|
+
rootAccountUuid: null
|
|
213
211
|
});
|
|
214
212
|
export default ItemEdit;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
|
+
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
|
+
import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
|
|
4
|
+
import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
|
|
5
|
+
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
6
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
7
|
+
var _dec, _class, _Errors;
|
|
8
|
+
function _callSuper(_this, derived, args) {
|
|
9
|
+
function isNativeReflectConstruct() {
|
|
10
|
+
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
11
|
+
if (Reflect.construct.sham) return false;
|
|
12
|
+
if (typeof Proxy === "function") return true;
|
|
13
|
+
try {
|
|
14
|
+
return !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
15
|
+
} catch (e) {
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
derived = _getPrototypeOf(derived);
|
|
20
|
+
return _possibleConstructorReturn(_this, isNativeReflectConstruct() ? Reflect.construct(derived, args || [], _getPrototypeOf(_this).constructor) : derived.apply(_this, args));
|
|
21
|
+
}
|
|
22
|
+
/** @jsx jsx */
|
|
23
|
+
import { Component } from 'react';
|
|
24
|
+
import { List } from 'immutable';
|
|
25
|
+
import ImmutablePropTypes from 'react-immutable-proptypes';
|
|
26
|
+
import PropTypes from 'prop-types';
|
|
27
|
+
import { jsx } from '@instructure/emotion';
|
|
28
|
+
import generateStyle from './styles';
|
|
29
|
+
import generateComponentTheme from './theme';
|
|
30
|
+
import { withStyleOverrides } from '@instructure/quiz-common';
|
|
31
|
+
export var Errors = (_dec = withStyleOverrides(generateStyle, generateComponentTheme), _dec(_class = (_Errors = /*#__PURE__*/function (_Component) {
|
|
32
|
+
function Errors() {
|
|
33
|
+
var _this2;
|
|
34
|
+
_classCallCheck(this, Errors);
|
|
35
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
36
|
+
args[_key] = arguments[_key];
|
|
37
|
+
}
|
|
38
|
+
_this2 = _callSuper(this, Errors, [].concat(args));
|
|
39
|
+
_defineProperty(_this2, "renderError", function (errorText, i) {
|
|
40
|
+
var key = "error_for_".concat(i);
|
|
41
|
+
return jsx("div", {
|
|
42
|
+
css: _this2.props.styles.error,
|
|
43
|
+
key: key,
|
|
44
|
+
"data-automation": "sdk-core-error"
|
|
45
|
+
}, errorText);
|
|
46
|
+
});
|
|
47
|
+
return _this2;
|
|
48
|
+
}
|
|
49
|
+
_inherits(Errors, _Component);
|
|
50
|
+
return _createClass(Errors, [{
|
|
51
|
+
key: "render",
|
|
52
|
+
value: function render() {
|
|
53
|
+
var _this$props$errorList;
|
|
54
|
+
if (this.props.errorList.size === 0) {
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
return jsx("div", {
|
|
58
|
+
css: this.props.styles.errors,
|
|
59
|
+
"data-testid": "errors-container"
|
|
60
|
+
}, (_this$props$errorList = this.props.errorList) === null || _this$props$errorList === void 0 ? void 0 : _this$props$errorList.toArray().map(this.renderError));
|
|
61
|
+
}
|
|
62
|
+
}]);
|
|
63
|
+
}(Component), _defineProperty(_Errors, "displayName", 'Errors'), _defineProperty(_Errors, "componentId", "Quizzes".concat(_Errors.displayName)), _defineProperty(_Errors, "propTypes", {
|
|
64
|
+
errorList: ImmutablePropTypes.list,
|
|
65
|
+
styles: PropTypes.object
|
|
66
|
+
}), _defineProperty(_Errors, "defaultProps", {
|
|
67
|
+
errorList: List()
|
|
68
|
+
}), _Errors)) || _class);
|
|
69
|
+
export default Errors;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
var generateStyle = function generateStyle(componentTheme) {
|
|
2
|
+
return {
|
|
3
|
+
errors: {
|
|
4
|
+
display: 'flex',
|
|
5
|
+
alignItems: 'flex-start',
|
|
6
|
+
flexDirection: 'column'
|
|
7
|
+
},
|
|
8
|
+
error: {
|
|
9
|
+
fontFamily: componentTheme.errorFontFamily,
|
|
10
|
+
fontSize: componentTheme.errorFontSize,
|
|
11
|
+
color: componentTheme.errorColor,
|
|
12
|
+
flex: '1 1 auto'
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export default generateStyle;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
2
|
+
var colors = _ref.colors,
|
|
3
|
+
typography = _ref.typography;
|
|
4
|
+
return {
|
|
5
|
+
errorFontFamily: typography.fontFamily,
|
|
6
|
+
errorFontSize: typography.fontSizeSmall,
|
|
7
|
+
errorColor: colors.contrasts.red4570
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
export default generateComponentTheme;
|
|
@@ -165,7 +165,6 @@ export var Quiz = (_dec = withStateCache(function (quiz) {
|
|
|
165
165
|
choiceElimination: false,
|
|
166
166
|
contextId: null,
|
|
167
167
|
defaultRceSettings: null,
|
|
168
|
-
disableDocumentAccess: false,
|
|
169
168
|
hasTimeLimit: false,
|
|
170
169
|
id: '0',
|
|
171
170
|
instructions: t('Add Instructions...'),
|
|
@@ -60,8 +60,7 @@ export var propsForInteractionEdit = function propsForInteractionEdit(props, add
|
|
|
60
60
|
stemErrors: props.workingItem.errorsFor('itemBody').toJS(),
|
|
61
61
|
initialFocusId: props.initialFocusId,
|
|
62
62
|
calculatorType: item.calculatorType,
|
|
63
|
-
multipleHotSpotEnabled: featureOn('multiple_hotspot_selections')
|
|
64
|
-
showCalculatorOption: props.showCalculatorOption
|
|
63
|
+
multipleHotSpotEnabled: featureOn('multiple_hotspot_selections')
|
|
65
64
|
};
|
|
66
65
|
};
|
|
67
66
|
export var propsForInteractionShow = function propsForInteractionShow(item) {
|
package/es/index.js
CHANGED
|
@@ -74,6 +74,7 @@ export { StimulusShow } from './common/components/resources/stimulus/StimulusSho
|
|
|
74
74
|
export { QuizSessionResultHeader } from './common/components/resources/quizSessionResult/Header';
|
|
75
75
|
export { Info as QuizSessionResultInfo } from './common/components/resources/quizSessionResult/Info';
|
|
76
76
|
export { SessionItemResultsList } from './common/components/resources/sessionItemResult/SessionItemResultsList';
|
|
77
|
+
export { Errors } from './common/components/shared/errors/Errors';
|
|
77
78
|
export { TimeUnitsInput } from './common/components/shared/TimeUnitsInput';
|
|
78
79
|
export { QuizEntry as QuizEntryView } from './building/components/resources/quizEntry/QuizEntry';
|
|
79
80
|
export { Provider } from './common/react-redux';
|
|
@@ -116,7 +117,7 @@ export { getClientIpAddress } from './common/util/getClientIpAddress';
|
|
|
116
117
|
export { createQuizEntryRegrade } from './grading/api/quizEntryRegrades';
|
|
117
118
|
export { getQuizEntry } from './building/api/quizEntries';
|
|
118
119
|
export { getItem } from './building/api/items';
|
|
119
|
-
export { interactionFileUpload, setOneAtATimeType, quizBuildingSession, saveQuizChange, setBacktracking, setCalculatorType, setAllowClearMCSelection, setChoiceElimination, setFilterIpAddress, setIpFiltersApi, setIpFiltersUi, setQuizDefaultRceSettings, setQuizShuffleAnswers,
|
|
120
|
+
export { interactionFileUpload, setOneAtATimeType, quizBuildingSession, saveQuizChange, setBacktracking, setCalculatorType, setAllowClearMCSelection, setChoiceElimination, setFilterIpAddress, setIpFiltersApi, setIpFiltersUi, setQuizDefaultRceSettings, setQuizShuffleAnswers, setQuizShuffleQuestions, setRequireStudentAccessCode, setStudentAccessCodeApi, setStudentAccessCodeUi, setQuizHasTimeLimit, setSessionTimeLimitInSecondsUi, setSessionTimeLimitInSecondsApi, setResultsFeedback, setResultsFeedbackEnabled } from './building/api/quizzes';
|
|
120
121
|
export { getExistingQuiz } from './common/api/quizzes';
|
|
121
122
|
export { confirmSessionStartPage, submitStudentAccessCode, nextQuestion, submitQuiz } from './taking/api/taking';
|
|
122
123
|
export { pinSessionItem } from './common/api/quizSessions';
|
|
@@ -17,7 +17,6 @@ exports.setIpFiltersApi = setIpFiltersApi;
|
|
|
17
17
|
exports.setIpFiltersUi = setIpFiltersUi;
|
|
18
18
|
exports.setOneAtATimeType = setOneAtATimeType;
|
|
19
19
|
exports.setQuizDefaultRceSettings = setQuizDefaultRceSettings;
|
|
20
|
-
exports.setQuizDisableDocumentAccess = setQuizDisableDocumentAccess;
|
|
21
20
|
exports.setQuizHasTimeLimit = setQuizHasTimeLimit;
|
|
22
21
|
exports.setQuizShuffleAnswers = setQuizShuffleAnswers;
|
|
23
22
|
exports.setQuizShuffleQuestions = setQuizShuffleQuestions;
|
|
@@ -221,11 +220,6 @@ function setQuizShuffleAnswers(quizId, value, completeCb) {
|
|
|
221
220
|
shuffle_answers: Boolean(value)
|
|
222
221
|
}, (0, _modifications.changeQuizShuffleAnswers)(quizId, value), completeCb);
|
|
223
222
|
}
|
|
224
|
-
function setQuizDisableDocumentAccess(quizId, value, completeCb) {
|
|
225
|
-
return setQuizProperty(quizId, {
|
|
226
|
-
disable_document_access: Boolean(value)
|
|
227
|
-
}, (0, _modifications.changeQuizDisableDocumentAccess)(quizId, value), completeCb);
|
|
228
|
-
}
|
|
229
223
|
function setRequireStudentAccessCode(quizId, value, completeCb) {
|
|
230
224
|
return setQuizProperty(quizId, {
|
|
231
225
|
require_student_access_code: Boolean(value)
|
|
@@ -11,18 +11,19 @@ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime
|
|
|
11
11
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
12
12
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
13
13
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
14
|
-
var _react =
|
|
14
|
+
var _react = require("react");
|
|
15
15
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
16
16
|
var _reactImmutableProptypes = _interopRequireDefault(require("react-immutable-proptypes"));
|
|
17
|
+
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
17
18
|
var _defer = _interopRequireDefault(require("lodash/defer"));
|
|
18
19
|
var _emotion = require("@instructure/emotion");
|
|
20
|
+
var _styles = _interopRequireDefault(require("./styles"));
|
|
21
|
+
var _theme = _interopRequireDefault(require("./theme"));
|
|
22
|
+
var _Errors = _interopRequireDefault(require("../../../../../../common/components/shared/errors/Errors"));
|
|
19
23
|
var _formatMessage = _interopRequireDefault(require("@instructure/quiz-i18n/es/format-message"));
|
|
20
24
|
var _quizCommon = require("@instructure/quiz-common");
|
|
21
|
-
var
|
|
22
|
-
var _TitleEdit;
|
|
25
|
+
var _dec, _class, _TitleEdit;
|
|
23
26
|
/** @jsx jsx */
|
|
24
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
25
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
26
27
|
function _callSuper(_this, derived, args) {
|
|
27
28
|
function isNativeReflectConstruct() {
|
|
28
29
|
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
@@ -42,23 +43,19 @@ function _callSuper(_this, derived, args) {
|
|
|
42
43
|
// is rendered & has actions that
|
|
43
44
|
// allow for canceling
|
|
44
45
|
// =================================
|
|
45
|
-
var TitleEdit = exports.TitleEdit = /*#__PURE__*/function (_Component) {
|
|
46
|
-
function TitleEdit(
|
|
46
|
+
var TitleEdit = exports.TitleEdit = (_dec = (0, _quizCommon.withStyleOverrides)(_styles["default"], _theme["default"]), _dec(_class = (_TitleEdit = /*#__PURE__*/function (_Component) {
|
|
47
|
+
function TitleEdit() {
|
|
47
48
|
var _this2;
|
|
48
49
|
(0, _classCallCheck2["default"])(this, TitleEdit);
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
(0, _defineProperty2["default"])(_this2, "inputRef", null);
|
|
50
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
51
|
+
args[_key] = arguments[_key];
|
|
52
|
+
}
|
|
53
|
+
_this2 = _callSuper(this, TitleEdit, [].concat(args));
|
|
54
54
|
(0, _defineProperty2["default"])(_this2, "defer", function (fn) {
|
|
55
|
-
// to enable
|
|
55
|
+
// to enable syncronous testing
|
|
56
56
|
var deferFn = _this2.props.deferMock || _defer["default"];
|
|
57
57
|
deferFn(fn);
|
|
58
58
|
});
|
|
59
|
-
(0, _defineProperty2["default"])(_this2, "setInputRef", function (node) {
|
|
60
|
-
_this2.inputRef.current = node;
|
|
61
|
-
});
|
|
62
59
|
(0, _defineProperty2["default"])(_this2, "switchOffEditing", function () {
|
|
63
60
|
var fromEnterPressed = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
64
61
|
_this2.ifValidElseError(function () {
|
|
@@ -87,21 +84,26 @@ var TitleEdit = exports.TitleEdit = /*#__PURE__*/function (_Component) {
|
|
|
87
84
|
(0, _defineProperty2["default"])(_this2, "handleBlur", function (e) {
|
|
88
85
|
_this2.switchOffEditing(false);
|
|
89
86
|
});
|
|
90
|
-
_this2.inputRef = _react["default"].createRef();
|
|
91
87
|
return _this2;
|
|
92
88
|
}
|
|
93
89
|
(0, _inherits2["default"])(TitleEdit, _Component);
|
|
94
90
|
return (0, _createClass2["default"])(TitleEdit, [{
|
|
95
91
|
key: "componentDidMount",
|
|
96
|
-
value:
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
92
|
+
value:
|
|
93
|
+
// todo: extract this into a shared method
|
|
94
|
+
// to be used on many components
|
|
95
|
+
function componentDidMount() {
|
|
96
|
+
this.props.makeStyles();
|
|
97
|
+
var input = _reactDom["default"].findDOMNode(this.input);
|
|
98
|
+
// some browsers add chars so * 2 to ensure at end
|
|
99
|
+
var valLength = input.value.length * 2;
|
|
100
|
+
input.focus();
|
|
101
|
+
input.setSelectionRange(valLength, valLength);
|
|
102
|
+
}
|
|
103
|
+
}, {
|
|
104
|
+
key: "componentDidUpdate",
|
|
105
|
+
value: function componentDidUpdate() {
|
|
106
|
+
this.props.makeStyles();
|
|
105
107
|
}
|
|
106
108
|
}, {
|
|
107
109
|
key: "ifValidElseError",
|
|
@@ -122,57 +124,46 @@ var TitleEdit = exports.TitleEdit = /*#__PURE__*/function (_Component) {
|
|
|
122
124
|
};
|
|
123
125
|
}
|
|
124
126
|
}, {
|
|
125
|
-
key: "
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
127
|
+
key: "hasErrors",
|
|
128
|
+
value: function hasErrors() {
|
|
129
|
+
return this.props.errorsAreShowing && this.props.errors.size > 0;
|
|
130
|
+
}
|
|
131
|
+
}, {
|
|
132
|
+
key: "renderErrors",
|
|
133
|
+
value: function renderErrors() {
|
|
134
|
+
if (this.hasErrors()) {
|
|
135
|
+
return (0, _emotion.jsx)("div", {
|
|
136
|
+
css: this.props.styles.errorsWrapper
|
|
137
|
+
}, (0, _emotion.jsx)(_Errors["default"], {
|
|
138
|
+
errorList: this.props.errors
|
|
139
|
+
}));
|
|
131
140
|
}
|
|
132
|
-
var errorList = (_this$props$errors = this.props.errors) === null || _this$props$errors === void 0 || (_this$props$errors = _this$props$errors.toArray()) === null || _this$props$errors === void 0 ? void 0 : _this$props$errors.map(function (error) {
|
|
133
|
-
if (typeof error === 'object') {
|
|
134
|
-
return error;
|
|
135
|
-
}
|
|
136
|
-
return {
|
|
137
|
-
text: error,
|
|
138
|
-
type: 'newError'
|
|
139
|
-
};
|
|
140
|
-
});
|
|
141
|
-
return errorList || [];
|
|
142
141
|
}
|
|
143
142
|
}, {
|
|
144
143
|
key: "render",
|
|
145
144
|
value: function render() {
|
|
146
|
-
return (0, _emotion.jsx)(
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
145
|
+
return (0, _emotion.jsx)("div", {
|
|
146
|
+
ref: this.setRef('wrapper'),
|
|
147
|
+
css: this.props.styles.titleEditWrapper,
|
|
148
|
+
onBlur: this.handleBlur,
|
|
150
149
|
"data-automation": "sdk-quiz-title-edit-wrapper"
|
|
151
|
-
}, (0, _emotion.jsx)(
|
|
152
|
-
|
|
153
|
-
|
|
150
|
+
}, (0, _emotion.jsx)("div", {
|
|
151
|
+
css: this.props.styles.inputWrapper
|
|
152
|
+
}, (0, _emotion.jsx)("input", {
|
|
153
|
+
ref: this.setRef('input'),
|
|
154
|
+
type: "text",
|
|
155
|
+
"aria-label": (0, _formatMessage["default"])('title'),
|
|
154
156
|
placeholder: (0, _formatMessage["default"])('Add a Title...'),
|
|
155
|
-
|
|
157
|
+
value: this.props.value,
|
|
156
158
|
onKeyDown: this.handleKeyDown,
|
|
157
159
|
onKeyUp: this.handleKeyUp,
|
|
158
160
|
onChange: this.props.onInputChange,
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
themeOverride: {
|
|
163
|
-
padding: 0,
|
|
164
|
-
borderColor: 'transparent',
|
|
165
|
-
mediumFontSize: '1.75rem',
|
|
166
|
-
fontWeight: '400'
|
|
167
|
-
}
|
|
168
|
-
})));
|
|
161
|
+
css: this.props.styles.titleEditInput,
|
|
162
|
+
"data-automation": "sdk-quiz-title-edit"
|
|
163
|
+
})), this.renderErrors());
|
|
169
164
|
}
|
|
170
165
|
}]);
|
|
171
|
-
}(_react.Component)
|
|
172
|
-
_TitleEdit = TitleEdit;
|
|
173
|
-
(0, _defineProperty2["default"])(TitleEdit, "displayName", 'TitleEdit');
|
|
174
|
-
(0, _defineProperty2["default"])(TitleEdit, "componentId", "Quizzes".concat(_TitleEdit.displayName));
|
|
175
|
-
(0, _defineProperty2["default"])(TitleEdit, "propTypes", {
|
|
166
|
+
}(_react.Component), (0, _defineProperty2["default"])(_TitleEdit, "displayName", 'TitleEdit'), (0, _defineProperty2["default"])(_TitleEdit, "componentId", "Quizzes".concat(_TitleEdit.displayName)), (0, _defineProperty2["default"])(_TitleEdit, "propTypes", {
|
|
176
167
|
value: _propTypes["default"].string.isRequired,
|
|
177
168
|
isValid: _propTypes["default"].bool.isRequired,
|
|
178
169
|
showError: _propTypes["default"].func.isRequired,
|
|
@@ -182,10 +173,10 @@ _TitleEdit = TitleEdit;
|
|
|
182
173
|
onInputChange: _propTypes["default"].func.isRequired,
|
|
183
174
|
saveAndPreview: _propTypes["default"].func.isRequired,
|
|
184
175
|
deferMock: _propTypes["default"].func,
|
|
185
|
-
styles: _propTypes["default"].object
|
|
186
|
-
|
|
187
|
-
(0, _defineProperty2["default"])(
|
|
176
|
+
styles: _propTypes["default"].object,
|
|
177
|
+
makeStyles: _propTypes["default"].func
|
|
178
|
+
}), (0, _defineProperty2["default"])(_TitleEdit, "defaultProps", {
|
|
188
179
|
errorsAreShowing: false,
|
|
189
180
|
deferMock: _defer["default"]
|
|
190
|
-
});
|
|
181
|
+
}), _TitleEdit)) || _class);
|
|
191
182
|
var _default = exports["default"] = TitleEdit;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports["default"] = void 0;
|
|
8
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
10
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
11
|
+
var generateStyle = function generateStyle(componentTheme, props) {
|
|
12
|
+
var wrapperStyles = {
|
|
13
|
+
width: '100%',
|
|
14
|
+
flex: '1 1 auto',
|
|
15
|
+
display: 'flex',
|
|
16
|
+
flexDirection: 'column',
|
|
17
|
+
justifyContent: 'center'
|
|
18
|
+
};
|
|
19
|
+
var errorBorderStyles = {
|
|
20
|
+
margin: componentTheme.errorBorderMargin,
|
|
21
|
+
padding: componentTheme.errorBorderPadding,
|
|
22
|
+
border: "solid 1px ".concat(componentTheme.errorBorderColor),
|
|
23
|
+
borderRadius: componentTheme.errorBorderBorderRadius
|
|
24
|
+
};
|
|
25
|
+
return {
|
|
26
|
+
titleEditWrapper: {
|
|
27
|
+
position: 'relative',
|
|
28
|
+
width: '100%',
|
|
29
|
+
height: '5rem',
|
|
30
|
+
boxSizing: 'border-box',
|
|
31
|
+
paddingLeft: componentTheme.titleEditWrapperLeftPadding,
|
|
32
|
+
paddingRight: componentTheme.titleEditWrapperRightPadding,
|
|
33
|
+
display: 'flex',
|
|
34
|
+
flexDirection: 'column',
|
|
35
|
+
justifyContent: 'center'
|
|
36
|
+
},
|
|
37
|
+
titleEditInput: _objectSpread({
|
|
38
|
+
fontFamily: componentTheme.titleEditInputFontFamily,
|
|
39
|
+
fontSize: componentTheme.titleEditInputFontSize
|
|
40
|
+
}, props.errorsAreShowing && props.errors.size > 0 && errorBorderStyles),
|
|
41
|
+
inputWrapper: wrapperStyles,
|
|
42
|
+
errorsWrapper: wrapperStyles
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
var _default = exports["default"] = generateStyle;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
8
|
+
var spacing = _ref.spacing,
|
|
9
|
+
colors = _ref.colors,
|
|
10
|
+
typography = _ref.typography,
|
|
11
|
+
borders = _ref.borders;
|
|
12
|
+
return {
|
|
13
|
+
titleEditWrapperLeftPadding: spacing.large,
|
|
14
|
+
titleEditWrapperRightPadding: spacing.large,
|
|
15
|
+
titleEditInputFontFamily: typography.fontFamily,
|
|
16
|
+
titleEditInputFontSize: typography.fontSizeXLarge,
|
|
17
|
+
errorBorderMargin: spacing.xxSmall,
|
|
18
|
+
errorBorderPadding: spacing.xxSmall,
|
|
19
|
+
errorBorderColor: colors.contrasts.red4570,
|
|
20
|
+
errorBorderBorderRadius: borders.radiusSmall
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
var _default = exports["default"] = generateComponentTheme;
|
|
@@ -15,7 +15,6 @@ exports.changeQuizAllowClearMCSelection = changeQuizAllowClearMCSelection;
|
|
|
15
15
|
exports.changeQuizCalculatorType = changeQuizCalculatorType;
|
|
16
16
|
exports.changeQuizChoiceElimination = changeQuizChoiceElimination;
|
|
17
17
|
exports.changeQuizDefaultRceSettings = changeQuizDefaultRceSettings;
|
|
18
|
-
exports.changeQuizDisableDocumentAccess = changeQuizDisableDocumentAccess;
|
|
19
18
|
exports.changeQuizEntryEntry = changeQuizEntryEntry;
|
|
20
19
|
exports.changeQuizEntryPoints = changeQuizEntryPoints;
|
|
21
20
|
exports.changeQuizEntryProperties = changeQuizEntryProperties;
|
|
@@ -146,17 +145,6 @@ function changeQuizShuffleAnswers(quizId, value) {
|
|
|
146
145
|
}
|
|
147
146
|
};
|
|
148
147
|
}
|
|
149
|
-
function changeQuizDisableDocumentAccess(quizId, value) {
|
|
150
|
-
return {
|
|
151
|
-
type: _quizCommon.QUIZ_MODIFICATION,
|
|
152
|
-
payload: {
|
|
153
|
-
id: quizId,
|
|
154
|
-
modifications: {
|
|
155
|
-
disableDocumentAccess: Boolean(value)
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
};
|
|
159
|
-
}
|
|
160
148
|
function changeQuizRequireStudentAccessCode(quizId, value) {
|
|
161
149
|
return {
|
|
162
150
|
type: _quizCommon.QUIZ_MODIFICATION,
|
|
@@ -13,7 +13,7 @@ var _presenter = _interopRequireDefault(require("./presenter"));
|
|
|
13
13
|
var _makeEditable = _interopRequireDefault(require("../../../shared/functionality/makeEditable"));
|
|
14
14
|
var _modal = require("../../../../actions/modal");
|
|
15
15
|
var _ui = require("../../../../actions/ui");
|
|
16
|
-
var _ImportModal = require("
|
|
16
|
+
var _ImportModal = require("../../../../../common/components/ImportModal");
|
|
17
17
|
var _errorsShowing = require("../../../../actions/errorsShowing");
|
|
18
18
|
var _upload = require("../../../../actions/upload");
|
|
19
19
|
var modificationActions = _interopRequireWildcard(require("../../../../actions/modifications"));
|
|
@@ -21,11 +21,10 @@ var _alerts = require("../../../../actions/alerts");
|
|
|
21
21
|
var _items = require("../../../../../building/api/items");
|
|
22
22
|
var _quizzes = require("../../../../../building/api/quizzes");
|
|
23
23
|
var _featureCheck = require("../../../../util/featureCheck");
|
|
24
|
-
var _quizzes2 = require("
|
|
24
|
+
var _quizzes2 = require("../../../../../common/selectors/quizzes");
|
|
25
25
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
26
26
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
27
27
|
function mapStateToProps(state, props) {
|
|
28
|
-
var _props$showCalculator;
|
|
29
28
|
// Error Related:
|
|
30
29
|
var workingItem = props.entry.getWorkingInstance();
|
|
31
30
|
var isValid = workingItem.isValid();
|
|
@@ -50,8 +49,7 @@ function mapStateToProps(state, props) {
|
|
|
50
49
|
partialScoringEnabled: (0, _featureCheck.featureOn)('partial_scoring'),
|
|
51
50
|
quizId: (0, _quizzes2.getActiveQuizId)(state),
|
|
52
51
|
scope: props.scope,
|
|
53
|
-
rootAccountUuid: state.getIn(['outcomes', 'externalAccountUuid'])
|
|
54
|
-
showCalculatorOption: (_props$showCalculator = props.showCalculator) !== null && _props$showCalculator !== void 0 ? _props$showCalculator : true // used by Studio team to control calculator checkbox visibility
|
|
52
|
+
rootAccountUuid: state.getIn(['outcomes', 'externalAccountUuid'])
|
|
55
53
|
};
|
|
56
54
|
}
|
|
57
55
|
function mapDispatchToProps(dispatch) {
|
|
@@ -200,8 +200,7 @@ var ItemEdit = exports.ItemEdit = /*#__PURE__*/function (_Component) {
|
|
|
200
200
|
launch_context_uuid: _propTypes["default"].string,
|
|
201
201
|
root_account_name: _propTypes["default"].string
|
|
202
202
|
}),
|
|
203
|
-
rootAccountUuid: _propTypes["default"].string
|
|
204
|
-
showCalculatorOption: _propTypes["default"].bool
|
|
203
|
+
rootAccountUuid: _propTypes["default"].string
|
|
205
204
|
});
|
|
206
205
|
(0, _defineProperty2["default"])(ItemEdit, "defaultProps", {
|
|
207
206
|
additionalOptions: [],
|
|
@@ -217,7 +216,6 @@ var ItemEdit = exports.ItemEdit = /*#__PURE__*/function (_Component) {
|
|
|
217
216
|
initialFocusId: null,
|
|
218
217
|
validationErrorsFromApi: {},
|
|
219
218
|
scope: {},
|
|
220
|
-
rootAccountUuid: null
|
|
221
|
-
showCalculatorOption: true
|
|
219
|
+
rootAccountUuid: null
|
|
222
220
|
});
|
|
223
221
|
var _default = exports["default"] = ItemEdit;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports["default"] = exports.Errors = void 0;
|
|
8
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
9
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
11
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
12
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
13
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
14
|
+
var _react = require("react");
|
|
15
|
+
var _immutable = require("immutable");
|
|
16
|
+
var _reactImmutableProptypes = _interopRequireDefault(require("react-immutable-proptypes"));
|
|
17
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
18
|
+
var _emotion = require("@instructure/emotion");
|
|
19
|
+
var _styles = _interopRequireDefault(require("./styles"));
|
|
20
|
+
var _theme = _interopRequireDefault(require("./theme"));
|
|
21
|
+
var _quizCommon = require("@instructure/quiz-common");
|
|
22
|
+
var _dec, _class, _Errors;
|
|
23
|
+
/** @jsx jsx */
|
|
24
|
+
function _callSuper(_this, derived, args) {
|
|
25
|
+
function isNativeReflectConstruct() {
|
|
26
|
+
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
27
|
+
if (Reflect.construct.sham) return false;
|
|
28
|
+
if (typeof Proxy === "function") return true;
|
|
29
|
+
try {
|
|
30
|
+
return !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
31
|
+
} catch (e) {
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
derived = (0, _getPrototypeOf2["default"])(derived);
|
|
36
|
+
return (0, _possibleConstructorReturn2["default"])(_this, isNativeReflectConstruct() ? Reflect.construct(derived, args || [], (0, _getPrototypeOf2["default"])(_this).constructor) : derived.apply(_this, args));
|
|
37
|
+
}
|
|
38
|
+
var Errors = exports.Errors = (_dec = (0, _quizCommon.withStyleOverrides)(_styles["default"], _theme["default"]), _dec(_class = (_Errors = /*#__PURE__*/function (_Component) {
|
|
39
|
+
function Errors() {
|
|
40
|
+
var _this2;
|
|
41
|
+
(0, _classCallCheck2["default"])(this, Errors);
|
|
42
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
43
|
+
args[_key] = arguments[_key];
|
|
44
|
+
}
|
|
45
|
+
_this2 = _callSuper(this, Errors, [].concat(args));
|
|
46
|
+
(0, _defineProperty2["default"])(_this2, "renderError", function (errorText, i) {
|
|
47
|
+
var key = "error_for_".concat(i);
|
|
48
|
+
return (0, _emotion.jsx)("div", {
|
|
49
|
+
css: _this2.props.styles.error,
|
|
50
|
+
key: key,
|
|
51
|
+
"data-automation": "sdk-core-error"
|
|
52
|
+
}, errorText);
|
|
53
|
+
});
|
|
54
|
+
return _this2;
|
|
55
|
+
}
|
|
56
|
+
(0, _inherits2["default"])(Errors, _Component);
|
|
57
|
+
return (0, _createClass2["default"])(Errors, [{
|
|
58
|
+
key: "render",
|
|
59
|
+
value: function render() {
|
|
60
|
+
var _this$props$errorList;
|
|
61
|
+
if (this.props.errorList.size === 0) {
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
return (0, _emotion.jsx)("div", {
|
|
65
|
+
css: this.props.styles.errors,
|
|
66
|
+
"data-testid": "errors-container"
|
|
67
|
+
}, (_this$props$errorList = this.props.errorList) === null || _this$props$errorList === void 0 ? void 0 : _this$props$errorList.toArray().map(this.renderError));
|
|
68
|
+
}
|
|
69
|
+
}]);
|
|
70
|
+
}(_react.Component), (0, _defineProperty2["default"])(_Errors, "displayName", 'Errors'), (0, _defineProperty2["default"])(_Errors, "componentId", "Quizzes".concat(_Errors.displayName)), (0, _defineProperty2["default"])(_Errors, "propTypes", {
|
|
71
|
+
errorList: _reactImmutableProptypes["default"].list,
|
|
72
|
+
styles: _propTypes["default"].object
|
|
73
|
+
}), (0, _defineProperty2["default"])(_Errors, "defaultProps", {
|
|
74
|
+
errorList: (0, _immutable.List)()
|
|
75
|
+
}), _Errors)) || _class);
|
|
76
|
+
var _default = exports["default"] = Errors;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
var generateStyle = function generateStyle(componentTheme) {
|
|
8
|
+
return {
|
|
9
|
+
errors: {
|
|
10
|
+
display: 'flex',
|
|
11
|
+
alignItems: 'flex-start',
|
|
12
|
+
flexDirection: 'column'
|
|
13
|
+
},
|
|
14
|
+
error: {
|
|
15
|
+
fontFamily: componentTheme.errorFontFamily,
|
|
16
|
+
fontSize: componentTheme.errorFontSize,
|
|
17
|
+
color: componentTheme.errorColor,
|
|
18
|
+
flex: '1 1 auto'
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
var _default = exports["default"] = generateStyle;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
8
|
+
var colors = _ref.colors,
|
|
9
|
+
typography = _ref.typography;
|
|
10
|
+
return {
|
|
11
|
+
errorFontFamily: typography.fontFamily,
|
|
12
|
+
errorFontSize: typography.fontSizeSmall,
|
|
13
|
+
errorColor: colors.contrasts.red4570
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
var _default = exports["default"] = generateComponentTheme;
|
|
@@ -172,7 +172,6 @@ var Quiz = exports.Quiz = (_dec = (0, _withStateCache["default"])(function (quiz
|
|
|
172
172
|
choiceElimination: false,
|
|
173
173
|
contextId: null,
|
|
174
174
|
defaultRceSettings: null,
|
|
175
|
-
disableDocumentAccess: false,
|
|
176
175
|
hasTimeLimit: false,
|
|
177
176
|
id: '0',
|
|
178
177
|
instructions: (0, _formatMessage["default"])('Add Instructions...'),
|
|
@@ -67,8 +67,7 @@ var propsForInteractionEdit = exports.propsForInteractionEdit = function propsFo
|
|
|
67
67
|
stemErrors: props.workingItem.errorsFor('itemBody').toJS(),
|
|
68
68
|
initialFocusId: props.initialFocusId,
|
|
69
69
|
calculatorType: item.calculatorType,
|
|
70
|
-
multipleHotSpotEnabled: (0, _featureCheck.featureOn)('multiple_hotspot_selections')
|
|
71
|
-
showCalculatorOption: props.showCalculatorOption
|
|
70
|
+
multipleHotSpotEnabled: (0, _featureCheck.featureOn)('multiple_hotspot_selections')
|
|
72
71
|
};
|
|
73
72
|
};
|
|
74
73
|
var propsForInteractionShow = exports.propsForInteractionShow = function propsForInteractionShow(item) {
|
package/lib/index.js
CHANGED
|
@@ -70,6 +70,7 @@ var _exportNames = {
|
|
|
70
70
|
QuizSessionResultHeader: true,
|
|
71
71
|
QuizSessionResultInfo: true,
|
|
72
72
|
SessionItemResultsList: true,
|
|
73
|
+
Errors: true,
|
|
73
74
|
TimeUnitsInput: true,
|
|
74
75
|
QuizEntryView: true,
|
|
75
76
|
Provider: true,
|
|
@@ -134,7 +135,6 @@ var _exportNames = {
|
|
|
134
135
|
setIpFiltersUi: true,
|
|
135
136
|
setQuizDefaultRceSettings: true,
|
|
136
137
|
setQuizShuffleAnswers: true,
|
|
137
|
-
setQuizDisableDocumentAccess: true,
|
|
138
138
|
setQuizShuffleQuestions: true,
|
|
139
139
|
setRequireStudentAccessCode: true,
|
|
140
140
|
setStudentAccessCodeApi: true,
|
|
@@ -334,6 +334,12 @@ Object.defineProperty(exports, "DropTargetCreator", {
|
|
|
334
334
|
return _dragAndDropUtils.DropTargetCreator;
|
|
335
335
|
}
|
|
336
336
|
});
|
|
337
|
+
Object.defineProperty(exports, "Errors", {
|
|
338
|
+
enumerable: true,
|
|
339
|
+
get: function get() {
|
|
340
|
+
return _Errors.Errors;
|
|
341
|
+
}
|
|
342
|
+
});
|
|
337
343
|
Object.defineProperty(exports, "Event", {
|
|
338
344
|
enumerable: true,
|
|
339
345
|
get: function get() {
|
|
@@ -1325,12 +1331,6 @@ Object.defineProperty(exports, "setQuizDefaultRceSettings", {
|
|
|
1325
1331
|
return _quizzes.setQuizDefaultRceSettings;
|
|
1326
1332
|
}
|
|
1327
1333
|
});
|
|
1328
|
-
Object.defineProperty(exports, "setQuizDisableDocumentAccess", {
|
|
1329
|
-
enumerable: true,
|
|
1330
|
-
get: function get() {
|
|
1331
|
-
return _quizzes.setQuizDisableDocumentAccess;
|
|
1332
|
-
}
|
|
1333
|
-
});
|
|
1334
1334
|
Object.defineProperty(exports, "setQuizHasTimeLimit", {
|
|
1335
1335
|
enumerable: true,
|
|
1336
1336
|
get: function get() {
|
|
@@ -1553,6 +1553,7 @@ var _StimulusShow = require("./common/components/resources/stimulus/StimulusShow
|
|
|
1553
1553
|
var _Header = require("./common/components/resources/quizSessionResult/Header");
|
|
1554
1554
|
var _Info = require("./common/components/resources/quizSessionResult/Info");
|
|
1555
1555
|
var _SessionItemResultsList = require("./common/components/resources/sessionItemResult/SessionItemResultsList");
|
|
1556
|
+
var _Errors = require("./common/components/shared/errors/Errors");
|
|
1556
1557
|
var _TimeUnitsInput = require("./common/components/shared/TimeUnitsInput");
|
|
1557
1558
|
var _QuizEntry = require("./building/components/resources/quizEntry/QuizEntry");
|
|
1558
1559
|
var _reactRedux = require("./common/react-redux");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/quiz-core",
|
|
3
|
-
"version": "22.
|
|
3
|
+
"version": "22.4.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "The Quiz React SDK by Instructure Inc.",
|
|
6
6
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
@@ -10,27 +10,6 @@
|
|
|
10
10
|
"type": "git",
|
|
11
11
|
"url": "https://gerrit.instructure.com/quizzes-ui.git"
|
|
12
12
|
},
|
|
13
|
-
"scripts": {
|
|
14
|
-
"clean": "ui-build --clean",
|
|
15
|
-
"build": "build-if-changed",
|
|
16
|
-
"build:all": "ui-build --modules es,cjs",
|
|
17
|
-
"build:watch": "ui-build --watch",
|
|
18
|
-
"extract": "extract-translations",
|
|
19
|
-
"lint": "ui-test --lint",
|
|
20
|
-
"lint:fix": "ui-test --lint --fix",
|
|
21
|
-
"eslint:fix": "eslint --fix .",
|
|
22
|
-
"prelint": "pnpm build",
|
|
23
|
-
"pretest": "pnpm build",
|
|
24
|
-
"test": "pnpm test:karma",
|
|
25
|
-
"test:karma": "ui-test",
|
|
26
|
-
"test:watch": "ui-test --watch",
|
|
27
|
-
"snyk:monitor": "snyk monitor",
|
|
28
|
-
"postbuild": "cp src/banks/components/noResults.svg lib/banks/components/; cp src/banks/components/noResults.svg es/banks/components/; pnpm postbuild:errorImage",
|
|
29
|
-
"postbuild:all": "pnpm postbuild",
|
|
30
|
-
"postbuild:errorImage": "cp src/reporting/components/resources/NewQuizAndItemAnalysis/downForRepair.svg es/reporting/components/resources/NewQuizAndItemAnalysis/; cp src/reporting/components/resources/NewQuizAndItemAnalysis/downForRepair.svg lib/reporting/components/resources/NewQuizAndItemAnalysis/",
|
|
31
|
-
"format": "prettier --write \"src/**/*.{js,jsx,ts,tsx}\"",
|
|
32
|
-
"typecheck": "tsc --noEmit"
|
|
33
|
-
},
|
|
34
13
|
"keywords": [
|
|
35
14
|
"react",
|
|
36
15
|
"react-component",
|
|
@@ -46,11 +25,6 @@
|
|
|
46
25
|
"@instructure/emotion": "10.14.0",
|
|
47
26
|
"@instructure/grading-utils": "^1.0.0",
|
|
48
27
|
"@instructure/outcomes-ui": "3.2.3",
|
|
49
|
-
"@instructure/quiz-common": "22.3.2-rc.8+4e08bf17b",
|
|
50
|
-
"@instructure/quiz-i18n": "22.3.2-rc.8+4e08bf17b",
|
|
51
|
-
"@instructure/quiz-interactions": "22.3.2-rc.8+4e08bf17b",
|
|
52
|
-
"@instructure/quiz-number-input": "22.3.2-rc.8+4e08bf17b",
|
|
53
|
-
"@instructure/quiz-rce": "22.3.2-rc.8+4e08bf17b",
|
|
54
28
|
"@instructure/ui-a11y-content": "10.14.0",
|
|
55
29
|
"@instructure/ui-alerts": "10.14.0",
|
|
56
30
|
"@instructure/ui-avatar": "10.14.0",
|
|
@@ -109,7 +83,6 @@
|
|
|
109
83
|
"file-saver": "~2.0.5",
|
|
110
84
|
"humps": "^2.0.0",
|
|
111
85
|
"immutable": "^3.8.1",
|
|
112
|
-
"instructure-validations": "22.3.2-rc.8+4e08bf17b",
|
|
113
86
|
"ipaddr.js": "^1.5.4",
|
|
114
87
|
"isomorphic-fetch": "^2.2.0",
|
|
115
88
|
"isuuid": "^0.1.0",
|
|
@@ -137,10 +110,15 @@
|
|
|
137
110
|
"scriptjs": "^2.5.8",
|
|
138
111
|
"store": "^1.3.20",
|
|
139
112
|
"striptags": "^2.0.0",
|
|
140
|
-
"uuid": "^3.2.1"
|
|
113
|
+
"uuid": "^3.2.1",
|
|
114
|
+
"@instructure/quiz-common": "22.4.0",
|
|
115
|
+
"@instructure/quiz-i18n": "22.4.0",
|
|
116
|
+
"@instructure/quiz-number-input": "22.4.0",
|
|
117
|
+
"@instructure/quiz-rce": "22.4.0",
|
|
118
|
+
"@instructure/quiz-interactions": "22.4.0",
|
|
119
|
+
"instructure-validations": "22.4.0"
|
|
141
120
|
},
|
|
142
121
|
"devDependencies": {
|
|
143
|
-
"@instructure/quiz-scripts": "21.0.0",
|
|
144
122
|
"@instructure/ui-axe-check": "10.14.0",
|
|
145
123
|
"@instructure/ui-test-utils": "^7.22.1",
|
|
146
124
|
"@testing-library/react": "^12.1.5",
|
|
@@ -158,7 +136,6 @@
|
|
|
158
136
|
"jquery": "^2.2.3",
|
|
159
137
|
"karma-junit-reporter": "^2.0.1",
|
|
160
138
|
"most-subject": "^5.3.0",
|
|
161
|
-
"quiz-presets": "22.3.2-rc.8+4e08bf17b",
|
|
162
139
|
"react": "^16.8.6",
|
|
163
140
|
"react-addons-test-utils": "^15.6.2",
|
|
164
141
|
"react-dom": "^16.8.6",
|
|
@@ -166,7 +143,9 @@
|
|
|
166
143
|
"redux-mock-store": "^1.3.0",
|
|
167
144
|
"request": "^2.74.0",
|
|
168
145
|
"sinon": "^6.1.3",
|
|
169
|
-
"sinon-chai": "^3.3.0"
|
|
146
|
+
"sinon-chai": "^3.3.0",
|
|
147
|
+
"@instructure/quiz-scripts": "21.0.0",
|
|
148
|
+
"quiz-presets": "22.4.0"
|
|
170
149
|
},
|
|
171
150
|
"peerDependencies": {
|
|
172
151
|
"react": "^15 || ^16"
|
|
@@ -174,5 +153,25 @@
|
|
|
174
153
|
"publishConfig": {
|
|
175
154
|
"access": "public"
|
|
176
155
|
},
|
|
177
|
-
"
|
|
178
|
-
|
|
156
|
+
"scripts": {
|
|
157
|
+
"clean": "ui-build --clean",
|
|
158
|
+
"build": "build-if-changed",
|
|
159
|
+
"build:all": "ui-build --modules es,cjs",
|
|
160
|
+
"build:watch": "ui-build --watch",
|
|
161
|
+
"extract": "extract-translations",
|
|
162
|
+
"lint": "ui-test --lint",
|
|
163
|
+
"lint:fix": "ui-test --lint --fix",
|
|
164
|
+
"eslint:fix": "eslint --fix .",
|
|
165
|
+
"prelint": "pnpm build",
|
|
166
|
+
"pretest": "pnpm build",
|
|
167
|
+
"test": "pnpm test:karma",
|
|
168
|
+
"test:karma": "ui-test",
|
|
169
|
+
"test:watch": "ui-test --watch",
|
|
170
|
+
"snyk:monitor": "snyk monitor",
|
|
171
|
+
"postbuild": "cp src/banks/components/noResults.svg lib/banks/components/; cp src/banks/components/noResults.svg es/banks/components/; pnpm postbuild:errorImage",
|
|
172
|
+
"postbuild:all": "pnpm postbuild",
|
|
173
|
+
"postbuild:errorImage": "cp src/reporting/components/resources/NewQuizAndItemAnalysis/downForRepair.svg es/reporting/components/resources/NewQuizAndItemAnalysis/; cp src/reporting/components/resources/NewQuizAndItemAnalysis/downForRepair.svg lib/reporting/components/resources/NewQuizAndItemAnalysis/",
|
|
174
|
+
"format": "prettier --write \"src/**/*.{js,jsx,ts,tsx}\"",
|
|
175
|
+
"typecheck": "tsc --noEmit"
|
|
176
|
+
}
|
|
177
|
+
}
|