@instructure/quiz-core 20.24.0 → 20.25.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.
@@ -0,0 +1,78 @@
1
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
+ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
3
+ import _createClass from "@babel/runtime/helpers/esm/createClass";
4
+ import _inherits from "@babel/runtime/helpers/esm/inherits";
5
+ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
6
+ import React, { Component } from 'react';
7
+ import PropTypes from 'prop-types';
8
+ import { Checkbox } from '@instructure/ui-checkbox';
9
+ import { IconButton } from '@instructure/ui-buttons';
10
+ import { IconInfoLine as IconInfo } from '@instructure/ui-icons';
11
+ import { Tooltip } from '@instructure/ui-tooltip';
12
+ import { View } from '@instructure/ui-view';
13
+ import t from '@instructure/quiz-i18n/es/format-message';
14
+ export var ReduceAnswerChoicesSettings = /*#__PURE__*/function (_Component) {
15
+ _inherits(ReduceAnswerChoicesSettings, _Component);
16
+ var _super = _createSuper(ReduceAnswerChoicesSettings);
17
+ function ReduceAnswerChoicesSettings() {
18
+ var _this;
19
+ _classCallCheck(this, ReduceAnswerChoicesSettings);
20
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
21
+ args[_key] = arguments[_key];
22
+ }
23
+ _this = _super.call.apply(_super, [this].concat(args));
24
+ _this.onChangeReduceChoices = function () {
25
+ var update = _objectSpread(_objectSpread({}, _this.props.courseAccommodationSettings), {}, {
26
+ reduceChoicesEnabled: !_this.props.courseAccommodationSettings.reduceChoicesEnabled
27
+ });
28
+ _this.props.onChange(update);
29
+ };
30
+ _this.renderSettingLabel = function (label, tooltip) {
31
+ return /*#__PURE__*/React.createElement("span", null, label, /*#__PURE__*/React.createElement(Tooltip, {
32
+ color: "primary-inverse",
33
+ renderTip: tooltip,
34
+ placement: "bottom",
35
+ on: ['click', 'hover', 'focus']
36
+ }, /*#__PURE__*/React.createElement(IconButton, {
37
+ renderIcon: IconInfo,
38
+ color: "secondary",
39
+ size: "small",
40
+ shape: "circle",
41
+ withBackground: false,
42
+ withBorder: false,
43
+ interaction: "readonly",
44
+ screenReaderLabel: tooltip
45
+ })));
46
+ };
47
+ return _this;
48
+ }
49
+ _createClass(ReduceAnswerChoicesSettings, [{
50
+ key: "render",
51
+ value: function render() {
52
+ return /*#__PURE__*/React.createElement(View, {
53
+ display: "block",
54
+ margin: "medium none"
55
+ }, /*#__PURE__*/React.createElement(Checkbox, {
56
+ variant: "toggle",
57
+ checked: this.props.courseAccommodationSettings.reduceChoicesEnabled || false,
58
+ label: this.renderSettingLabel(t('Reduced answer choices'), t('Removes one incorrect answer from all multiple-choice questions that have 4 or more answer choices.')),
59
+ onChange: this.onChangeReduceChoices,
60
+ value: "reduce_choices_enabled"
61
+ }));
62
+ }
63
+ }]);
64
+ ReduceAnswerChoicesSettings.displayName = "ReduceAnswerChoicesSettings";
65
+ return ReduceAnswerChoicesSettings;
66
+ }(Component);
67
+ ReduceAnswerChoicesSettings.propTypes = {
68
+ courseAccommodationSettings: PropTypes.shape({
69
+ reduceChoicesEnabled: PropTypes.bool
70
+ }).isRequired,
71
+ onChange: PropTypes.func.isRequired
72
+ };
73
+ ReduceAnswerChoicesSettings.defaultProps = {
74
+ courseAccommodationSettings: {
75
+ reduceChoicesEnabled: false
76
+ }
77
+ };
78
+ export default ReduceAnswerChoicesSettings;
@@ -261,9 +261,6 @@ export var ModerateTableRow = (_dec = withStyle(generateStyle, generateComponent
261
261
  }, t('{ name }: { value }', elem)));
262
262
  }));
263
263
  }
264
-
265
- // Display the Accommodations and the button in a flex container with reverse order
266
- // so that the screen reader will read the accommodations first, and then the button
267
264
  return jsx(Table.Cell, {
268
265
  "data-automation": "sdk-moderate-accommodations-text"
269
266
  }, displayContent);
@@ -0,0 +1,88 @@
1
+ "use strict";
2
+
3
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
4
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = exports.ReduceAnswerChoicesSettings = void 0;
9
+ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
10
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
11
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
12
+ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
13
+ var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
14
+ var _react = _interopRequireWildcard(require("react"));
15
+ var _propTypes = _interopRequireDefault(require("prop-types"));
16
+ var _uiCheckbox = require("@instructure/ui-checkbox");
17
+ var _uiButtons = require("@instructure/ui-buttons");
18
+ var _uiIcons = require("@instructure/ui-icons");
19
+ var _uiTooltip = require("@instructure/ui-tooltip");
20
+ var _uiView = require("@instructure/ui-view");
21
+ var _formatMessage = _interopRequireDefault(require("@instructure/quiz-i18n/es/format-message"));
22
+ var ReduceAnswerChoicesSettings = /*#__PURE__*/function (_Component) {
23
+ (0, _inherits2.default)(ReduceAnswerChoicesSettings, _Component);
24
+ var _super = (0, _createSuper2.default)(ReduceAnswerChoicesSettings);
25
+ function ReduceAnswerChoicesSettings() {
26
+ var _this;
27
+ (0, _classCallCheck2.default)(this, ReduceAnswerChoicesSettings);
28
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
29
+ args[_key] = arguments[_key];
30
+ }
31
+ _this = _super.call.apply(_super, [this].concat(args));
32
+ _this.onChangeReduceChoices = function () {
33
+ var update = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, _this.props.courseAccommodationSettings), {}, {
34
+ reduceChoicesEnabled: !_this.props.courseAccommodationSettings.reduceChoicesEnabled
35
+ });
36
+ _this.props.onChange(update);
37
+ };
38
+ _this.renderSettingLabel = function (label, tooltip) {
39
+ return /*#__PURE__*/_react.default.createElement("span", null, label, /*#__PURE__*/_react.default.createElement(_uiTooltip.Tooltip, {
40
+ color: "primary-inverse",
41
+ renderTip: tooltip,
42
+ placement: "bottom",
43
+ on: ['click', 'hover', 'focus']
44
+ }, /*#__PURE__*/_react.default.createElement(_uiButtons.IconButton, {
45
+ renderIcon: _uiIcons.IconInfoLine,
46
+ color: "secondary",
47
+ size: "small",
48
+ shape: "circle",
49
+ withBackground: false,
50
+ withBorder: false,
51
+ interaction: "readonly",
52
+ screenReaderLabel: tooltip
53
+ })));
54
+ };
55
+ return _this;
56
+ }
57
+ (0, _createClass2.default)(ReduceAnswerChoicesSettings, [{
58
+ key: "render",
59
+ value: function render() {
60
+ return /*#__PURE__*/_react.default.createElement(_uiView.View, {
61
+ display: "block",
62
+ margin: "medium none"
63
+ }, /*#__PURE__*/_react.default.createElement(_uiCheckbox.Checkbox, {
64
+ variant: "toggle",
65
+ checked: this.props.courseAccommodationSettings.reduceChoicesEnabled || false,
66
+ label: this.renderSettingLabel((0, _formatMessage.default)('Reduced answer choices'), (0, _formatMessage.default)('Removes one incorrect answer from all multiple-choice questions that have 4 or more answer choices.')),
67
+ onChange: this.onChangeReduceChoices,
68
+ value: "reduce_choices_enabled"
69
+ }));
70
+ }
71
+ }]);
72
+ ReduceAnswerChoicesSettings.displayName = "ReduceAnswerChoicesSettings";
73
+ return ReduceAnswerChoicesSettings;
74
+ }(_react.Component);
75
+ exports.ReduceAnswerChoicesSettings = ReduceAnswerChoicesSettings;
76
+ ReduceAnswerChoicesSettings.propTypes = {
77
+ courseAccommodationSettings: _propTypes.default.shape({
78
+ reduceChoicesEnabled: _propTypes.default.bool
79
+ }).isRequired,
80
+ onChange: _propTypes.default.func.isRequired
81
+ };
82
+ ReduceAnswerChoicesSettings.defaultProps = {
83
+ courseAccommodationSettings: {
84
+ reduceChoicesEnabled: false
85
+ }
86
+ };
87
+ var _default = ReduceAnswerChoicesSettings;
88
+ exports.default = _default;
@@ -268,9 +268,6 @@ var ModerateTableRow = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.d
268
268
  }, (0, _formatMessage.default)('{ name }: { value }', elem)));
269
269
  }));
270
270
  }
271
-
272
- // Display the Accommodations and the button in a flex container with reverse order
273
- // so that the screen reader will read the accommodations first, and then the button
274
271
  return (0, _emotion.jsx)(_uiTable.Table.Cell, {
275
272
  "data-automation": "sdk-moderate-accommodations-text"
276
273
  }, displayContent);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/quiz-core",
3
- "version": "20.24.0",
3
+ "version": "20.25.0",
4
4
  "license": "MIT",
5
5
  "description": "The Quiz React SDK by Instructure Inc.",
6
6
  "author": "Instructure, Inc. Engineering and Product Design",
@@ -44,11 +44,11 @@
44
44
  "@instructure/emotion": "^8.51.0",
45
45
  "@instructure/grading-utils": "^1.0.0",
46
46
  "@instructure/outcomes-ui": "^3.2.2",
47
- "@instructure/quiz-common": "^20.24.0",
48
- "@instructure/quiz-i18n": "^20.24.0",
49
- "@instructure/quiz-interactions": "^20.24.0",
50
- "@instructure/quiz-number-input": "^20.24.0",
51
- "@instructure/quiz-rce": "^20.24.0",
47
+ "@instructure/quiz-common": "^20.25.0",
48
+ "@instructure/quiz-i18n": "^20.25.0",
49
+ "@instructure/quiz-interactions": "^20.25.0",
50
+ "@instructure/quiz-number-input": "^20.25.0",
51
+ "@instructure/quiz-rce": "^20.25.0",
52
52
  "@instructure/ui-a11y-content": "^8.51.0",
53
53
  "@instructure/ui-alerts": "^8.51.0",
54
54
  "@instructure/ui-avatar": "^8.51.0",
@@ -112,7 +112,7 @@
112
112
  "file-saver": "~2.0.5",
113
113
  "humps": "^2.0.0",
114
114
  "immutable": "^3.8.1",
115
- "instructure-validations": "^20.24.0",
115
+ "instructure-validations": "^20.25.0",
116
116
  "ipaddr.js": "^1.5.4",
117
117
  "isomorphic-fetch": "^2.2.0",
118
118
  "isuuid": "^0.1.0",
@@ -143,7 +143,7 @@
143
143
  "uuid": "^3.2.1"
144
144
  },
145
145
  "devDependencies": {
146
- "@instructure/quiz-scripts": "^20.24.0",
146
+ "@instructure/quiz-scripts": "^20.25.0",
147
147
  "@instructure/ui-axe-check": "^8.51.0",
148
148
  "@instructure/ui-babel-preset": "^7.22.1",
149
149
  "@instructure/ui-test-utils": "^7.22.1",
@@ -161,7 +161,7 @@
161
161
  "jquery": "^2.2.3",
162
162
  "karma-junit-reporter": "^2.0.1",
163
163
  "most-subject": "^5.3.0",
164
- "quiz-presets": "^20.24.0",
164
+ "quiz-presets": "^20.25.0",
165
165
  "react": "^16.8.6",
166
166
  "react-addons-test-utils": "^15.6.2",
167
167
  "react-dom": "^16.8.6",